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

When using pnpm, pretest won't run by default #372

Merged
merged 3 commits into from
Oct 3, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [14.x, 16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
2 changes: 2 additions & 0 deletions generators/app/generate-command-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ module.exports = {

if (extensionConfig.pkgManager === 'yarn') {
generator.fs.copyTpl(generator.templatePath('.yarnrc'), generator.destinationPath('.yarnrc'), extensionConfig);
} else if (extensionConfig.pkgManager === 'pnpm') {
generator.fs.copyTpl(generator.templatePath('.npmrc-pnpm'), generator.destinationPath('.npmrc'), extensionConfig);
}

extensionConfig.installDependencies = true;
Expand Down
2 changes: 2 additions & 0 deletions generators/app/generate-command-ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ module.exports = {

if (extensionConfig.pkgManager === 'yarn') {
generator.fs.copyTpl(generator.templatePath('.yarnrc'), generator.destinationPath('.yarnrc'), extensionConfig);
} else if (extensionConfig.pkgManager === 'pnpm') {
generator.fs.copyTpl(generator.templatePath('.npmrc-pnpm'), generator.destinationPath('.npmrc'), extensionConfig);
}

extensionConfig.installDependencies = true;
Expand Down
2 changes: 2 additions & 0 deletions generators/app/generate-command-web.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ module.exports = {

if (extensionConfig.pkgManager === 'yarn') {
generator.fs.copyTpl(generator.templatePath('.yarnrc'), generator.destinationPath('.yarnrc'), extensionConfig);
} else if (extensionConfig.pkgManager === 'pnpm') {
generator.fs.copyTpl(generator.templatePath('.npmrc-pnpm'), generator.destinationPath('.npmrc'), extensionConfig);
}

extensionConfig.installDependencies = true;
Expand Down
2 changes: 2 additions & 0 deletions generators/app/generate-localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ module.exports = {

if (extensionConfig.pkgManager === 'yarn') {
generator.fs.copyTpl(generator.templatePath('.yarnrc'), generator.destinationPath('.yarnrc'), extensionConfig);
} else if (extensionConfig.pkgManager === 'pnpm') {
generator.fs.copyTpl(generator.templatePath('.npmrc-pnpm'), generator.destinationPath('.npmrc'), extensionConfig);
}

extensionConfig.installDependencies = true;
Expand Down
2 changes: 2 additions & 0 deletions generators/app/generate-notebook-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ module.exports = {

if (extensionConfig.pkgManager === 'yarn') {
generator.fs.copyTpl(generator.templatePath('.yarnrc'), generator.destinationPath('.yarnrc'), extensionConfig);
} else if (extensionConfig.pkgManager === 'pnpm') {
generator.fs.copyTpl(generator.templatePath('.npmrc-pnpm'), generator.destinationPath('.npmrc'), extensionConfig);
}

extensionConfig.installDependencies = true;
Expand Down
8 changes: 0 additions & 8 deletions generators/app/generate-snippets.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,3 @@ function getFileContent(filePath, errors) {
return null;
}
}

function isFile(filePath) {
try {
return fs.statSync(filePath).isFile()
} catch (e) {
return false;
}
}
1 change: 1 addition & 0 deletions generators/app/templates/ext-command-js/.npmrc-pnpm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enable-pre-post-scripts = true
1 change: 1 addition & 0 deletions generators/app/templates/ext-command-ts/.npmrc-pnpm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enable-pre-post-scripts = true
1 change: 1 addition & 0 deletions generators/app/templates/ext-command-web/.npmrc-pnpm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enable-pre-post-scripts = true
1 change: 1 addition & 0 deletions generators/app/templates/ext-localization/.npmrc-pnpm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enable-pre-post-scripts = true
1 change: 1 addition & 0 deletions generators/app/templates/ext-notebook-renderer/.npmrc-pnpm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enable-pre-post-scripts = true
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"url": "https://github.com/Microsoft"
},
"engines": {
"node": ">=12.10.0"
"node": ">=14.15.0"
},
"scripts": {
"test": "mocha",
Expand Down
10 changes: 5 additions & 5 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ describe('test code generator', function () {
}
};
try {
assertFiles(runResult, 'testCom', ['src/extension.ts', 'src/test/suite/extension.test.ts', 'src/test/suite/index.ts', 'tsconfig.json', '.eslintrc.json', '.vscode/extensions.json']);
assertFiles(runResult, 'testCom', ['src/extension.ts', 'src/test/suite/extension.test.ts', 'src/test/suite/index.ts', 'tsconfig.json', '.eslintrc.json', '.vscode/extensions.json', '.npmrc']);

runResult.assertJsonFileContent('testCom/package.json', expectedPackageJSON);

Expand Down Expand Up @@ -1001,7 +1001,7 @@ describe('test code generator', function () {
try {


assertFiles(runResult, 'testCom', ['src/extension.ts', 'src/test/suite/extension.test.ts', 'src/test/suite/index.ts', 'tsconfig.json']);
assertFiles(runResult, 'testCom', ['src/extension.ts', 'src/test/suite/extension.test.ts', 'src/test/suite/index.ts', 'tsconfig.json', '.npmrc']);

runResult.assertJsonFileContent('testCom/package.json', expectedPackageJSON);

Expand Down Expand Up @@ -1131,7 +1131,7 @@ describe('test code generator', function () {
}
};
try {
assertFiles(runResult, 'testCom', ['extension.js', 'test/suite/extension.test.js', 'test/suite/index.js', 'jsconfig.json']);
assertFiles(runResult, 'testCom', ['extension.js', 'test/suite/extension.test.js', 'test/suite/index.js', 'jsconfig.json', '.npmrc']);

runResult.assertJsonFileContent('testCom/package.json', expectedPackageJSON);

Expand Down Expand Up @@ -1495,7 +1495,7 @@ describe('test code generator', function () {
}
};
try {
assertFiles(runResult, 'testCom', ['src/web/extension.ts', 'webpack.config.js', 'src/web/test/suite/extension.test.ts', 'src/web/test/suite/index.ts', 'tsconfig.json']);
assertFiles(runResult, 'testCom', ['src/web/extension.ts', 'webpack.config.js', 'src/web/test/suite/extension.test.ts', 'src/web/test/suite/index.ts', 'tsconfig.json', '.npmrc']);

runResult.assertJsonFileContent('testCom/package.json', expectedPackageJSON);

Expand Down Expand Up @@ -1662,7 +1662,7 @@ describe('test code generator', function () {
])
};
try {
assertFiles(runResult, 'json-renderer-ext', ['webpack.config.js', '.gitignore', '.eslintrc.json']);
assertFiles(runResult, 'json-renderer-ext', ['webpack.config.js', '.gitignore', '.eslintrc.json', '.npmrc']);

runResult.assertJsonFileContent('json-renderer-ext/package.json', expectedPackageJSON);

Expand Down