zenstack 0.1.6 → 0.1.8
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/package.json +2 -2
- package/src/generator/index.ts +16 -3
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "zenstack",
|
|
3
3
|
"displayName": "ZenStack CLI and Language Tools",
|
|
4
4
|
"description": "ZenStack CLI and Language Tools",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.8",
|
|
6
6
|
"engines": {
|
|
7
7
|
"vscode": "^1.56.0"
|
|
8
8
|
},
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"main": "./out/extension.js",
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@zenstackhq/runtime": "^1.0
|
|
51
|
+
"@zenstackhq/runtime": "^0.1.0",
|
|
52
52
|
"change-case": "^4.1.2",
|
|
53
53
|
"chevrotain": "^9.1.0",
|
|
54
54
|
"colors": "^1.4.0",
|
package/src/generator/index.ts
CHANGED
|
@@ -10,8 +10,8 @@ import { execSync } from 'child_process';
|
|
|
10
10
|
|
|
11
11
|
export class ZenStackGenerator {
|
|
12
12
|
async generate(context: Context) {
|
|
13
|
-
if (
|
|
14
|
-
fs.
|
|
13
|
+
if (fs.existsSync(context.outDir)) {
|
|
14
|
+
fs.rmSync(context.outDir, { force: true, recursive: true });
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
console.log(colors.bold('⌛️ Running ZenStack generators'));
|
|
@@ -47,7 +47,20 @@ export class ZenStackGenerator {
|
|
|
47
47
|
JSON.stringify(tsConfig, undefined, 4)
|
|
48
48
|
);
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
try {
|
|
51
|
+
execSync(
|
|
52
|
+
`npx tsc -p "${path.join(context.outDir, 'tsconfig.json')}"`,
|
|
53
|
+
{ encoding: 'utf-8' }
|
|
54
|
+
);
|
|
55
|
+
} catch {
|
|
56
|
+
console.error(
|
|
57
|
+
colors.red(
|
|
58
|
+
'Something went wrong, generated runtime code failed to compile...'
|
|
59
|
+
)
|
|
60
|
+
);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
51
64
|
console.log(colors.blue(' ✔️ Typescript source files transpiled'));
|
|
52
65
|
|
|
53
66
|
console.log(
|