@powerhousedao/builder-tools 4.1.0-dev.113 → 4.1.0-dev.115

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerhousedao/builder-tools",
3
- "version": "4.1.0-dev.113",
3
+ "version": "4.1.0-dev.115",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0-only",
6
6
  "publishConfig": {
@@ -112,6 +112,7 @@
112
112
  "magic-string": "^0.30.17",
113
113
  "postcss": "^8.5.3",
114
114
  "react-hook-form": "^7.56.1",
115
+ "read-pkg": "^9.0.1",
115
116
  "resolve.exports": "^2.0.3",
116
117
  "tailwind-merge": "^3.2.0",
117
118
  "tailwindcss": "^4.1.14",
@@ -123,10 +124,10 @@
123
124
  "vite-envs": "^4.6.0",
124
125
  "vite-plugin-node-polyfills": "^0.24.0",
125
126
  "zod": "^3.24.3",
126
- "@powerhousedao/design-system": "4.1.0-dev.113",
127
- "@powerhousedao/config": "4.1.0-dev.113",
128
- "@powerhousedao/reactor-browser": "4.1.0-dev.113",
129
- "document-model": "4.1.0-dev.113"
127
+ "@powerhousedao/config": "4.1.0-dev.115",
128
+ "@powerhousedao/design-system": "4.1.0-dev.115",
129
+ "document-model": "4.1.0-dev.115",
130
+ "@powerhousedao/reactor-browser": "4.1.0-dev.115"
130
131
  },
131
132
  "peerDependencies": {
132
133
  "react": "^19.2.0",
@@ -1,19 +0,0 @@
1
- import type { Plugin } from "vite";
2
- type Options = {
3
- /** Extra args to pass to tsc (besides -b / -w). */
4
- args?: string[];
5
- /** Fail Vite startup when initial tsc fails. Default: true. */
6
- hardFail?: boolean;
7
- /** Use local workspace TS if available. Default: true. */
8
- useWorkspaceTS?: boolean;
9
- };
10
- /**
11
- * Vite plugin that runs tsc -b on startup and tsc -w on watch mode.
12
- *
13
- * @param project Path to the project (folder with tsconfig.json or the file itself).
14
- * @param options Options.
15
- * @returns Vite plugin.
16
- */
17
- export declare function phTypescriptPlugin(project: string, options?: Options): Plugin;
18
- export {};
19
- //# sourceMappingURL=ph-typescript.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ph-typescript.d.ts","sourceRoot":"","sources":["../../../connect-utils/vite-plugins/ph-typescript.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAC;AAElD,KAAK,OAAO,GAAG;IACb,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAqCF;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,OAAY,GACpB,MAAM,CAgER"}
@@ -1,102 +0,0 @@
1
- import { spawn } from "node:child_process";
2
- function resolveTscBin(useWorkspaceTS = true) {
3
- if (useWorkspaceTS) {
4
- try {
5
- const tscBin = require.resolve("typescript/bin/tsc", {
6
- paths: [process.cwd()],
7
- });
8
- return { cmd: process.execPath, baseArgs: [tscBin] }; // node <tscBin>
9
- }
10
- catch {
11
- /* fall through */
12
- }
13
- }
14
- const cmd = process.platform === "win32" ? "tsc.cmd" : "tsc";
15
- return { cmd, baseArgs: [] };
16
- }
17
- function runOnce(cmd, args, label = "tsc") {
18
- return new Promise((resolve, reject) => {
19
- const child = spawn(cmd, args, { stdio: "pipe" });
20
- child.stdout.on("data", (d) => process.stdout.write(`[${label}] ${d}`));
21
- child.stderr.on("data", (d) => process.stderr.write(`[${label}] ${d}`));
22
- child.on("close", (code) => code === 0
23
- ? resolve()
24
- : reject(new Error(`${label} exited with code ${code}`)));
25
- });
26
- }
27
- function watch(cmd, args, label = "tsc") {
28
- const child = spawn(cmd, args, { stdio: "pipe" });
29
- // child.stdout.on("data", (d) => process.stdout.write(`[${label}] ${d}`));
30
- child.stderr.on("data", (d) => process.stderr.write(`[${label}] ${d}`));
31
- return child;
32
- }
33
- /**
34
- * Vite plugin that runs tsc -b on startup and tsc -w on watch mode.
35
- *
36
- * @param project Path to the project (folder with tsconfig.json or the file itself).
37
- * @param options Options.
38
- * @returns Vite plugin.
39
- */
40
- export function phTypescriptPlugin(project, options = {}) {
41
- const { args = [], hardFail = true, useWorkspaceTS = true } = options;
42
- const { cmd, baseArgs } = resolveTscBin(useWorkspaceTS);
43
- const buildArgs = [...baseArgs, "-b", project];
44
- const watchArgs = [...buildArgs, ...args, "-w", "--preserveWatchOutput"];
45
- const onceArgs = [...buildArgs, ...args];
46
- let viteCommand;
47
- let watcher;
48
- const stopWatcher = () => {
49
- if (watcher && !watcher.killed) {
50
- try {
51
- watcher.kill("SIGINT");
52
- }
53
- catch {
54
- /* empty */
55
- }
56
- }
57
- watcher = undefined;
58
- };
59
- const hookShutdown = (server) => {
60
- const close = () => stopWatcher();
61
- server?.httpServer?.once("close", close);
62
- process.once("SIGINT", close);
63
- process.once("SIGTERM", close);
64
- };
65
- return {
66
- name: "vite-plugin-tsc-build-watch",
67
- enforce: "pre",
68
- configResolved({ command }) {
69
- viteCommand = command;
70
- },
71
- // Dev: block startup on tsc -b, then start -w
72
- async configureServer(server) {
73
- try {
74
- await runOnce(cmd, onceArgs, "tsc");
75
- }
76
- catch (err) {
77
- if (hardFail)
78
- throw err;
79
- console.error(err);
80
- }
81
- watcher = watch(cmd, watchArgs, "tsc");
82
- hookShutdown(server);
83
- },
84
- // Build: run a single tsc -b before bundling
85
- async buildStart() {
86
- if (viteCommand === "build") {
87
- try {
88
- await runOnce(cmd, onceArgs, "tsc");
89
- }
90
- catch (err) {
91
- if (hardFail)
92
- throw err;
93
- console.error(err);
94
- }
95
- }
96
- },
97
- closeBundle() {
98
- stopWatcher();
99
- },
100
- };
101
- }
102
- //# sourceMappingURL=ph-typescript.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ph-typescript.js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