Skip to content

Commit

Permalink
Add new repo mrtnzlml.com
Browse files Browse the repository at this point in the history
To be designed and developed.
  • Loading branch information
mrtnzlml committed Jun 9, 2024
1 parent 06db7f8 commit b8a6b28
Show file tree
Hide file tree
Showing 15 changed files with 328 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- '@adeira/abacus-tools'
- '@adeira/sx-design'
- '@adeira/typescript-test'
- '@adeira/mrtnzlml.com'
- 'mrtnzlml-meta'
include:
- repository: '@adeira/abacus-backoffice'
Expand All @@ -46,6 +47,10 @@ jobs:
source: 'src/typescript-test/**'
playwrightReportName: 'playwright-report-typescript-test'
playwrightReportPath: 'src/typescript-test/playwright/test-results/'
- repository: '@adeira/mrtnzlml.com'
source: 'src/mrtnzlml.com/**'
playwrightReportName: 'playwright-report-mrtnzlml-com'
playwrightReportPath: 'src/mrtnzlml.com/playwright/test-results/'
- repository: 'mrtnzlml-meta'
source: 'src/mrtnzlml-meta/**'
playwrightReportName: 'playwright-report-mrtnzlml-meta'
Expand Down
34 changes: 34 additions & 0 deletions src/mrtnzlml.com/.babelrc.js
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
},
},
],
],
};
24 changes: 24 additions & 0 deletions src/mrtnzlml.com/.eslintrc.js
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
},
},
};
37 changes: 37 additions & 0 deletions src/mrtnzlml.com/.gitignore
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
34 changes: 34 additions & 0 deletions src/mrtnzlml.com/Dockerfile
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"]
13 changes: 13 additions & 0 deletions src/mrtnzlml.com/README.md
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
```
44 changes: 44 additions & 0 deletions src/mrtnzlml.com/next.config.js
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 */);
26 changes: 26 additions & 0 deletions src/mrtnzlml.com/package.json
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"
}
}
27 changes: 27 additions & 0 deletions src/mrtnzlml.com/playwright.config.js
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'],
},
],
});
16 changes: 16 additions & 0 deletions src/mrtnzlml.com/playwright/.eslintrc.js
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,
},
};
7 changes: 7 additions & 0 deletions src/mrtnzlml.com/playwright/pages/index.play.js
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$/);
});
6 changes: 6 additions & 0 deletions src/mrtnzlml.com/src/app/_global.css
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;
}
22 changes: 22 additions & 0 deletions src/mrtnzlml.com/src/app/layout.js
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>
);
}
15 changes: 15 additions & 0 deletions src/mrtnzlml.com/src/app/page.js
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,
},
});
18 changes: 18 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,24 @@ __metadata:
languageName: unknown
linkType: soft

"@adeira/mrtnzlml.com@workspace:src/mrtnzlml.com":
version: 0.0.0-use.local
resolution: "@adeira/mrtnzlml.com@workspace:src/mrtnzlml.com"
dependencies:
"@adeira/babel-preset-adeira": "npm:^4.0.0"
"@babel/core": "npm:^7.24.7"
"@playwright/test": "npm:^1.44.1"
"@stylexjs/babel-plugin": "npm:^0.6.1"
"@stylexjs/nextjs-plugin": "npm:^0.6.1"
"@stylexjs/stylex": "npm:^0.6.1"
next: "npm:^14.2.3"
next-compose-plugins: "npm:^2.2.1"
next-plugin-custom-babel-config: "npm:^1.0.5"
react: "npm:^18.3.1"
react-dom: "npm:^18.3.1"
languageName: unknown
linkType: soft

"@adeira/murmur-hash@npm:^2.0.1, @adeira/murmur-hash@workspace:src/murmur-hash":
version: 0.0.0-use.local
resolution: "@adeira/murmur-hash@workspace:src/murmur-hash"
Expand Down

0 comments on commit b8a6b28

Please sign in to comment.