@virmator/compile 13.16.2 → 14.0.0

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/dist/compile.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import { RuntimeEnv } from '@augment-vir/common';
2
- import { NpmDepType, PackageType } from '@virmator/core';
1
+ import { NpmDepType } from '@virmator/core';
3
2
  /** A virmator plugin for compiling TypeScript. */
4
3
  export declare const virmatorCompilePlugin: Readonly<Readonly<{
5
4
  name: string;
@@ -18,35 +17,60 @@ export declare const virmatorCompilePlugin: Readonly<Readonly<{
18
17
  readonly tsconfigPackage: {
19
18
  readonly copyFromPath: string;
20
19
  readonly copyToPath: "tsconfig.json";
21
- readonly env: [RuntimeEnv.Node, RuntimeEnv.Web];
22
- readonly packageType: [PackageType.TopPackage];
20
+ readonly env: {
21
+ readonly node: true;
22
+ readonly web: true;
23
+ };
24
+ readonly packageType: {
25
+ readonly "top-level-package": true;
26
+ };
23
27
  readonly required: true;
24
28
  };
25
29
  readonly tsconfigMonoPackage: {
26
30
  readonly copyFromPath: string;
27
31
  readonly copyToPath: "tsconfig.json";
28
- readonly env: [RuntimeEnv.Node, RuntimeEnv.Web];
29
- readonly packageType: [PackageType.MonoPackage];
32
+ readonly env: {
33
+ readonly node: true;
34
+ readonly web: true;
35
+ };
36
+ readonly packageType: {
37
+ readonly "mono-package": true;
38
+ };
30
39
  readonly required: true;
31
40
  };
32
41
  readonly tsconfigMono: {
33
42
  readonly copyFromPath: string;
34
43
  readonly copyToPath: string;
35
- readonly env: [RuntimeEnv.Node, RuntimeEnv.Web];
36
- readonly packageType: [PackageType.MonoRoot];
44
+ readonly env: {
45
+ readonly node: true;
46
+ readonly web: true;
47
+ };
48
+ readonly packageType: {
49
+ readonly "mono-root": true;
50
+ };
37
51
  readonly required: true;
38
52
  };
39
53
  };
40
54
  readonly npmDeps: {
41
55
  readonly typescript: {
42
56
  readonly type: NpmDepType.Dev;
43
- readonly env: readonly [RuntimeEnv.Node, RuntimeEnv.Web];
44
- readonly packageType: readonly [PackageType.TopPackage];
57
+ readonly env: {
58
+ readonly node: true;
59
+ readonly web: true;
60
+ };
61
+ readonly packageType: {
62
+ readonly "top-level-package": true;
63
+ };
45
64
  };
46
65
  readonly 'mono-vir': {
47
66
  readonly type: NpmDepType.Dev;
48
- readonly env: readonly [RuntimeEnv.Node, RuntimeEnv.Web];
49
- readonly packageType: readonly [PackageType.MonoRoot];
67
+ readonly env: {
68
+ readonly node: true;
69
+ readonly web: true;
70
+ };
71
+ readonly packageType: {
72
+ readonly "mono-root": true;
73
+ };
50
74
  };
51
75
  };
52
76
  };
@@ -68,35 +92,60 @@ export declare const virmatorCompilePlugin: Readonly<Readonly<{
68
92
  readonly tsconfigPackage: {
69
93
  readonly copyFromPath: string;
70
94
  readonly copyToPath: "tsconfig.json";
71
- readonly env: [RuntimeEnv.Node, RuntimeEnv.Web];
72
- readonly packageType: [PackageType.TopPackage];
95
+ readonly env: {
96
+ readonly node: true;
97
+ readonly web: true;
98
+ };
99
+ readonly packageType: {
100
+ readonly "top-level-package": true;
101
+ };
73
102
  readonly required: true;
74
103
  };
75
104
  readonly tsconfigMonoPackage: {
76
105
  readonly copyFromPath: string;
77
106
  readonly copyToPath: "tsconfig.json";
78
- readonly env: [RuntimeEnv.Node, RuntimeEnv.Web];
79
- readonly packageType: [PackageType.MonoPackage];
107
+ readonly env: {
108
+ readonly node: true;
109
+ readonly web: true;
110
+ };
111
+ readonly packageType: {
112
+ readonly "mono-package": true;
113
+ };
80
114
  readonly required: true;
81
115
  };
82
116
  readonly tsconfigMono: {
83
117
  readonly copyFromPath: string;
84
118
  readonly copyToPath: string;
85
- readonly env: [RuntimeEnv.Node, RuntimeEnv.Web];
86
- readonly packageType: [PackageType.MonoRoot];
119
+ readonly env: {
120
+ readonly node: true;
121
+ readonly web: true;
122
+ };
123
+ readonly packageType: {
124
+ readonly "mono-root": true;
125
+ };
87
126
  readonly required: true;
88
127
  };
89
128
  };
90
129
  readonly npmDeps: {
91
130
  readonly typescript: {
92
131
  readonly type: NpmDepType.Dev;
93
- readonly env: readonly [RuntimeEnv.Node, RuntimeEnv.Web];
94
- readonly packageType: readonly [PackageType.TopPackage];
132
+ readonly env: {
133
+ readonly node: true;
134
+ readonly web: true;
135
+ };
136
+ readonly packageType: {
137
+ readonly "top-level-package": true;
138
+ };
95
139
  };
96
140
  readonly 'mono-vir': {
97
141
  readonly type: NpmDepType.Dev;
98
- readonly env: readonly [RuntimeEnv.Node, RuntimeEnv.Web];
99
- readonly packageType: readonly [PackageType.MonoRoot];
142
+ readonly env: {
143
+ readonly node: true;
144
+ readonly web: true;
145
+ };
146
+ readonly packageType: {
147
+ readonly "mono-root": true;
148
+ };
100
149
  };
101
150
  };
102
151
  };
package/dist/compile.js CHANGED
@@ -3,6 +3,7 @@ import { logColors, RuntimeEnv } from '@augment-vir/common';
3
3
  import { copyConfigFile, defineVirmatorPlugin, NpmDepType, PackageType, parseTsConfig, } from '@virmator/core';
4
4
  import { rm } from 'node:fs/promises';
5
5
  import { basename, join } from 'node:path';
6
+ import { createCommandLogPrefix } from 'runstorm';
6
7
  /** A virmator plugin for compiling TypeScript. */
7
8
  export const virmatorCompilePlugin = defineVirmatorPlugin(import.meta.dirname, {
8
9
  name: 'TS Compile',
@@ -33,60 +34,60 @@ export const virmatorCompilePlugin = defineVirmatorPlugin(import.meta.dirname, {
33
34
  tsconfigPackage: {
34
35
  copyFromPath: join('configs', 'tsconfig.package.json'),
35
36
  copyToPath: 'tsconfig.json',
36
- env: [
37
- RuntimeEnv.Node,
38
- RuntimeEnv.Web,
39
- ],
40
- packageType: [
41
- PackageType.TopPackage,
42
- ],
37
+ env: {
38
+ [RuntimeEnv.Node]: true,
39
+ [RuntimeEnv.Web]: true,
40
+ },
41
+ packageType: {
42
+ [PackageType.TopPackage]: true,
43
+ },
43
44
  required: true,
44
45
  },
45
46
  tsconfigMonoPackage: {
46
47
  copyFromPath: join('configs', 'tsconfig.mono-package.json'),
47
48
  copyToPath: 'tsconfig.json',
48
- env: [
49
- RuntimeEnv.Node,
50
- RuntimeEnv.Web,
51
- ],
52
- packageType: [
53
- PackageType.MonoPackage,
54
- ],
49
+ env: {
50
+ [RuntimeEnv.Node]: true,
51
+ [RuntimeEnv.Web]: true,
52
+ },
53
+ packageType: {
54
+ [PackageType.MonoPackage]: true,
55
+ },
55
56
  required: true,
56
57
  },
57
58
  tsconfigMono: {
58
59
  copyFromPath: join('configs', 'tsconfig.mono.json'),
59
60
  copyToPath: join('configs', 'tsconfig.base.json'),
60
- env: [
61
- RuntimeEnv.Node,
62
- RuntimeEnv.Web,
63
- ],
64
- packageType: [
65
- PackageType.MonoRoot,
66
- ],
61
+ env: {
62
+ [RuntimeEnv.Node]: true,
63
+ [RuntimeEnv.Web]: true,
64
+ },
65
+ packageType: {
66
+ [PackageType.MonoRoot]: true,
67
+ },
67
68
  required: true,
68
69
  },
69
70
  },
70
71
  npmDeps: {
71
72
  typescript: {
72
73
  type: NpmDepType.Dev,
73
- env: [
74
- RuntimeEnv.Node,
75
- RuntimeEnv.Web,
76
- ],
77
- packageType: [
78
- PackageType.TopPackage,
79
- ],
74
+ env: {
75
+ [RuntimeEnv.Node]: true,
76
+ [RuntimeEnv.Web]: true,
77
+ },
78
+ packageType: {
79
+ [PackageType.TopPackage]: true,
80
+ },
80
81
  },
81
82
  'mono-vir': {
82
83
  type: NpmDepType.Dev,
83
- env: [
84
- RuntimeEnv.Node,
85
- RuntimeEnv.Web,
86
- ],
87
- packageType: [
88
- PackageType.MonoRoot,
89
- ],
84
+ env: {
85
+ [RuntimeEnv.Node]: true,
86
+ [RuntimeEnv.Web]: true,
87
+ },
88
+ packageType: {
89
+ [PackageType.MonoRoot]: true,
90
+ },
90
91
  },
91
92
  },
92
93
  },
@@ -100,25 +101,22 @@ export const virmatorCompilePlugin = defineVirmatorPlugin(import.meta.dirname, {
100
101
  fullCopyToPath: join(packageCwd, 'tsconfig.json'),
101
102
  }, log, false, undefined, packageName);
102
103
  return await createCompileCommandString({ ...params, cwd: packageCwd }, packageName, color);
103
- },
104
- /**
105
- * Compiling each package needs to happen in series so that dependent packages are
106
- * compiled first.
107
- */
108
- 1);
104
+ }, 'tree');
109
105
  }
110
106
  else {
111
107
  await runShellCommand(await createCompileCommandString(params, undefined));
112
108
  }
113
109
  });
114
- async function createCompileCommandString({ cwd, cliInputs, log }, packageName, prefixColor) {
110
+ async function createCompileCommandString({ cwd, cliInputs, log }, packageName, color) {
115
111
  const tsconfig = parseTsConfig(cwd);
116
112
  const outDir = tsconfig?.options.outDir;
117
- const logPrefix = packageName && prefixColor
113
+ const logPrefix = packageName && color
118
114
  ? [
119
- prefixColor(`[${packageName}]`),
115
+ createCommandLogPrefix({
116
+ name: packageName,
117
+ color,
118
+ }),
120
119
  logColors.faint,
121
- ' ',
122
120
  ].join('')
123
121
  : '';
124
122
  if (outDir) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@virmator/compile",
3
- "version": "13.16.2",
3
+ "version": "14.0.0",
4
4
  "description": "Default TS compile plugin for virmator.",
5
5
  "keywords": [
6
6
  "virmator",
@@ -32,21 +32,20 @@
32
32
  "test:update": "npm test update"
33
33
  },
34
34
  "dependencies": {
35
- "@augment-vir/assert": "^31.31.0",
36
- "@augment-vir/common": "^31.31.0",
37
- "@augment-vir/node": "^31.31.0",
38
- "@virmator/core": "^13.16.2"
35
+ "@augment-vir/assert": "^31.32.3",
36
+ "@augment-vir/common": "^31.32.3",
37
+ "@augment-vir/node": "^31.32.3",
38
+ "@virmator/core": "^14.0.0",
39
+ "runstorm": "^0.6.1"
39
40
  },
40
41
  "devDependencies": {
41
- "@augment-vir/test": "^31.31.0",
42
- "@types/node": "^24.2.0",
43
- "@virmator/plugin-testing": "^13.16.2",
42
+ "@augment-vir/test": "^31.32.3",
43
+ "@types/node": "^24.3.0",
44
+ "@virmator/plugin-testing": "^14.0.0",
44
45
  "c8": "^10.1.3",
45
- "chalk": "^5.5.0",
46
- "concurrently": "^9.2.0",
47
46
  "istanbul-smart-text-reporter": "^1.1.5",
48
- "mono-vir": "^2.0.6",
49
- "tsx": "^4.20.3",
47
+ "mono-vir": "^2.2.1",
48
+ "tsx": "^4.20.4",
50
49
  "typescript": "^5.9.2"
51
50
  },
52
51
  "peerDependencies": {