virmator 11.4.0 → 11.5.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.
@@ -2,6 +2,7 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>Page Name</title>
5
+ <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" />
5
6
  <script type="module" src="./ui/elements/vir-app.element.ts"></script>
6
7
  <link rel="stylesheet" type="text/css" href="/index.css" />
7
8
  </head>
@@ -14,6 +14,9 @@ export declare const frontendCommandDefinition: {
14
14
  npmDeps: readonly [{
15
15
  readonly name: "@augment-vir/node-js";
16
16
  readonly type: NpmDepTypeEnum.Dev;
17
+ }, {
18
+ readonly name: "esbuild";
19
+ readonly type: NpmDepTypeEnum.Dev;
17
20
  }, {
18
21
  readonly name: "typescript";
19
22
  readonly type: NpmDepTypeEnum.Dev;
@@ -41,6 +44,9 @@ export declare const frontendCommandDefinition: {
41
44
  npmDeps: readonly [{
42
45
  readonly name: "@augment-vir/node-js";
43
46
  readonly type: NpmDepTypeEnum.Dev;
47
+ }, {
48
+ readonly name: "esbuild";
49
+ readonly type: NpmDepTypeEnum.Dev;
44
50
  }, {
45
51
  readonly name: "typescript";
46
52
  readonly type: NpmDepTypeEnum.Dev;
@@ -68,6 +74,9 @@ export declare const frontendCommandDefinition: {
68
74
  npmDeps: readonly [{
69
75
  readonly name: "@augment-vir/node-js";
70
76
  readonly type: NpmDepTypeEnum.Dev;
77
+ }, {
78
+ readonly name: "esbuild";
79
+ readonly type: NpmDepTypeEnum.Dev;
71
80
  }, {
72
81
  readonly name: "typescript";
73
82
  readonly type: NpmDepTypeEnum.Dev;
@@ -94,6 +103,9 @@ export declare const frontendCommandDefinition: {
94
103
  npmDeps: readonly [{
95
104
  readonly name: "@augment-vir/node-js";
96
105
  readonly type: NpmDepTypeEnum.Dev;
106
+ }, {
107
+ readonly name: "esbuild";
108
+ readonly type: NpmDepTypeEnum.Dev;
97
109
  }, {
98
110
  readonly name: "typescript";
99
111
  readonly type: NpmDepTypeEnum.Dev;
@@ -120,6 +132,9 @@ export declare const frontendCommandDefinition: {
120
132
  npmDeps: readonly [{
121
133
  readonly name: "@augment-vir/node-js";
122
134
  readonly type: NpmDepTypeEnum.Dev;
135
+ }, {
136
+ readonly name: "esbuild";
137
+ readonly type: NpmDepTypeEnum.Dev;
123
138
  }, {
124
139
  readonly name: "typescript";
125
140
  readonly type: NpmDepTypeEnum.Dev;
@@ -1,7 +1,32 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.frontendCommandDefinition = void 0;
4
27
  const common_1 = require("@augment-vir/common");
28
+ const node_js_1 = require("@augment-vir/node-js");
29
+ const promises_1 = require("fs/promises");
5
30
  const path_1 = require("path");
6
31
  const define_command_1 = require("../api/command/define-command");
7
32
  const define_command_inputs_1 = require("../api/command/define-command-inputs");
@@ -21,6 +46,7 @@ exports.frontendCommandDefinition = (0, define_command_1.defineCommand)({
21
46
  },
22
47
  npmDeps: [
23
48
  { name: '@augment-vir/node-js', type: define_command_inputs_1.NpmDepTypeEnum.Dev },
49
+ { name: 'esbuild', type: define_command_inputs_1.NpmDepTypeEnum.Dev },
24
50
  { name: 'typescript', type: define_command_inputs_1.NpmDepTypeEnum.Dev },
25
51
  { name: 'vite-tsconfig-paths', type: define_command_inputs_1.NpmDepTypeEnum.Dev },
26
52
  { name: 'vite', type: define_command_inputs_1.NpmDepTypeEnum.Dev },
@@ -41,44 +67,74 @@ exports.frontendCommandDefinition = (0, define_command_1.defineCommand)({
41
67
  configFileDefinition: inputs.configFiles.vite,
42
68
  packageDir: package_paths_1.virmatorPackageDir,
43
69
  });
44
- const needToBuild = !!inputs.inputSubCommands.length;
45
- const useDefaultConfigArgs = !inputs.filteredInputArgs.includes('--config');
46
- const configString = useDefaultConfigArgs ? `--config ${viteConfigPath}` : '';
47
- const viteBinPath = await (0, package_paths_1.getNpmBinPath)({
48
- repoDir: inputs.repoDir,
49
- command: 'vite',
50
- packageDirPath: inputs.packageDir,
51
- });
52
- const removeCommand = needToBuild
53
- ? `node -e "require('fs').rmSync('node_modules/.vite', {recursive: true, force: true})"`
54
- : '';
55
- const mainCommand = [
56
- removeCommand,
57
- viteBinPath,
58
- ]
59
- .filter(common_1.isTruthy)
60
- .join(' && ');
61
- const subCommandArgs = needToBuild
62
- ? [
63
- 'build',
64
- ...inputs.filteredInputArgs,
65
- ]
66
- : inputs.filteredInputArgs;
67
- const previewCommandArgs = inputs.inputSubCommands.includes(inputs.subCommands.preview)
68
- ? [
69
- '&&',
70
+ const tempFilePath = (0, path_1.join)((0, path_1.dirname)(viteConfigPath), `generated-config-${Date.now()}-${(0, common_1.randomString)()}.cjs`);
71
+ const oldWrite = process.stdout.write;
72
+ try {
73
+ const needToBuild = !!inputs.inputSubCommands.length;
74
+ const useDefaultConfigArgs = !inputs.filteredInputArgs.includes('--config');
75
+ const configString = useDefaultConfigArgs ? `--config ${viteConfigPath}` : '';
76
+ await (await Promise.resolve().then(() => __importStar(require('esbuild')))).build({
77
+ entryPoints: [viteConfigPath],
78
+ outfile: tempFilePath,
79
+ write: true,
80
+ target: ['node20'],
81
+ platform: 'node',
82
+ bundle: false,
83
+ format: 'cjs',
84
+ });
85
+ /**
86
+ * Disable console logs the first time we require this, as logs will also print when
87
+ * Vite loads the config again.
88
+ */
89
+ process.stdout.write = () => false;
90
+ const viteConfig = await require(tempFilePath).default;
91
+ process.stdout.write = oldWrite;
92
+ const root = viteConfig.root ? (0, path_1.resolve)(process.cwd(), viteConfig.root) : process.cwd();
93
+ const buildOutputPath = (0, path_1.resolve)(root, viteConfig?.build?.outDir || 'dist');
94
+ const viteBinPath = await (0, package_paths_1.getNpmBinPath)({
95
+ repoDir: inputs.repoDir,
96
+ command: 'vite',
97
+ packageDirPath: inputs.packageDir,
98
+ });
99
+ const removeCommand = needToBuild
100
+ ? `node -e "require('fs').rmSync('node_modules/.vite', {recursive: true, force: true})"`
101
+ : '';
102
+ const mainCommand = [
103
+ removeCommand,
70
104
  viteBinPath,
71
- 'preview',
72
- ...inputs.filteredInputArgs,
73
105
  ]
74
- : [];
75
- return {
76
- args: [
77
- mainCommand,
78
- '--force',
79
- configString,
80
- ...subCommandArgs,
81
- ...previewCommandArgs,
82
- ],
83
- };
106
+ .filter(common_1.isTruthy)
107
+ .join(' && ');
108
+ const indexPath = (0, path_1.join)(buildOutputPath, 'index.html');
109
+ const dist404Path = (0, path_1.join)(buildOutputPath, '404.html');
110
+ const subCommandArgs = needToBuild
111
+ ? [
112
+ 'build',
113
+ ...inputs.filteredInputArgs,
114
+ '&&',
115
+ `node -e "require('fs').copyFileSync('${(0, node_js_1.interpolationSafeWindowsPath)(indexPath)}', '${(0, node_js_1.interpolationSafeWindowsPath)(dist404Path)}')"`,
116
+ ]
117
+ : inputs.filteredInputArgs;
118
+ const previewCommandArgs = inputs.inputSubCommands.includes(inputs.subCommands.preview)
119
+ ? [
120
+ '&&',
121
+ viteBinPath,
122
+ 'preview',
123
+ ...inputs.filteredInputArgs,
124
+ ]
125
+ : [];
126
+ return {
127
+ args: [
128
+ mainCommand,
129
+ '--force',
130
+ configString,
131
+ ...subCommandArgs,
132
+ ...previewCommandArgs,
133
+ ],
134
+ };
135
+ }
136
+ finally {
137
+ process.stdout.write = oldWrite;
138
+ await (0, promises_1.unlink)(tempFilePath);
139
+ }
84
140
  });
package/dist/index.d.ts CHANGED
@@ -565,6 +565,9 @@ export declare const virmator: Readonly<{
565
565
  npmDeps: readonly [{
566
566
  readonly name: "@augment-vir/node-js";
567
567
  readonly type: import("./api/command/define-command-inputs").NpmDepTypeEnum.Dev;
568
+ }, {
569
+ readonly name: "esbuild";
570
+ readonly type: import("./api/command/define-command-inputs").NpmDepTypeEnum.Dev;
568
571
  }, {
569
572
  readonly name: "typescript";
570
573
  readonly type: import("./api/command/define-command-inputs").NpmDepTypeEnum.Dev;
@@ -592,6 +595,9 @@ export declare const virmator: Readonly<{
592
595
  npmDeps: readonly [{
593
596
  readonly name: "@augment-vir/node-js";
594
597
  readonly type: import("./api/command/define-command-inputs").NpmDepTypeEnum.Dev;
598
+ }, {
599
+ readonly name: "esbuild";
600
+ readonly type: import("./api/command/define-command-inputs").NpmDepTypeEnum.Dev;
595
601
  }, {
596
602
  readonly name: "typescript";
597
603
  readonly type: import("./api/command/define-command-inputs").NpmDepTypeEnum.Dev;
@@ -619,6 +625,9 @@ export declare const virmator: Readonly<{
619
625
  npmDeps: readonly [{
620
626
  readonly name: "@augment-vir/node-js";
621
627
  readonly type: import("./api/command/define-command-inputs").NpmDepTypeEnum.Dev;
628
+ }, {
629
+ readonly name: "esbuild";
630
+ readonly type: import("./api/command/define-command-inputs").NpmDepTypeEnum.Dev;
622
631
  }, {
623
632
  readonly name: "typescript";
624
633
  readonly type: import("./api/command/define-command-inputs").NpmDepTypeEnum.Dev;
@@ -645,6 +654,9 @@ export declare const virmator: Readonly<{
645
654
  npmDeps: readonly [{
646
655
  readonly name: "@augment-vir/node-js";
647
656
  readonly type: import("./api/command/define-command-inputs").NpmDepTypeEnum.Dev;
657
+ }, {
658
+ readonly name: "esbuild";
659
+ readonly type: import("./api/command/define-command-inputs").NpmDepTypeEnum.Dev;
648
660
  }, {
649
661
  readonly name: "typescript";
650
662
  readonly type: import("./api/command/define-command-inputs").NpmDepTypeEnum.Dev;
@@ -671,6 +683,9 @@ export declare const virmator: Readonly<{
671
683
  npmDeps: readonly [{
672
684
  readonly name: "@augment-vir/node-js";
673
685
  readonly type: import("./api/command/define-command-inputs").NpmDepTypeEnum.Dev;
686
+ }, {
687
+ readonly name: "esbuild";
688
+ readonly type: import("./api/command/define-command-inputs").NpmDepTypeEnum.Dev;
674
689
  }, {
675
690
  readonly name: "typescript";
676
691
  readonly type: import("./api/command/define-command-inputs").NpmDepTypeEnum.Dev;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virmator",
3
- "version": "11.4.0",
3
+ "version": "11.5.0",
4
4
  "description": "Handle common package configs, commands, and dependencies.",
5
5
  "keywords": [
6
6
  "automation",
@@ -43,37 +43,37 @@
43
43
  "test:types": "tsc --noEmit"
44
44
  },
45
45
  "dependencies": {
46
- "@augment-vir/common": "^23.3.4",
47
- "@augment-vir/node-js": "^23.3.4",
46
+ "@augment-vir/common": "^26.0.2",
47
+ "@augment-vir/node-js": "^26.0.2",
48
48
  "ansi-colors": "^4.1.3",
49
49
  "concurrently": "^8.2.2",
50
50
  "glob": "^8.1.0",
51
51
  "glob-promise": "^6.0.5",
52
52
  "mono-vir": "^1.0.0",
53
53
  "semver": "^7.6.0",
54
- "simple-git": "^3.22.0",
55
- "type-fest": "^4.10.2"
54
+ "simple-git": "^3.23.0",
55
+ "type-fest": "^4.13.1"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@electrovir/nyc": "15.1.0-fix0",
59
59
  "@istanbuljs/nyc-config-typescript": "^1.0.2",
60
60
  "@open-wc/testing": "^4.0.0",
61
- "@types/chai": "^4.3.11",
61
+ "@types/chai": "^4.3.14",
62
62
  "@types/fs-extra": "^11.0.4",
63
63
  "@types/glob": "^8.1.0",
64
64
  "@types/mocha": "^10.0.6",
65
- "@types/node": "^20.11.19",
66
- "@types/semver": "^7.5.7",
65
+ "@types/node": "^20.11.30",
66
+ "@types/semver": "^7.5.8",
67
67
  "@web/dev-server-esbuild": "^1.0.2",
68
- "@web/test-runner": "^0.18.0",
68
+ "@web/test-runner": "^0.18.1",
69
69
  "@web/test-runner-commands": "^0.9.0",
70
70
  "@web/test-runner-playwright": "^0.11.0",
71
71
  "@web/test-runner-visual-regression": "^0.9.0",
72
72
  "chai": "^4.3.10",
73
- "cspell": "^8.4.0",
74
- "dependency-cruiser": "^16.2.1",
73
+ "cspell": "^8.6.0",
74
+ "dependency-cruiser": "^16.2.4",
75
75
  "element-vir": "^20.0.9",
76
- "esbuild": "^0.20.1",
76
+ "esbuild": "^0.20.2",
77
77
  "fs-extra": "^11.2.0",
78
78
  "istanbul-smart-text-reporter": "^1.1.4",
79
79
  "markdown-code-example-inserter": "^1.0.0",
@@ -85,18 +85,18 @@
85
85
  "prettier-plugin-jsdoc": "^1.3.0",
86
86
  "prettier-plugin-multiline-arrays": "^3.0.4",
87
87
  "prettier-plugin-organize-imports": "^3.2.4",
88
- "prettier-plugin-packagejson": "^2.4.11",
89
- "prettier-plugin-sort-json": "^3.1.0",
88
+ "prettier-plugin-packagejson": "^2.4.12",
89
+ "prettier-plugin-sort-json": "^4.0.0",
90
90
  "prettier-plugin-toml": "^2.0.1",
91
91
  "test-as-package": "^1.0.0",
92
92
  "test-established-expectations": "^1.0.0",
93
93
  "ts-node": "^10.9.2",
94
94
  "tsconfig-paths": "^4.2.0",
95
- "typedoc": "^0.25.8",
95
+ "typedoc": "^0.25.12",
96
96
  "typescript": "5.3.3",
97
97
  "virmator": "./",
98
98
  "vite": "^4.5.0",
99
- "vite-tsconfig-paths": "^4.3.1"
99
+ "vite-tsconfig-paths": "^4.3.2"
100
100
  },
101
101
  "overrides": {
102
102
  "virmator": "*"