Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use two-step build #115

Merged
merged 22 commits into from
Mar 15, 2024
Merged

chore: use two-step build #115

merged 22 commits into from
Mar 15, 2024

Conversation

SgtPooki
Copy link
Member

@SgtPooki SgtPooki commented Mar 14, 2024

Creates a two step build process so we can benefit from test environment that aegir gives us without having to finagle a ton of other test env setup.

Ideally, we would use only aegir for building, but aegir doesn't do us any favor building web assets

Tasks

@SgtPooki SgtPooki marked this pull request as ready for review March 15, 2024 00:49
@SgtPooki SgtPooki requested review from 2color and lidel March 15, 2024 00:49
@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

Copy link
Member Author

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self review

.aegir.js Outdated
Comment on lines 48 to 65
build: {
config: {
banner: {},
footer: {},
entryPoints: [`${paths.src}/src/index.jsx`, `${paths.src}/src/sw.js`],
minify: false,
splitting: true,
format: 'esm',
outdir: paths.dist,
chunkNames: 'ipfs-sw-[name]',
loader: {
'.svg': 'dataurl'
},
sourcemap: true,
plugins: [copyPlugin],
define: { 'process.env.NODE_ENV': '"production"' }
}
},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need the results of this.

"test:browsers": "playwright test -c playwright.config.js",
"test:chrome": "playwright test -c playwright.config.js --project chromium",
"test:firefox": "playwright test -c playwright.config.js --project firefox",
"test:node": "aegir test -t node -f dist-tsc/test/node.js --cov",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@achingbrain I could probably use your aegir expertise on why aegir isn't recognizing the node.js file is only for nodejs tests

@@ -0,0 +1,42 @@
diff --git a/node_modules/aegir/src/build/index.js b/node_modules/aegir/src/build/index.js
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created issue in ipfs/aegir: ipfs/aegir#1481.

will remove.

test/node.ts Outdated Show resolved Hide resolved
tsconfig.json Outdated Show resolved Hide resolved
webpack.config.js Outdated Show resolved Hide resolved
webpack.config.js Outdated Show resolved Hide resolved
webpack.config.js Outdated Show resolved Hide resolved
Comment on lines +253 to +258
extensionAlias: {
'.js': ['.js', '.ts'],
'.jsx': ['.jsx', '.tsx'],
'.cjs': ['.cjs', '.cts'],
'.mjs': ['.mjs', '.mts']
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixes error in webpack when using .js imports inside TS files during npm start

@SgtPooki
Copy link
Member Author

pinging folks so they know... @2color @lidel @aschmahmann if you've got code changes in this repo, you may be in for an annoying rebase.. but things seem to be looking good so i'm merging before folks get a chance to work on something that will be swept out from under them.

@SgtPooki SgtPooki merged commit bf6a382 into main Mar 15, 2024
21 checks passed
@SgtPooki SgtPooki deleted the chore/use-esbuild branch March 15, 2024 01:23
@lidel lidel mentioned this pull request Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants