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

build: Use NPM v7 #15

Merged
merged 2 commits into from
Jun 14, 2021
Merged

build: Use NPM v7 #15

merged 2 commits into from
Jun 14, 2021

Conversation

pastelmind
Copy link
Contributor

NPM 7 is the latest version of NPM. I ran npm install to update package-lock.json format to v2.

NPM v7 has a bug with aliased packages when running npm outdated. To avoid this, I installed kolmafia-types without aliasing, and update TypeScript's config to resolve kolmafia to kolmafia-types.

I also installed tsconfig-paths to make the workaround work with ts-node.

Ran `npm install` to migrate `package-lock.json` format to v2
Due to a bug in NPM v7, `npm outdated` fails when kolmafia-types is
aliased. To work around this, we install `kolmafia-types` by its name,
and TypeScript's `compilerOptions.paths` field is used to resolve
`kolmafia` to `kolmafia-types`.

We also install:

- kolmafia-types 0.1.1 (updated)
- tsconfig-paths which is needed to run tests with Jasmine + ts-node

See also:

- GitHub issue for the NPM v7 bug:
  npm/cli#2800
- Description of the workaround:
  https://github.com/pastelmind/kolmafia-types/tree/v0.1.1#method-2-use-a-custom-path-to-resolve-kolmafia
@pastelmind pastelmind added the type: maintenance Project maintenance stuff label Jun 14, 2021
@pastelmind pastelmind self-assigned this Jun 14, 2021
@pastelmind pastelmind merged commit acafbf0 into main Jun 14, 2021
@pastelmind pastelmind deleted the build-npm-7 branch June 14, 2021 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: maintenance Project maintenance stuff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant