Skip to content

Commit b277da0

Browse files
committed
partly fix vscode extension build.
jzz imports @ types/webmidi which causes unresolve references, so unless you wipe out the entire contents from the node module, it won't build. And once it built, we face run-time failure due to inconsistent API at `MmlInputSource` which I guess is new IR changes compared to legacy JS.
1 parent 7385877 commit b277da0

File tree

3 files changed

+141
-58
lines changed

3 files changed

+141
-58
lines changed

vscode-extension/package-lock.json

Lines changed: 131 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vscode-extension/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "mugene MML compiler support",
44
"author": "Atsushi Eno",
55
"license": "MIT",
6-
"version": "0.4.0",
6+
"version": "0.7.1",
77
"publisher": "atsushieno",
88
"repository": {
99
"type": "git",
@@ -16,8 +16,7 @@
1616
"Other"
1717
],
1818
"activationEvents": [
19-
"onLanguage:mugene",
20-
"onCommand:mugene.compile"
19+
"onLanguage:mugene"
2120
],
2221
"browser": "./out/src/extension",
2322
"main": "./out/src/extension",
@@ -87,7 +86,7 @@
8786
"typescript": "^4.3.5"
8887
},
8988
"dependencies": {
90-
"@dev.atsushieno/mugene": "^0.4.0",
89+
"@dev.atsushieno/mugene": "^0.7.1",
9190
"@js-joda/core": "^3.2.0",
9291
"rx-lite": "^4.0.8",
9392
"vscode-languageclient": "^7.0.0"

vscode-extension/src/extension.ts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,11 @@ import { IllegalStateException } from '@js-joda/core';
1212
//import { LanguageClient, LanguageClientOptions, ServerOptions } from 'vscode-languageclient';
1313

1414

15-
// Load module dynamically, either IR or Legacy, and either dev or package
16-
var mugeneDirPathLegacy = "../../../build/js/packages/mugene-mugene-js-legacy/kotlin";
17-
var mugeneJSPathLegacy = mugeneDirPathLegacy + "/mugene-mugene-js-legacy.js";
18-
var resPathLegacy = "../../../mugene/build/processedResources/jsLegacy/main";
19-
var mugeneDirPathIRBoth = "../../../mugene/build/publications/npm/js";
20-
var mugeneDirPathIROnly = "../../../build/js/packages/mugene-mugene/kotlin";
21-
var mugeneJSPathIRBoth = mugeneDirPathIRBoth + "/mugene-mugene.js";
22-
var mugeneJSPathIROnly = mugeneDirPathIROnly + "/mugene-mugene.js";
15+
// Load module dynamically, either dev or package
16+
var mugeneDirPathIRBoth = "../../../mugene/build/dist/js/productionLibrary";
17+
var mugeneDirPathIROnly = "../../../build/js/packages/mugene-project-mugene/kotlin";
18+
var mugeneJSPathIRBoth = mugeneDirPathIRBoth + "/mugene-project-mugene.js";
19+
var mugeneJSPathIROnly = mugeneDirPathIROnly + "/mugene-project-mugene.js";
2320
var resPathIRBoth = mugeneDirPathIRBoth;
2421
var resPathIROnly = mugeneDirPathIROnly;
2522
if (fs.existsSync(module.path + "/" + mugeneJSPathIRBoth)) { // BOTH-IR dev
@@ -28,11 +25,8 @@ var resPathIROnly = mugeneDirPathIROnly;
2825
} else if (fs.existsSync(module.path + "/" + mugeneJSPathIROnly)) { // IR-only dev
2926
var mugene = require(mugeneJSPathIROnly);
3027
mugene.dev.atsushieno.mugene.setNodeModuleResourceStreamResolverBasePath(module.path + "/" + resPathIROnly);
31-
} else if (fs.existsSync(module.path + "/" + mugeneJSPathLegacy)) { // Legacy dev
32-
var mugene = require(mugeneJSPathLegacy);
33-
mugene.dev.atsushieno.mugene.setNodeModuleResourceStreamResolverBasePath(module.path + "/" + resPathLegacy);
34-
} else if (fs.existsSync(module.path + "/../../node_modules/@dev.atsushieno/mugene/mugene-mugene.js")) {
35-
var mugene = require("@dev.atsushieno/mugene/mugene-mugene.js");
28+
} else if (fs.existsSync(module.path + "/../../node_modules/@dev.atsushieno/mugene/mugene-project-mugene.js")) {
29+
var mugene = require("@dev.atsushieno/mugene/mugene-project-mugene.js");
3630
mugene.dev.atsushieno.mugene.setNodeModuleResourceStreamResolverBasePath(__dirname + "/../../node_modules/@dev.atsushieno/mugene");
3731
} else
3832
throw new IllegalStateException("mugene JS implementation not found.")

0 commit comments

Comments
 (0)