Skip to content

Commit

Permalink
the 7 stages of preact grief
Browse files Browse the repository at this point in the history
  • Loading branch information
Arc-blroth committed Feb 11, 2024
1 parent 016acfc commit 89cdeaf
Show file tree
Hide file tree
Showing 8 changed files with 20,013 additions and 14,771 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ $RECYCLE.BIN

# preact-cli build size plugin
size-plugin.json

# ACM Cyber: update to yarn 4
.yarn/*
!.yarn/patches
14 changes: 14 additions & 0 deletions .yarn/patches/preact-cli-npm-3.5.1-ba330688c2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/src/lib/webpack/transform-config.js b/src/lib/webpack/transform-config.js
index a36ae642575048993652002ad86f524a45f3fd83..7f14bd60b73cbc0eec12f24d2fead57e6e915532 100644
--- a/src/lib/webpack/transform-config.js
+++ b/src/lib/webpack/transform-config.js
@@ -107,7 +107,8 @@ module.exports = async function (env, webpackConfig, isServer = false) {

let m;
try {
- m = esmImport(cliConfig);
+ // me and Jason went through the seven stages of grief to find this line ~Andrew
+ m = await import(cliConfig);
} catch (error) {
warn(
`Failed to load preact-cli config file, using default!\n${
1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
10 changes: 3 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
FROM node:21-bookworm-slim AS build
WORKDIR /app

COPY package.json yarn.lock ./
RUN yarn install --dev --frozen-lockfile && yarn cache clean

COPY . .
RUN yarn build
RUN yarn set version berry && yarn install && yarn cache clean && yarn build

FROM node:21-bookworm-slim AS run
WORKDIR /app

COPY yarn.lock package.json /app/

COPY . .
ENV NODE_ENV production
RUN yarn install --prod --frozen-lockfile && yarn cache clean
RUN yarn set version berry && yarn install && yarn cache clean

COPY conf.d /app/conf.d
COPY --from=build /app/dist /app/dist
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"lint:strict": "sh -c \"tsc --noEmit -p tsconfig.strict.json ; eslint .\"",
"start": "node --enable-source-maps --unhandled-rejections=strict dist/server/index.js",
"migrate": "yarn build:ts && cross-env RCTF_DATABASE_MIGRATE=only yarn start",
"build:client": "preact build --src client/src --template client/index.html --dest dist/build --no-prerender --no-inline-css",
"build:client": "preact build --verbose --src client/src --template client/index.html --dest dist/build --no-prerender --no-inline-css",
"build:ts": "tsc && yarn copy-static",
"build": "yarn build:ts && yarn build:client",
"watch:client": "cross-env NODE_ENV=development preact watch --src client/src --template client/index.html",
Expand Down Expand Up @@ -101,9 +101,9 @@
"pascal-case": "3.1.1",
"pino-pretty": "4.1.0",
"preact": "^10.19.4",
"preact-cli": "^3.5.1",
"preact-markup": "2.0.0",
"preact-router": "3.2.1",
"preact-cli": "patch:preact-cli@npm%3A3.5.1#.yarn/patches/preact-cli-npm-3.5.1-ba330688c2.patch",
"preact-markup": "^2.1.1",
"preact-router": "^4.1.2",
"purgecss-webpack-plugin": "2.3.0",
"snarkdown": "1.2.2",
"supertest": "4.0.2",
Expand All @@ -125,5 +125,6 @@
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
},
"packageManager": "[email protected]"
}
4 changes: 2 additions & 2 deletions preact.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const assert = require('assert').strict

const PurgecssPlugin = require('purgecss-webpack-plugin')

export default (config, env, helpers) => {
module.exports = (config, env, helpers) => {
if (env.production) {
// Disable sourcemaps
config.devtool = false
Expand All @@ -21,7 +21,7 @@ export default (config, env, helpers) => {

config.resolveLoader.modules.unshift(path.resolve(__dirname, 'client/lib/loaders'))

const { rule: { options: babelConfig } } = helpers.getLoadersByName(config, 'babel-loader')[0]
const { loader: { options: babelConfig } } = helpers.getLoadersByName(config, 'babel-loader')[0]
babelConfig.plugins.push('transform-export-extensions')

// The webpack base config has minicssextractplugin already loaded
Expand Down
34,739 changes: 19,983 additions & 14,756 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 89cdeaf

Please sign in to comment.