generator-code 1.7.9 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generators/app/dependencyVersions/package.json +16 -14
- package/generators/app/env.js +8 -7
- package/generators/app/generate-colortheme.js +12 -13
- package/generators/app/generate-command-js.js +6 -5
- package/generators/app/generate-command-ts.js +9 -6
- package/generators/app/generate-command-web.js +8 -6
- package/generators/app/generate-extensionpack.js +6 -6
- package/generators/app/generate-keymap.js +5 -5
- package/generators/app/generate-language.js +30 -27
- package/generators/app/generate-localization.js +10 -8
- package/generators/app/generate-notebook-renderer.js +7 -6
- package/generators/app/generate-snippets.js +10 -10
- package/generators/app/index.js +24 -20
- package/generators/app/prompts.js +16 -14
- package/generators/app/templates/ext-command-js/.vscode-test.mjs +5 -0
- package/generators/app/templates/ext-command-js/.vscodeignore +1 -0
- package/generators/app/templates/ext-command-js/jsconfig.json +3 -3
- package/generators/app/templates/ext-command-js/package.json +2 -3
- package/generators/app/templates/ext-command-js/vsc-extension-quickstart.md +5 -5
- package/generators/app/templates/ext-command-js/vscode/extensions.json +3 -2
- package/generators/app/templates/ext-command-js/vscode/launch.json +0 -9
- package/generators/app/templates/ext-command-ts/.eslintrc.json +8 -2
- package/generators/app/templates/ext-command-ts/.vscode-test.mjs +5 -0
- package/generators/app/templates/ext-command-ts/.vscodeignore +1 -0
- package/generators/app/templates/ext-command-ts/package.json +2 -3
- package/generators/app/templates/ext-command-ts/tsconfig.json +3 -3
- package/generators/app/templates/ext-command-ts/vsc-extension-quickstart.md +5 -4
- package/generators/app/templates/ext-command-ts/vscode/extensions.json +2 -1
- package/generators/app/templates/ext-command-ts/vscode/launch.json +0 -13
- package/generators/app/templates/ext-command-ts/vscode-webpack/.vscodeignore +1 -0
- package/generators/app/templates/ext-command-ts/vscode-webpack/package.json +2 -3
- package/generators/app/templates/ext-command-ts/vscode-webpack/tsconfig.json +3 -3
- package/generators/app/templates/ext-command-ts/vscode-webpack/vsc-extension-quickstart.md +6 -5
- package/generators/app/templates/ext-command-ts/vscode-webpack/vscode/extensions.json +1 -1
- package/generators/app/templates/ext-command-ts/vscode-webpack/vscode/launch.json +0 -14
- package/generators/app/templates/ext-command-web/.vscodeignore +1 -0
- package/generators/app/templates/ext-command-web/package.json +1 -0
- package/generators/app/templates/ext-command-web/tsconfig.json +1 -1
- package/generators/app/templates/ext-command-web/vsc-extension-quickstart.md +1 -1
- package/generators/app/templates/ext-notebook-renderer/.vscode-test.mjs +5 -0
- package/generators/app/templates/ext-notebook-renderer/.vscodeignore +1 -0
- package/generators/app/templates/ext-notebook-renderer/package.json +2 -1
- package/generators/app/templates/ext-notebook-renderer/src/tsconfig-base.json +3 -4
- package/generators/app/templates/ext-notebook-renderer/vscode/extensions.json +1 -1
- package/generators/app/templates/ext-notebook-renderer/vscode/launch.json +0 -13
- package/generators/app/validator.js +31 -4
- package/package.json +9 -10
- package/generators/app/templates/ext-command-js/test/runTest.js +0 -23
- package/generators/app/templates/ext-command-js/test/suite/index.js +0 -45
- package/generators/app/templates/ext-command-ts/src/test/runTest.ts +0 -23
- package/generators/app/templates/ext-command-ts/src/test/suite/index.ts +0 -40
- package/generators/app/templates/ext-notebook-renderer/src/test/runTest.ts +0 -23
- package/generators/app/templates/ext-notebook-renderer/src/test/suite/index.ts +0 -40
- /package/generators/app/templates/ext-command-js/test/{suite/extension.test.js → extension.test.js} +0 -0
- /package/generators/app/templates/ext-command-ts/src/test/{suite/extension.test.ts → extension.test.ts} +0 -0
- /package/generators/app/templates/ext-notebook-renderer/src/test/{suite/extension.test.ts → extension.test.ts} +0 -0
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
*--------------------------------------------------------*/
|
|
4
4
|
var nameRegex = /^[a-z0-9][a-z0-9\-]*$/i;
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @param {string} publisher
|
|
8
|
+
*/
|
|
9
|
+
export function validatePublisher(publisher) {
|
|
7
10
|
if (!publisher) {
|
|
8
11
|
return "Missing publisher name";
|
|
9
12
|
}
|
|
@@ -15,7 +18,10 @@ module.exports.validatePublisher = function(publisher) {
|
|
|
15
18
|
return true;
|
|
16
19
|
}
|
|
17
20
|
|
|
18
|
-
|
|
21
|
+
/**
|
|
22
|
+
* @param {string} id
|
|
23
|
+
*/
|
|
24
|
+
export function validateExtensionId(id) {
|
|
19
25
|
if (!id) {
|
|
20
26
|
return "Missing extension identifier";
|
|
21
27
|
}
|
|
@@ -27,6 +33,27 @@ module.exports.validateExtensionId = function(id) {
|
|
|
27
33
|
return true;
|
|
28
34
|
}
|
|
29
35
|
|
|
30
|
-
|
|
36
|
+
/**
|
|
37
|
+
* @param {string | any[]} name
|
|
38
|
+
*/
|
|
39
|
+
export function validateNonEmpty(name) {
|
|
31
40
|
return name && name.length > 0;
|
|
32
|
-
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const illegalRe = /[\/\?<>\\:\*\|"]/g;
|
|
44
|
+
const controlRe = /[\x00-\x1f\x80-\x9f]/g;
|
|
45
|
+
const reservedRe = /^\.+$/;
|
|
46
|
+
const windowsReservedRe = /^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i;
|
|
47
|
+
const windowsTrailingRe = /[\. ]+$/;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @param {string} input
|
|
51
|
+
*/
|
|
52
|
+
export function sanitizeFilename(input) {
|
|
53
|
+
return input
|
|
54
|
+
.replace(illegalRe, '')
|
|
55
|
+
.replace(controlRe, '')
|
|
56
|
+
.replace(reservedRe, '')
|
|
57
|
+
.replace(windowsReservedRe, '')
|
|
58
|
+
.replace(windowsTrailingRe, '');
|
|
59
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generator-code",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "Yeoman generator for Visual Studio Code extensions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yeoman-generator",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"vs code",
|
|
11
11
|
"extensions"
|
|
12
12
|
],
|
|
13
|
+
"type": "module",
|
|
13
14
|
"repository": {
|
|
14
15
|
"type": "git",
|
|
15
16
|
"url": "https://github.com/Microsoft/vscode-generator-code.git"
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
"url": "https://github.com/Microsoft"
|
|
26
27
|
},
|
|
27
28
|
"engines": {
|
|
28
|
-
"node": ">=
|
|
29
|
+
"node": ">=16.x"
|
|
29
30
|
},
|
|
30
31
|
"scripts": {
|
|
31
32
|
"test": "mocha",
|
|
@@ -34,20 +35,18 @@
|
|
|
34
35
|
"postversion": "git push && git push --tags"
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {
|
|
37
|
-
"chalk": "^
|
|
38
|
+
"chalk": "^5.3.0",
|
|
38
39
|
"fast-plist": "^0.1.3",
|
|
39
40
|
"request-light": "^0.7.0",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"yosay": "^2.0.2"
|
|
41
|
+
"which": "^4.0.0",
|
|
42
|
+
"yeoman-generator": "^6.0.1",
|
|
43
|
+
"yosay": "^3.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@types/mocha": "^10.0.
|
|
46
|
+
"@types/mocha": "^10.0.6",
|
|
47
47
|
"@types/node": "^16.x",
|
|
48
|
-
"@types/yeoman-generator": "^5.2.12",
|
|
49
48
|
"mocha": "^10.2.0",
|
|
50
49
|
"yeoman-environment": "^3.19.3",
|
|
51
|
-
"yeoman-test": "^
|
|
50
|
+
"yeoman-test": "^8.2.0"
|
|
52
51
|
}
|
|
53
52
|
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
|
|
3
|
-
const { runTests } = require('@vscode/test-electron');
|
|
4
|
-
|
|
5
|
-
async function main() {
|
|
6
|
-
try {
|
|
7
|
-
// The folder containing the Extension Manifest package.json
|
|
8
|
-
// Passed to `--extensionDevelopmentPath`
|
|
9
|
-
const extensionDevelopmentPath = path.resolve(__dirname, '../');
|
|
10
|
-
|
|
11
|
-
// The path to the extension test script
|
|
12
|
-
// Passed to --extensionTestsPath
|
|
13
|
-
const extensionTestsPath = path.resolve(__dirname, './suite/index');
|
|
14
|
-
|
|
15
|
-
// Download VS Code, unzip it and run the integration test
|
|
16
|
-
await runTests({ extensionDevelopmentPath, extensionTestsPath });
|
|
17
|
-
} catch (err) {
|
|
18
|
-
console.error('Failed to run tests', err);
|
|
19
|
-
process.exit(1);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
main();
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const Mocha = require('mocha');
|
|
3
|
-
const glob = require('glob');
|
|
4
|
-
|
|
5
|
-
function run() {
|
|
6
|
-
// Create the mocha test
|
|
7
|
-
const mocha = new Mocha({
|
|
8
|
-
ui: 'tdd',
|
|
9
|
-
color: true
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
const testsRoot = path.resolve(__dirname, '..');
|
|
13
|
-
|
|
14
|
-
return new Promise((c, e) => {
|
|
15
|
-
const testFiles = new glob.Glob('**/**.test.js', { cwd: testsRoot });
|
|
16
|
-
const testFileStream = testFiles.stream();
|
|
17
|
-
|
|
18
|
-
testFileStream.on('data', (file) => {
|
|
19
|
-
// Add files to the test suite
|
|
20
|
-
mocha.addFile(path.resolve(testsRoot, file));
|
|
21
|
-
});
|
|
22
|
-
testFileStream.on('error', (err) => {
|
|
23
|
-
e(err);
|
|
24
|
-
});
|
|
25
|
-
testFileStream.on('end', () => {
|
|
26
|
-
try {
|
|
27
|
-
// Run the mocha test
|
|
28
|
-
mocha.run(failures => {
|
|
29
|
-
if (failures > 0) {
|
|
30
|
-
e(new Error(`${failures} tests failed.`));
|
|
31
|
-
} else {
|
|
32
|
-
c();
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
} catch (err) {
|
|
36
|
-
console.error(err);
|
|
37
|
-
e(err);
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
module.exports = {
|
|
44
|
-
run
|
|
45
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as path from 'path';
|
|
2
|
-
|
|
3
|
-
import { runTests } from '@vscode/test-electron';
|
|
4
|
-
|
|
5
|
-
async function main() {
|
|
6
|
-
try {
|
|
7
|
-
// The folder containing the Extension Manifest package.json
|
|
8
|
-
// Passed to `--extensionDevelopmentPath`
|
|
9
|
-
const extensionDevelopmentPath = path.resolve(__dirname, '../../');
|
|
10
|
-
|
|
11
|
-
// The path to test runner
|
|
12
|
-
// Passed to --extensionTestsPath
|
|
13
|
-
const extensionTestsPath = path.resolve(__dirname, './suite/index');
|
|
14
|
-
|
|
15
|
-
// Download VS Code, unzip it and run the integration test
|
|
16
|
-
await runTests({ extensionDevelopmentPath, extensionTestsPath });
|
|
17
|
-
} catch (err) {
|
|
18
|
-
console.error('Failed to run tests', err);
|
|
19
|
-
process.exit(1);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
main();
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as path from 'path';
|
|
2
|
-
import * as Mocha from 'mocha';
|
|
3
|
-
import * as glob from 'glob';
|
|
4
|
-
|
|
5
|
-
export function run(): Promise<void> {
|
|
6
|
-
// Create the mocha test
|
|
7
|
-
const mocha = new Mocha({
|
|
8
|
-
ui: 'tdd',
|
|
9
|
-
color: true
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
const testsRoot = path.resolve(__dirname, '..');
|
|
13
|
-
|
|
14
|
-
return new Promise((c, e) => {
|
|
15
|
-
const testFiles = new glob.Glob("**/**.test.js", { cwd: testsRoot });
|
|
16
|
-
const testFileStream = testFiles.stream();
|
|
17
|
-
|
|
18
|
-
testFileStream.on("data", (file) => {
|
|
19
|
-
mocha.addFile(path.resolve(testsRoot, file));
|
|
20
|
-
});
|
|
21
|
-
testFileStream.on("error", (err) => {
|
|
22
|
-
e(err);
|
|
23
|
-
});
|
|
24
|
-
testFileStream.on("end", () => {
|
|
25
|
-
try {
|
|
26
|
-
// Run the mocha test
|
|
27
|
-
mocha.run(failures => {
|
|
28
|
-
if (failures > 0) {
|
|
29
|
-
e(new Error(`${failures} tests failed.`));
|
|
30
|
-
} else {
|
|
31
|
-
c();
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
} catch (err) {
|
|
35
|
-
console.error(err);
|
|
36
|
-
e(err);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as path from 'path';
|
|
2
|
-
|
|
3
|
-
import { runTests } from '@vscode/test-electron';
|
|
4
|
-
|
|
5
|
-
async function main() {
|
|
6
|
-
try {
|
|
7
|
-
// The folder containing the Extension Manifest package.json
|
|
8
|
-
// Passed to `--extensionDevelopmentPath`
|
|
9
|
-
const extensionDevelopmentPath = path.resolve(__dirname, '../../');
|
|
10
|
-
|
|
11
|
-
// The path to test runner
|
|
12
|
-
// Passed to --extensionTestsPath
|
|
13
|
-
const extensionTestsPath = path.resolve(__dirname, './suite/index');
|
|
14
|
-
|
|
15
|
-
// Download VS Code, unzip it and run the integration test
|
|
16
|
-
await runTests({ extensionDevelopmentPath, extensionTestsPath });
|
|
17
|
-
} catch (err) {
|
|
18
|
-
console.error('Failed to run tests', err);
|
|
19
|
-
process.exit(1);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
main();
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as path from 'path';
|
|
2
|
-
import * as Mocha from 'mocha';
|
|
3
|
-
import * as glob from 'glob';
|
|
4
|
-
|
|
5
|
-
export function run(): Promise<void> {
|
|
6
|
-
// Create the mocha test
|
|
7
|
-
const mocha = new Mocha({
|
|
8
|
-
ui: 'tdd',
|
|
9
|
-
color: true
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
const testsRoot = path.resolve(__dirname, '..');
|
|
13
|
-
|
|
14
|
-
return new Promise((c, e) => {
|
|
15
|
-
const testFiles = new glob.Glob("**/**.test.js", { cwd: testsRoot });
|
|
16
|
-
const testFileStream = testFiles.stream();
|
|
17
|
-
|
|
18
|
-
testFileStream.on("data", (file) => {
|
|
19
|
-
mocha.addFile(path.resolve(testsRoot, file));
|
|
20
|
-
});
|
|
21
|
-
testFileStream.on("error", (err) => {
|
|
22
|
-
e(err);
|
|
23
|
-
});
|
|
24
|
-
testFileStream.on("end", () => {
|
|
25
|
-
try {
|
|
26
|
-
// Run the mocha test
|
|
27
|
-
mocha.run(failures => {
|
|
28
|
-
if (failures > 0) {
|
|
29
|
-
e(new Error(`${failures} tests failed.`));
|
|
30
|
-
} else {
|
|
31
|
-
c();
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
} catch (err) {
|
|
35
|
-
console.error(err);
|
|
36
|
-
e(err);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
}
|
/package/generators/app/templates/ext-command-js/test/{suite/extension.test.js → extension.test.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|