From b22a66dc459ede240f4e4ab20b39a267c11868bc Mon Sep 17 00:00:00 2001 From: Jette Petzold Date: Mon, 6 Jan 2025 16:36:05 +0100 Subject: [PATCH 1/4] fixing yarn package --- extension/build-util/prepare-extension-config.js | 8 ++++++++ extension/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 extension/build-util/prepare-extension-config.js diff --git a/extension/build-util/prepare-extension-config.js b/extension/build-util/prepare-extension-config.js new file mode 100644 index 0000000..cbdecc5 --- /dev/null +++ b/extension/build-util/prepare-extension-config.js @@ -0,0 +1,8 @@ +var fs = require('fs'); +console.log("HI"); + +var data = fs.readFileSync('filelist.txt', 'utf-8'); +var newValue = data.replace(/^\./gim, 'myString'); +fs.writeFileSync('filelistSync.txt', newValue, 'utf-8'); + +console.log('Bad magic'); \ No newline at end of file diff --git a/extension/package.json b/extension/package.json index 0f61fe0..33177de 100644 --- a/extension/package.json +++ b/extension/package.json @@ -586,7 +586,7 @@ "lint": "eslint .", "build": "yarn run langium:generate && tsc -b src src-diagram-snippets src-language-server src-webview src-context-table && node esbuild.mjs", "watch": "webpack --watch", - "package": "vsce package --yarn -o pasta.vsix", + "package": "node build-util/prepare-extension-config.js && vsce package --yarn -o pasta.vsix", "predistribute": "yarn run package", "distribute": "yarn run distribute:vsce && yarn run distribute:ovsx", "distribute:vsce": "vsce publish --yarn --packagePath pasta.vsix", From 2a89ba227dc1ecb04ec5d55de088e28d9a654048 Mon Sep 17 00:00:00 2001 From: Jette Petzold Date: Mon, 6 Jan 2025 16:40:35 +0100 Subject: [PATCH 2/4] fixing names for renaming --- extension/build-util/prepare-extension-config.js | 2 +- extension/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extension/build-util/prepare-extension-config.js b/extension/build-util/prepare-extension-config.js index cbdecc5..c2d9bcf 100644 --- a/extension/build-util/prepare-extension-config.js +++ b/extension/build-util/prepare-extension-config.js @@ -2,7 +2,7 @@ var fs = require('fs'); console.log("HI"); var data = fs.readFileSync('filelist.txt', 'utf-8'); -var newValue = data.replace(/^\./gim, 'myString'); +var newValue = data.replace('"main": "./pack/src/extension.cjs"', '"main": "./pack/src/extension.js"'); fs.writeFileSync('filelistSync.txt', newValue, 'utf-8'); console.log('Bad magic'); \ No newline at end of file diff --git a/extension/package.json b/extension/package.json index 33177de..cc0d95e 100644 --- a/extension/package.json +++ b/extension/package.json @@ -544,7 +544,7 @@ "src-webview", "pack" ], - "main": "./pack/src/extension.js", + "main": "./pack/src/extension.cjs", "dependencies": { "langium": "^3.0.0", "langium-sprotty": "^3.0.0", From f4a7d1ea1bb362bd3dd0e263d8fc04c4669fe53d Mon Sep 17 00:00:00 2001 From: Jette Petzold Date: Mon, 6 Jan 2025 16:43:29 +0100 Subject: [PATCH 3/4] replaced file name --- extension/build-util/prepare-extension-config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extension/build-util/prepare-extension-config.js b/extension/build-util/prepare-extension-config.js index c2d9bcf..1570e0e 100644 --- a/extension/build-util/prepare-extension-config.js +++ b/extension/build-util/prepare-extension-config.js @@ -1,8 +1,8 @@ -var fs = require('fs'); +import * as fs from 'node:fs'; console.log("HI"); -var data = fs.readFileSync('filelist.txt', 'utf-8'); +var data = fs.readFileSync('package.json', 'utf-8'); var newValue = data.replace('"main": "./pack/src/extension.cjs"', '"main": "./pack/src/extension.js"'); -fs.writeFileSync('filelistSync.txt', newValue, 'utf-8'); +fs.writeFileSync('package.json', newValue, 'utf-8'); console.log('Bad magic'); \ No newline at end of file From d484a3884cf661836fec62e3db4378ba6aa310d4 Mon Sep 17 00:00:00 2001 From: Jette Petzold Date: Mon, 6 Jan 2025 16:43:48 +0100 Subject: [PATCH 4/4] deleted test output --- extension/build-util/prepare-extension-config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/extension/build-util/prepare-extension-config.js b/extension/build-util/prepare-extension-config.js index 1570e0e..cd1d755 100644 --- a/extension/build-util/prepare-extension-config.js +++ b/extension/build-util/prepare-extension-config.js @@ -1,5 +1,4 @@ import * as fs from 'node:fs'; -console.log("HI"); var data = fs.readFileSync('package.json', 'utf-8'); var newValue = data.replace('"main": "./pack/src/extension.cjs"', '"main": "./pack/src/extension.js"');