-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To be designed and developed.
- Loading branch information
Showing
15 changed files
with
328 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// @flow strict | ||
|
||
const styleXPlugin = require('@stylexjs/babel-plugin'); | ||
|
||
module.exports = { | ||
presets: [ | ||
[ | ||
'@adeira/babel-preset-adeira', | ||
{ | ||
target: | ||
process.env.NODE_ENV === 'test' | ||
? 'js' // Jest doesn't support ES6 modules by default. | ||
: 'js-esm', // To support dynamic `import(…)` for `@adeira/icons`. | ||
}, | ||
], | ||
], | ||
plugins: [ | ||
[ | ||
styleXPlugin, | ||
{ | ||
// https://stylexjs.com/docs/api/configuration/babel-plugin/ | ||
dev: process.env.NODE_ENV === 'development', | ||
test: false, | ||
treeshakeCompensation: true, | ||
|
||
// Required for CSS variable support | ||
unstable_moduleResolution: { | ||
type: 'commonJS', | ||
rootDir: __dirname, // The absolute path to the root directory of the project | ||
}, | ||
}, | ||
], | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// @flow strict | ||
|
||
/* eslint-disable no-unused-vars */ | ||
const OFF = 0; | ||
const WARN = 1; | ||
const ERROR = 2; | ||
/* eslint-enable no-unused-vars */ | ||
|
||
module.exports = { | ||
env: { | ||
browser: true, | ||
}, | ||
extends: [ | ||
'@adeira/eslint-config/strict', // preset with almost everything | ||
'@adeira/eslint-config/fbt', // additional FBT rules | ||
'@adeira/eslint-config/next', // additional Next.js rules | ||
'@adeira/eslint-config/react', | ||
], | ||
settings: { | ||
next: { | ||
rootDir: __dirname, // https://nextjs.org/docs/basic-features/eslint#rootdir | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# Sentry | ||
.sentryclirc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Install dependencies only when needed | ||
FROM node:21.7.3-alpine AS deps | ||
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. | ||
RUN apk add --no-cache libc6-compat | ||
WORKDIR /app | ||
COPY package.json ./ | ||
RUN yarn install # --immutable | ||
|
||
# Rebuild the source code only when needed | ||
FROM node:21.7.3-alpine AS builder | ||
WORKDIR /app | ||
COPY . . | ||
COPY --from=deps /app/node_modules ./node_modules | ||
RUN yarn build && yarn install # --immutable | ||
|
||
# Production image, copy all the files and run next | ||
FROM node:21.7.3-alpine AS runner | ||
WORKDIR /app | ||
|
||
ENV NODE_ENV production | ||
|
||
COPY --from=builder /app/next.config.js ./ | ||
COPY --from=builder /app/.next ./.next | ||
COPY --from=builder /app/node_modules ./node_modules | ||
COPY --from=builder /app/package.json ./package.json | ||
|
||
EXPOSE 3000 | ||
|
||
# Next.js collects completely anonymous telemetry data about general usage. | ||
# Learn more here: https://nextjs.org/telemetry | ||
# Uncomment the following line in case you want to disable telemetry. | ||
# ENV NEXT_TELEMETRY_DISABLED 1 | ||
|
||
CMD ["yarn", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
New version of https://mrtnzlml.com/ | ||
|
||
Development: | ||
|
||
```bash | ||
yarn workspace @adeira/mrtnzlml.com dev | ||
``` | ||
|
||
Playwright: | ||
|
||
```bash | ||
yarn workspace @adeira/mrtnzlml.com playwright test | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// @flow | ||
|
||
/* eslint-disable import/order */ | ||
|
||
const path = require('path'); | ||
const withPlugins = require('next-compose-plugins'); | ||
|
||
const withCustomBabelConfigFile = require('next-plugin-custom-babel-config')({ | ||
babelConfigFile: path.join(__dirname, '.babelrc.js'), | ||
}); | ||
|
||
const withStylex = require('@stylexjs/nextjs-plugin')({ | ||
rootDir: __dirname, | ||
}); | ||
|
||
module.exports = (withPlugins( | ||
[ | ||
[withCustomBabelConfigFile], | ||
[withStylex], | ||
// other plugins here | ||
], | ||
{ | ||
poweredByHeader: false, | ||
reactStrictMode: true, | ||
devIndicators: { | ||
buildActivity: true, | ||
}, | ||
eslint: { | ||
ignoreDuringBuilds: true, | ||
}, | ||
webpack: (nextConfig) => { | ||
nextConfig.module.rules.push({ | ||
type: 'javascript/auto', | ||
test: /\.mjs$/, | ||
}); | ||
return nextConfig; | ||
}, | ||
experimental: { | ||
// https://github.com/vercel/next.js/issues/23725 | ||
// https://github.com/vercel/next.js/pull/27069 | ||
esmExternals: 'loose', | ||
}, | ||
}, | ||
) /*: $FlowFixMe */); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "@adeira/mrtnzlml.com", | ||
"version": "0.0.0", | ||
"private": true, | ||
"license": "UNLICENSED", | ||
"scripts": { | ||
"dev": "next dev --port=3000", | ||
"build": "next build", | ||
"start": "next start --port=3000" | ||
}, | ||
"dependencies": { | ||
"@stylexjs/nextjs-plugin": "^0.6.1", | ||
"@stylexjs/stylex": "^0.6.1", | ||
"next": "^14.2.3", | ||
"next-compose-plugins": "^2.2.1", | ||
"next-plugin-custom-babel-config": "^1.0.5", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1" | ||
}, | ||
"devDependencies": { | ||
"@adeira/babel-preset-adeira": "^4.0.0", | ||
"@babel/core": "^7.24.7", | ||
"@playwright/test": "^1.44.1", | ||
"@stylexjs/babel-plugin": "^0.6.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// eslint-disable-next-line ft-flow/require-valid-file-annotation,import/no-extraneous-dependencies | ||
const { devices, defineConfig } = require('@playwright/test'); | ||
|
||
export default defineConfig({ | ||
testDir: 'playwright', | ||
outputDir: 'playwright/test-results', | ||
testMatch: '**.play.js', | ||
forbidOnly: !!process.env.CI, | ||
reporter: process.env.CI ? 'github' : 'list', | ||
retries: process.env.CI ? 2 : 0, | ||
webServer: { | ||
command: 'yarn dev', | ||
port: 3000, | ||
timeout: 120 * 1000, // milliseconds | ||
reuseExistingServer: !process.env.CI, | ||
}, | ||
use: { | ||
trace: 'on-first-retry', | ||
screenshot: 'only-on-failure', | ||
}, | ||
projects: [ | ||
{ | ||
name: 'Desktop Chrome', | ||
use: devices['Desktop Chrome'], | ||
}, | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// @flow strict | ||
|
||
/* eslint-disable no-unused-vars */ | ||
const OFF = 0; | ||
const WARN = 1; | ||
const ERROR = 2; | ||
/* eslint-enable no-unused-vars */ | ||
|
||
module.exports = { | ||
rules: { | ||
// Jest rules incompatible with Playwright: | ||
'jest/no-disabled-tests': OFF, | ||
'jest/no-standalone-expect': OFF, | ||
'jest/valid-title': OFF, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// eslint-disable-next-line ft-flow/require-valid-file-annotation,import/no-extraneous-dependencies | ||
const { test, expect } = require('@playwright/test'); | ||
|
||
test('that the index page works', async ({ page }) => { | ||
await page.goto('/'); | ||
await expect(page).toHaveTitle(/^mrtnzlml\.com$/); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* https://github.com/rsms/inter */ | ||
@import url('https://rsms.me/inter/inter.css'); | ||
|
||
:root { | ||
font-family: 'Inter', sans-serif; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// @flow | ||
|
||
import React, { type Node } from 'react'; | ||
|
||
import './_global.css'; // This must exist even if empty for StyleX to work! | ||
|
||
export const metadata = { | ||
title: 'mrtnzlml.com', | ||
description: 'Martin Zlámal', | ||
}; | ||
|
||
type Props = { | ||
+children: Node, | ||
}; | ||
|
||
export default function RootLayout({ children }: Props): Node { | ||
return ( | ||
<html lang="en"> | ||
<body>{children}</body> | ||
</html> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// @flow | ||
|
||
import React, { type Node } from 'react'; | ||
import * as sx from '@stylexjs/stylex'; | ||
|
||
export default function Homepage(): Node { | ||
return <strong {...sx.props(styles.todo)}>TODO: mrtnzlml.com</strong>; | ||
} | ||
|
||
const styles = sx.create({ | ||
todo: { | ||
color: 'green', | ||
fontSize: 20, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters