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

Add pnpm as a package manager #339

Merged
merged 10 commits into from
Jul 6, 2022
Merged
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Options:
-t, --extensionType # ts, js, colortheme, language, snippets, keymap...
--extensionId # Id of the extension
--extensionDescription # Description of the extension
--pkgManager # 'npm' or 'yarn'
--pkgManager # 'npm', 'yarn' or 'pnpm'
--webpack # Bundle the extension with webpack
--gitInit # Initialize a git repo

Expand Down
2 changes: 1 addition & 1 deletion generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = class extends Generator {
this.option('extensionId', { type: String, description: 'Id of the extension' });
this.option('extensionDescription', { type: String, description: 'Description of the extension' });

this.option('pkgManager', { type: String, description: `'npm' or 'yarn'` });
this.option('pkgManager', { type: String, description: `'npm', 'yarn' or 'pnpm'` });
this.option('webpack', { type: Boolean, description: `Bundle the extension with webpack` });
this.option('gitInit', { type: Boolean, description: `Initialize a git repo` });

Expand Down
6 changes: 5 additions & 1 deletion generators/app/prompts.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ exports.askForGit = (generator, extensionConfig) => {
*/
exports.askForPackageManager = (generator, extensionConfig) => {
let pkgManager = generator.options['pkgManager'];
if (pkgManager === 'npm' || pkgManager === 'yarn') {
if (pkgManager === 'npm' || pkgManager === 'yarn' || pkgManager === 'pnpm') {
extensionConfig.pkgManager = pkgManager;
return Promise.resolve();
}
Expand All @@ -144,6 +144,10 @@ exports.askForPackageManager = (generator, extensionConfig) => {
{
name: 'yarn',
value: 'yarn'
},
{
name: 'pnpm',
value: 'pnpm'
}
]
}).then(pckgManagerAnswer => {
Expand Down
4 changes: 2 additions & 2 deletions generators/app/templates/ext-notebook-renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
]
},
"scripts": {
"vscode:prepublish": "npm run compile",
"vscode:prepublish": "<%= pkgManager %> run compile",
"compile": "webpack --mode production",
"lint": "eslint src --ext ts",
"watch": "webpack --mode development --watch",
"pretest": "webpack --mode development && npm run lint",
"pretest": "webpack --mode development && <%= pkgManager %> run lint",
"test": "node ./out/test/runTest.js"
},
"devDependencies": {
Expand Down
Loading