Skip to content

Commit

Permalink
Merge pull request #339 from nhedger/feat/add-pnpm-support
Browse files Browse the repository at this point in the history
Add pnpm as a package manager
  • Loading branch information
aeschli authored Jul 6, 2022
2 parents b71af41 + 60ed17f commit 3b223ed
Show file tree
Hide file tree
Showing 5 changed files with 442 additions and 6 deletions.
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

0 comments on commit 3b223ed

Please sign in to comment.