Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
.github
.env
.next
.svelte-kit
backend
build
docker
docker-compose.yml
frontend
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: CI

on:
pull_request:
branches:
- main

permissions:
contents: read
Expand Down Expand Up @@ -32,6 +30,8 @@ jobs:
cache: npm
- run: npm ci
- run: npm run lint
- run: npm run check
- run: npm run test
- run: npm run build

actionlint:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
# testing
/coverage

# next.js
# framework output
/.next/
/.svelte-kit/
/out/

# production
Expand Down
4 changes: 3 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
"trailingComma": "all",
"endOfLine": "lf",
"tabWidth": 4,
"useTabs": false
"useTabs": false,
"plugins": ["prettier-plugin-svelte"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
22 changes: 12 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,24 @@ FROM base AS builder
WORKDIR /app
COPY --from=dependencies /app/node_modules ./node_modules
COPY . .
ENV NEXT_TELEMETRY_DISABLED=1
RUN npm run build

FROM base AS production-dependencies
WORKDIR /app
COPY package.json package-lock.json .npmrc ./
RUN npm ci --omit=dev

FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production \
NEXT_TELEMETRY_DISABLED=1 \
HOSTNAME=0.0.0.0 \
HOST=0.0.0.0 \
PORT=3000
RUN addgroup --system --gid 1001 nodejs \
&& adduser --system --uid 1001 nextjs
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
LABEL org.opencontainers.image.description="MethodConf Frontend - Next.js"
&& adduser --system --uid 1001 sveltekit
COPY --from=production-dependencies /app/node_modules ./node_modules
COPY --from=builder --chown=sveltekit:nodejs /app/build ./build
LABEL org.opencontainers.image.description="MethodConf Frontend - SvelteKit"
LABEL org.opencontainers.image.licenses=MIT
USER nextjs
USER sveltekit
EXPOSE 3000
CMD ["node", "server.js"]
CMD ["node", "build"]
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
# MethodConf

The Next.js frontend for [MethodConf](https://www.methodconf.com/). The Umbraco CMS lives in [`sgfdevs/cms.methodconf.com`](https://github.com/sgfdevs/cms.methodconf.com).
The MethodConf frontend is being migrated to SvelteKit. This branch only contains the temporary SvelteKit shell and tooling base. The old Next.js source stays in the repo as reference until the page migration layers replace it.

## Local Development
The Umbraco CMS lives in [`sgfdevs/cms.methodconf.com`](https://github.com/sgfdevs/cms.methodconf.com).

1. Copy `.env.example` to `.env` and configure the CMS and site URLs.
## Local development

1. Copy `.env.example` to `.env` when working on routes that need CMS or newsletter configuration.
2. Install dependencies and start the development server:

```bash
npm ci
npm run dev
```

The production image can be built locally with:
Useful checks for this foundation layer:

```bash
npm run lint
npm run check
npm run test
npm run build
```

The production smoke image can be built locally with:

```bash
docker build \
--build-arg NEXT_PUBLIC_UMBRACO_BASE_URL=https://cms.methodconf.com/ \
--build-arg NEXT_PUBLIC_SITE_URL=https://www.methodconf.com/ \
-t methodconf.com .
docker build -t methodconf.com .
```
54 changes: 39 additions & 15 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,24 +1,48 @@
import nextCoreWebVitals from 'eslint-config-next/core-web-vitals';
import nextTypeScript from 'eslint-config-next/typescript';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import js from '@eslint/js';
import prettier from 'eslint-config-prettier';
import prettierPlugin from 'eslint-plugin-prettier';
import svelte from 'eslint-plugin-svelte';
import tseslint from 'typescript-eslint';

const eslintConfig = [
export default tseslint.config(
{
ignores: ['src/data/umbraco/*.d.ts'],
ignores: [
'.next/**',
'.svelte-kit/**',
'build/**',
'coverage/**',
'node_modules/**',
'next-env.d.ts',
'next.config.ts',
'src/app/**',
'src/components/**',
'src/config.ts',
'src/data/**',
'src/serverConfig.ts',
'src/util.ts',
],
},
...nextCoreWebVitals,
...nextTypeScript,
js.configs.recommended,
...tseslint.configs.recommended,
...svelte.configs.recommended,
...svelte.configs.prettier,
prettier,
{
settings: {
react: {
version: '19.0',
files: ['src/routes/**/*.svelte', 'src/lib/**/*.svelte'],
languageOptions: {
parserOptions: {
parser: tseslint.parser,
extraFileExtensions: ['.svelte'],
},
},
},
{
files: ['**/*.{js,ts,mjs,svelte}'],
plugins: {
prettier: prettierPlugin,
},
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
'prettier/prettier': 'error',
},
},
eslintPluginPrettierRecommended,
];

export default eslintConfig;
);
11 changes: 7 additions & 4 deletions generateUmbracoApiClient.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import fs from 'node:fs';
import path from 'path';
import { loadEnvConfig } from '@next/env';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import openapiTS, { astToString } from 'openapi-typescript';
loadEnvConfig(process.cwd());
import { loadEnv } from 'vite';

const __dirname = path.dirname(fileURLToPath(import.meta.url));
const env = loadEnv('', process.cwd(), '');

async function main() {
const baseUrl = new URL(process.env.UMBRACO_BASE_URL ?? '');
const baseUrl = new URL(env.UMBRACO_BASE_URL ?? '');

const schemaConfigs = [
{
Expand Down
Loading
Loading