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

Migrate to ES Module structure/runtime - Node 20, Vite, Vitest, Storybook 8 #272

Merged
merged 55 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
6b05e34
- update lerna and node, add eslint esm preset
twelch Mar 7, 2024
8e840a7
switch CI to use node 20
twelch Mar 7, 2024
1e5b15d
Migrate base-project and template packages to esm
twelch Mar 13, 2024
4e2faad
disable run of test suite on commit until resolved
twelch Mar 13, 2024
4f79454
missed test
twelch Mar 13, 2024
1732fe8
fix fetchPolyfill import
twelch Mar 13, 2024
bd13d38
switch to nodenext module and moduleResolution. Add assert to json i…
twelch Mar 13, 2024
34d7010
clean up import of CJS dependencies that don't have a true default im…
twelch Mar 13, 2024
399b10f
switch to tsx for translation extract and migrate babel config to cjs…
twelch Mar 13, 2024
001c32d
fix report name for template-blank-project
twelch Mar 14, 2024
00362ec
Switch from Jest to Vitest (#273)
twelch Apr 2, 2024
cf2e533
fix type error, upgrade node-fetch, fix launcher paths, VectorDatasou…
twelch Apr 5, 2024
2391c0a
add new world fgb and confirm test passing with latest unstable gp do…
twelch Apr 5, 2024
49028a5
downgrade flatgeobuf to resolve timeout error, add back skipped tests
twelch Apr 8, 2024
d9a3223
migrate to new import.meta.dirname available with node 20.12
twelch Apr 8, 2024
a9b5561
update fetch polyfill and upgrade again to latest flatgeobuf. subdiv…
twelch Apr 8, 2024
a69708a
unskip remaining tests utilizing flatgeobuf, update sideEffects for f…
twelch Apr 8, 2024
8c202b1
Merge branch 'dev' into esm and make esm-compatible
twelch Apr 8, 2024
0d10019
Switch to esbuild (#278)
twelch Apr 14, 2024
6b745bf
bring back template smoke tests
twelch Apr 15, 2024
68fd2f8
AWS - deploy pure ESM code for Lambda and client, on node 20 (#279)
twelch Apr 17, 2024
79370fc
upgrade zx, refactor translation install and extract to use scripts c…
twelch Apr 18, 2024
92f6bcb
add missing esbuild plugins add missing babel plugin for translation …
twelch Apr 18, 2024
233223f
cleanup isHostedOnLambda
twelch Apr 18, 2024
881eff6
process empty
twelch Apr 18, 2024
0f86ee5
bump
twelch Apr 18, 2024
3cbf0ff
directly set client lambda env vars
twelch Apr 18, 2024
a82413c
add esbuild metafile output
twelch Apr 18, 2024
6086b9e
add ANALYZE env vars
twelch Apr 19, 2024
1124c3c
fix metafile output path
twelch Apr 19, 2024
48ff6e6
Switch to gp core imports in client to not pull backend modules
twelch Apr 19, 2024
3b0d5c7
Allow minify to be overridden, defaults to true
twelch Apr 19, 2024
a8eae6e
fix minify arg passing
twelch Apr 19, 2024
43673c4
add cloufront access to client bucket to be able to access client fil…
twelch Apr 19, 2024
6e78970
update translationInstall to be more comprehensive
twelch Apr 19, 2024
dd550c8
update dirname in importTerms and publishTerms, loosen gitignore on i…
twelch Apr 19, 2024
144bbbf
Make sure .build dir created, remove old createManifest
twelch Apr 19, 2024
62bc5bc
bump
twelch Apr 19, 2024
ee804e7
simplify generateHandler, add guard to .build dir copy
twelch Apr 19, 2024
778f3be
Cut out intermediate build in gp .build dir, go straight to project p…
twelch Apr 19, 2024
cb7503a
simplify build client gp path discovery
twelch Apr 22, 2024
414afdb
make build client use gp dependencies. removes need for esbuild deps …
twelch Apr 22, 2024
2a337a8
replace use of esbuild-plugin-html which doesn't support entry point …
twelch Apr 23, 2024
ef6ce5e
upgrade to typescript 5.4.5
twelch Apr 25, 2024
631d985
swtich from assert json to with json
twelch Apr 25, 2024
6577438
fully switch from assert to with import syntax, esbuild still convert…
twelch Apr 25, 2024
dd819c9
rebuild package lockfile, major non-breaking npm upgrades
twelch Apr 26, 2024
feec025
additional upgrades:
twelch Apr 26, 2024
25ba9b8
upgrade babel proposal plugins to official
twelch Apr 26, 2024
735b82f
update husky prepare command, husky install is deprecated
twelch Apr 26, 2024
d9d4076
migrate to new styled-components .attrs() to define caller-defined at…
twelch Apr 28, 2024
b0cd88e
switch to transient prop for duration ProgressBar
twelch Apr 28, 2024
569c2c8
Vite for client dev, build, storybook (#282)
twelch May 14, 2024
bdb4a99
Merge branch 'esm' of https://github.com/seasketch/geoprocessing into…
twelch May 14, 2024
7c6bb19
nit Migrating
twelch May 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-test-api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ packages/example-*/
report.*
test-projects
**/.env
packages/*/src/i18n
packages/base-project/src/i18n
packages/template-*/src/i18n
.story-cache
3 changes: 2 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
. "$(dirname -- "$0")/_/husky.sh"

npx lerna run prepare # transpiles core geoprocessing code for templates
npx lerna run test:local # tests all packages including e2e tests not run by Github CI (GDAL, etc.)
# run tests including e2e tests not run by Github CI (GDAL, etc.)
npx lerna run test:local
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
20
83 changes: 41 additions & 42 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,39 @@
"configurations": [

{
"name": "geoprocessing - debug tests",
"name": "geoprocessing - debug src tests",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}/packages/geoprocessing",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/packages/geoprocessing/node_modules/.bin/jest",
"--group=-e2e"
"${workspaceRoot}/node_modules/.bin/vitest",
"-c",
"vitest.config.node.js"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"port": 9229
}, {
"name": "geoprocessing - debug tests with pattern",
"type": "node",
"request": "launch",
"name": "geoprocessing - debug current test file",
"autoAttachChildProcesses": true,
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
"program": "${workspaceRoot}/node_modules/vitest/vitest.mjs",
"args": ["run", "${relativeFile}"],
"smartStep": true,
"console": "integratedTerminal"
}, {
"name": "geoprocessing - debug src tests with pattern",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}/packages/geoprocessing",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/packages/geoprocessing/node_modules/.bin/jest",
"${workspaceRoot}/node_modules/.bin/vitest",
"-c",
"vitest.config.node.js",
"-t",
"${input:testNamePattern}"
],
Expand All @@ -34,80 +47,66 @@
"port": 9229
},
{
"name": "geoprocessing - debug tests scripts",
"name": "geoprocessing - debug scripts tests",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}/packages/geoprocessing",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/packages/geoprocessing/node_modules/.bin/jest",
"--projects",
"scripts"
"${workspaceRoot}/node_modules/.bin/vitest",
"-c",
"vitest.config.scripts.node.js"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"port": 9229
}, {
"name": "geoprocessing - debug tests scripts with pattern",
"name": "geoprocessing - debug scripts tests with pattern",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}/packages/geoprocessing",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/packages/geoprocessing/node_modules/.bin/jest",
"--projects",
"scripts",
"${workspaceRoot}/node_modules/.bin/vitest",
"-c",
"vitest.config.scripts.node.js",
"-t",
"${input:testNamePattern}"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"port": 9229
}, {
"name": "geoprocessing - debug e2e tests",
"name": "geoprocessing - debug src e2e tests",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}/packages/geoprocessing",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/packages/geoprocessing/node_modules/.bin/jest",
"--runInBand",
"--group=e2e"
"${workspaceRoot}/node_modules/.bin/vitest",
"-c",
"vitest.config.e2e.js"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"port": 9229
}, {
"name": "geoprocessing - debug e2e tests with pattern",
"name": "geoprocessing - debug src e2e tests with pattern",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}/packages/geoprocessing",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/packages/geoprocessing/node_modules/.bin/jest",
"--runInBand",
"--group=e2e",
"${workspaceRoot}/node_modules/.bin/vitest",
"-c",
"vitest.config.e2e.js",
"-t",
"${input:testNamePattern}"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"port": 9229
}, {
"name": "geoprocessing scripts- debug tests",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}/packages/geoprocessing",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/packages/geoprocessing/node_modules/.bin/jest",
"--projects",
"scripts"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"port": 9229
}, {
"name": "template-ocean-eez - debug tests",
"type": "node",
"request": "launch",
Expand All @@ -125,8 +124,8 @@
"request": "launch",
"name": "translation - debug importTerms",
"runtimeArgs": [
"-r",
"ts-node/register",
"--import",
"tsx",
],
"args": [
"${workspaceRoot}/packages/geoprocessing/src/i18n/bin/importTerms.ts"
Expand All @@ -136,8 +135,8 @@
"request": "launch",
"name": "translation - debug publishTerms",
"runtimeArgs": [
"-r",
"ts-node/register",
"--import",
"tsx",
],
"args": [
"${workspaceRoot}/packages/geoprocessing/src/i18n/bin/publishTerms.ts"
Expand All @@ -162,8 +161,8 @@
"request": "launch",
"name": "run any ts-node script",
"runtimeArgs": [
"-r",
"ts-node/register/transpile-only",
"--import",
"tsx",
],
"args": [
"${workspaceRoot}/packages/geoprocessing/${input:scriptPath}"
Expand All @@ -180,7 +179,7 @@
{
"type": "promptString",
"id": "testNamePattern",
"description": "jest -t 'regex pattern to select tests'",
"description": "vitest -t 'regex pattern to select tests'",
"default": "name of my test"
},
{
Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
},
"files.exclude": {},
"git.ignoreLimitWarning": true,
"jest.rootPath": "packages/geoprocessing",
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#004b99",
"activityBar.activeBorder": "#ff007d",
Expand Down Expand Up @@ -61,5 +60,6 @@
"i18n-ally.keysInUse": [
"description.part2_whatever"
],
"i18n-ally.defaultNamespace": "translation"
"i18n-ally.defaultNamespace": "translation",
"vitest.disableWorkspaceWarning": true
}
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = {
keyAsDefaultValueForDerivedKeys: true,
},
],
["@babel/plugin-syntax-import-attributes"],
],
overrides: [
{ test: /\.js$/, presets: common },
Expand Down
4 changes: 1 addition & 3 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"packages": [
"packages/*"
],
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "6.1.2"
}
Loading
Loading