浏览代码

Adopt the new `editor/contrib` layering rules in the esm metadata generation

Alex Dima 3 年之前
父节点
当前提交
9fac3918b2
共有 5 个文件被更改,包括 18 次插入5 次删除
  1. 1 1
      .github/workflows/ci.yml
  2. 1 1
      .github/workflows/publish.yml
  3. 1 1
      CONTRIBUTING.md
  4. 14 1
      build/releaseMetadata.js
  5. 1 1
      webpack-plugin/package.json

+ 1 - 1
.github/workflows/ci.yml

@@ -48,7 +48,7 @@ jobs:
         run: npm run compile --prefix webpack-plugin
 
       - name: Package using webpack plugin
-        run: npm run smoketest --prefix webpack-plugin
+        run: npm run package-for-smoketest --prefix webpack-plugin
 
       - name: Run smoke test
         run: npm run smoketest

+ 1 - 1
.github/workflows/publish.yml

@@ -197,7 +197,7 @@ jobs:
       - name: (monaco-editor) Package using webpack plugin
         if: ${{ steps.state.outputs.skip_monaco_editor == 'false' }}
         working-directory: './monaco-editor'
-        run: npm run smoketest --prefix webpack-plugin
+        run: npm run package-for-smoketest --prefix webpack-plugin
 
       - name: (monaco-editor) Run smoke test
         if: ${{ steps.state.outputs.skip_monaco_editor == 'false' }}

+ 1 - 1
CONTRIBUTING.md

@@ -73,7 +73,7 @@ Open [http://localhost:8080/monaco-editor/test/manual/?editor=src](http://localh
 /src/monaco-editor> npm run compile --prefix webpack-plugin
 
 # package using the webpack plugin
-/src/monaco-editor> npm run smoketest --prefix webpack-plugin
+/src/monaco-editor> npm run package-for-smoketest --prefix webpack-plugin
 
 # run the smoketest
 /src/monaco-editor> npm run smoketest-debug

+ 14 - 1
build/releaseMetadata.js

@@ -245,8 +245,21 @@ function getFeatures() {
 
 	/** @type {{label:string;entry:any;}[]} */
 	let result = features.map((feature) => {
+		/** @type {string} */ let label;
+		if (customFeatureLabels[feature]) {
+			label = customFeatureLabels[feature];
+		} else {
+			const m1 = feature.match(/^vs\/editor\/contrib\/([^\/]+)/);
+			if (m1) {
+				// for editor/contrib features, use the first segment
+				label = m1[1];
+			} else {
+				// for everything else, use the last segment folder
+				label = path.basename(path.dirname(feature));
+			}
+		}
 		return {
-			label: customFeatureLabels[feature] || path.basename(path.dirname(feature)),
+			label: label,
 			entry: feature
 		};
 	});

+ 1 - 1
webpack-plugin/package.json

@@ -5,7 +5,7 @@
 	"main": "out/index.js",
 	"typings": "./out/index.d.ts",
 	"scripts": {
-		"smoketest": "node ./node_modules/webpack/bin/webpack.js --config smoketest/webpack.config.js --progress",
+		"package-for-smoketest": "node ./node_modules/webpack/bin/webpack.js --config smoketest/webpack.config.js --progress",
 		"smoketest-cross-origin": "node ./node_modules/webpack/bin/webpack.js --config smoketest/webpack-cross-origin.config.js --progress",
 		"watch": "tsc -w -p tsconfig.json",
 		"compile": "tsc -p tsconfig.json",