Parcourir la source

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

Alex Dima il y a 3 ans
Parent
commit
9fac3918b2

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

@@ -48,7 +48,7 @@ jobs:
         run: npm run compile --prefix webpack-plugin
         run: npm run compile --prefix webpack-plugin
 
 
       - name: Package using 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
       - name: Run smoke test
         run: npm run smoketest
         run: npm run smoketest

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

@@ -197,7 +197,7 @@ jobs:
       - name: (monaco-editor) Package using webpack plugin
       - name: (monaco-editor) Package using webpack plugin
         if: ${{ steps.state.outputs.skip_monaco_editor == 'false' }}
         if: ${{ steps.state.outputs.skip_monaco_editor == 'false' }}
         working-directory: './monaco-editor'
         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
       - name: (monaco-editor) Run smoke test
         if: ${{ steps.state.outputs.skip_monaco_editor == 'false' }}
         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
 /src/monaco-editor> npm run compile --prefix webpack-plugin
 
 
 # package using the 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
 # run the smoketest
 /src/monaco-editor> npm run smoketest-debug
 /src/monaco-editor> npm run smoketest-debug

+ 14 - 1
build/releaseMetadata.js

@@ -245,8 +245,21 @@ function getFeatures() {
 
 
 	/** @type {{label:string;entry:any;}[]} */
 	/** @type {{label:string;entry:any;}[]} */
 	let result = features.map((feature) => {
 	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 {
 		return {
-			label: customFeatureLabels[feature] || path.basename(path.dirname(feature)),
+			label: label,
 			entry: feature
 			entry: feature
 		};
 		};
 	});
 	});

+ 1 - 1
webpack-plugin/package.json

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