-
-
Notifications
You must be signed in to change notification settings - Fork 611
Closed
Description
@CharlieHelps your task is described below. read the instructions and reply with an implementation plan:
Objective: Update the alias package in packages/alias to use ESM only and update minimum platform dependencies
Steps:
- Update the minimum node version in package.json to 20.19.0. (20.19.0 is the first LTS maintenance version which supports frictionless inline ESM/CJS imports/requires)
- Update the minimum rollup version in package.json to 4.0.0
- Given the minimum Node version of 20.19.0, update any code within
packages/aliasto use modern Node APIs unless it is detrimental to performance - Create a new
.configdirectory at the repo root - Create a copy of
shared/rollup.config.mjsat.config/rollup-plugin.mjsand remove the typescript rollup plugin from.config/rollup-plugin.mjs - Create a copy of
tsconfig.base.jsonat.config/tsconfig.base.json - Create a copy of
shared/tsconfig.jsonat.config/tsconfig.plugin.json, and change the extended config to./tsconfig.base.json - Update
.config/tsconfig.base.jsonto use the latest module, resolution, lib settings which corresponds to the alias plugin moving to ESM only - Update
.config/tsconfig.plugin.json, setnoEmit: falseandoutDir: tsc.out - Update the
packages/alias/tsconfig.jsonsymlink to point to.config/tsconfig.plugin.json - Update the plugin's build scripts to execute
tsc --project tsconfig.jsonbefore rollup is executed - Update the
packages/alias/rollup.config.mjsfile to use.config/rollup-plugin.mjs - Update the
packages/alias/rollup.config.mjsfile to target the files in./tsc.out - Update the
packages/alias/rollup.config.mjsfile to use the appropriate rollup plugin (if one exists, otherwise use code) to include/copy source maps and type definitions fromtsc.outtodist - Update the
packages/alias/package.jsonfile to properly setup properties and exports for an ESM only package - Compare the types created from
tscto those which were previously hand-authored inpackages/alias/types/index.d.ts- improve the code inpackages/alias/src/index.tsif the hand-authored types contain information that the generated types do not - we want to make sure we're not degrading the developer experience - Install vitest 4.0.1 at the repository root using
pnpm add vitest@latest -w -D - Create a new vitest config file in
.configwhich forces snapshots to be saved in the relative test directory under.snapshots - Run current tests to understand how they work
- Remove all CJS branches in tests, they will no longer be relevant
- Convert tests in
packages/alias/testfrom Ava to vitest and update the test files to use typescript (.ts) instead of plain javascript - Run tests and include the snapshot files in any commits. Any existing snapshot files will need to be overwritten as existing files will be in the Ava format. This is OK since we know that tests are passing
- Update CONTRIBUTING.md to include information about the
current-packagesymlink described below
Notes:
- Each package’s tests include a symlink at test/node_modules/current-package pointing back to the
package root (../..). If you seeimport ... from 'current-package'that's where the import points to - PR title should follow the format
feat({plugin})!: ESM only. Update Node and Rollup minimum versions
Metadata
Metadata
Assignees
Labels
No labels