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

JS/TS package acquisition #182801

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions build/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports.unicodeFilter = [
'!LICENSES.chromium.html',
'!**/LICENSE',

'!**/*.{dll,exe,png,bmp,jpg,scpt,cur,ttf,woff,eot,template,ico,icns,opus}',
'!**/*.{dll,exe,png,bmp,jpg,scpt,cur,ttf,woff,eot,template,ico,icns,opus,wasm}',
'!**/test/**',
'!**/*.test.ts',
'!**/*.{d.ts,json,md}',
Expand Down Expand Up @@ -85,6 +85,7 @@ module.exports.indentationFilter = [
'!test/smoke/out/**',
'!extensions/typescript-language-features/test-workspace/**',
'!extensions/typescript-language-features/resources/walkthroughs/**',
'!extensions/typescript-language-features/node-maintainer/**',
'!extensions/markdown-math/notebook-out/**',
'!extensions/ipynb/notebook-out/**',
'!extensions/vscode-api-tests/testWorkspace/**',
Expand Down Expand Up @@ -112,7 +113,7 @@ module.exports.indentationFilter = [
'!src/vs/*/**/*.d.ts',
'!src/typings/**/*.d.ts',
'!extensions/**/*.d.ts',
'!**/*.{svg,exe,png,bmp,jpg,scpt,bat,cmd,cur,ttf,woff,eot,md,ps1,template,yaml,yml,d.ts.recipe,ico,icns,plist,opus,admx,adml}',
'!**/*.{svg,exe,png,bmp,jpg,scpt,bat,cmd,cur,ttf,woff,eot,md,ps1,template,yaml,yml,d.ts.recipe,ico,icns,plist,opus,admx,adml,wasm}',
'!build/{lib,download,linux,darwin}/**/*.js',
'!build/**/*.sh',
'!build/azure-pipelines/**/*.js',
Expand Down Expand Up @@ -154,6 +155,7 @@ module.exports.copyrightFilter = [
'!**/*.disabled',
'!**/*.code-workspace',
'!**/*.js.map',
'!**/*.wasm',
'!build/**/*.init',
'!build/linux/libcxx-fetcher.*',
'!resources/linux/snap/snapcraft.yaml',
Expand All @@ -163,6 +165,7 @@ module.exports.copyrightFilter = [
'!extensions/markdown-language-features/media/highlight.css',
'!extensions/markdown-math/notebook-out/**',
'!extensions/ipynb/notebook-out/**',
'!extensions/typescript-language-features/node-maintainer/**',
'!extensions/html-language-features/server/src/modes/typescript/*',
'!extensions/*/server/bin/*',
'!src/vs/editor/test/node/classification/typescript-test.ts',
Expand Down
3 changes: 3 additions & 0 deletions extensions/shared.webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ function withBrowserDefaults(/**@type WebpackConfig & { context: string }*/extCo
},
},
]
}, {
test: /\.wasm$/,
type: 'asset/inline'
}]
},
externals: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
"parserOptions": {
"tsconfigRootDir": __dirname,
"project": "./tsconfig.json"
},
"rules": {
"@typescript-eslint/prefer-optional-chain": "warn",
"@typescript-eslint/prefer-readonly": "warn"
}
};

40 changes: 40 additions & 0 deletions extensions/typescript-language-features/package-manager/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Package Manager

This package is a web-compatible package manager built with tsserverlib
compatibility in mind. It does not require a "real" filesystem or a "real" NPM
installation, but instead uses [orogene](https://github.com/orogene/orogene)
to perform package management operations.

It is largely a thin wrapper around Orogene's [node-maintainer WASM
API](https://github.com/orogene/orogene/blob/abba96e6662c3465a498fbe6154ffcf2fe33fac4/crates/node-maintainer/src/wasm.rs).

## Updating vendored `node-maintainer`

Currently, this package vendors a prebuilt version of `node-maintainer` into
the `./node-maintainer` directory. This has to be manually built and updated
as needed whenever there are desired changes from orogene.

To update the directory:

1. `rm -rf ./node-maintainer`
2. clone https://github.com/orogene/orogene somewhere. See the [contributing
instructions](https://github.com/orogene/orogene/blob/abba96e6662c3465a498fbe6154ffcf2fe33fac4/CONTRIBUTING.md#getting-up-and-running)
for a guide on how to set up and build wasm modules.
3. `mv /path/to/orogene/crates/node-maintainer/pkg ./node-maintainer`
4. `git add node-maintainer && git commit -m 'updated node-maintainer'

## A Note on Build Requirements

To get this branch working, as of today (4/7/2023), you need to use a
TypeScript release that includes [this
commit](https://github.com/microsoft/TypeScript/commit/d23b7e7c52c471732079a9834bbfeef53b1a1697),
which has been merged into `main`, but not released yet.

In order to use an unreleased TypeScript with VS Code:

1. At the `../..` (`vscode/extensions/`) level, you should `npm link` the
version of typescript you want.
1. Go to your `typescript` source checkout
2. Call `npm link`
3. Go to `vscode/extensions`
4. Call `npm link typescript`
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# `node-maintainer`

An NPM dependency resolver for building `node_modules/` trees and
extracting them to their final resting place.

## Orogene

This package is part of [Orogene](https://orogene.dev), a package manager for
`node_modules/`.

## Contributing

For contributing guidelines, please see the [main orogenee
repository](https://github.com/orogene/orogene).

## License

For licensing information, please check [the LICENSE file in the Orogene
repository](https://github.com/orogene/orogene/blob/main/LICENSE).
Loading