@powerhousedao/builder-tools 6.0.0-staging.4 → 6.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.
Files changed (154) hide show
  1. package/dist/index.d.mts +176 -0
  2. package/dist/index.d.mts.map +1 -0
  3. package/dist/index.mjs +639 -0
  4. package/dist/index.mjs.map +1 -0
  5. package/package.json +24 -29
  6. package/dist/connect-build/build.d.ts +0 -6
  7. package/dist/connect-build/build.d.ts.map +0 -1
  8. package/dist/connect-build/build.js +0 -54
  9. package/dist/connect-build/build.js.map +0 -1
  10. package/dist/connect-build/constants.d.ts +0 -11
  11. package/dist/connect-build/constants.d.ts.map +0 -1
  12. package/dist/connect-build/constants.js +0 -11
  13. package/dist/connect-build/constants.js.map +0 -1
  14. package/dist/connect-build/helpers.d.ts +0 -37
  15. package/dist/connect-build/helpers.d.ts.map +0 -1
  16. package/dist/connect-build/helpers.js +0 -111
  17. package/dist/connect-build/helpers.js.map +0 -1
  18. package/dist/connect-build/index.d.ts +0 -5
  19. package/dist/connect-build/index.d.ts.map +0 -1
  20. package/dist/connect-build/index.js +0 -4
  21. package/dist/connect-build/index.js.map +0 -1
  22. package/dist/connect-build/preview.d.ts +0 -3
  23. package/dist/connect-build/preview.d.ts.map +0 -1
  24. package/dist/connect-build/preview.js +0 -19
  25. package/dist/connect-build/preview.js.map +0 -1
  26. package/dist/connect-build/types.d.ts +0 -27
  27. package/dist/connect-build/types.d.ts.map +0 -1
  28. package/dist/connect-build/types.js +0 -2
  29. package/dist/connect-build/types.js.map +0 -1
  30. package/dist/connect-studio/index.d.ts +0 -3
  31. package/dist/connect-studio/index.d.ts.map +0 -1
  32. package/dist/connect-studio/index.js +0 -2
  33. package/dist/connect-studio/index.js.map +0 -1
  34. package/dist/connect-studio/server.d.ts +0 -3
  35. package/dist/connect-studio/server.d.ts.map +0 -1
  36. package/dist/connect-studio/server.js +0 -234
  37. package/dist/connect-studio/server.js.map +0 -1
  38. package/dist/connect-studio/studio.d.ts +0 -3
  39. package/dist/connect-studio/studio.d.ts.map +0 -1
  40. package/dist/connect-studio/studio.js +0 -66
  41. package/dist/connect-studio/studio.js.map +0 -1
  42. package/dist/connect-studio/types.d.ts +0 -28
  43. package/dist/connect-studio/types.d.ts.map +0 -1
  44. package/dist/connect-studio/types.js +0 -2
  45. package/dist/connect-studio/types.js.map +0 -1
  46. package/dist/connect-utils/build.d.ts +0 -3
  47. package/dist/connect-utils/build.d.ts.map +0 -1
  48. package/dist/connect-utils/build.js +0 -21
  49. package/dist/connect-utils/build.js.map +0 -1
  50. package/dist/connect-utils/constants.d.ts +0 -5
  51. package/dist/connect-utils/constants.d.ts.map +0 -1
  52. package/dist/connect-utils/constants.js +0 -5
  53. package/dist/connect-utils/constants.js.map +0 -1
  54. package/dist/connect-utils/helpers.d.ts +0 -48
  55. package/dist/connect-utils/helpers.d.ts.map +0 -1
  56. package/dist/connect-utils/helpers.js +0 -265
  57. package/dist/connect-utils/helpers.js.map +0 -1
  58. package/dist/connect-utils/index.d.ts +0 -15
  59. package/dist/connect-utils/index.d.ts.map +0 -1
  60. package/dist/connect-utils/index.js +0 -15
  61. package/dist/connect-utils/index.js.map +0 -1
  62. package/dist/connect-utils/preview.d.ts +0 -3
  63. package/dist/connect-utils/preview.d.ts.map +0 -1
  64. package/dist/connect-utils/preview.js +0 -33
  65. package/dist/connect-utils/preview.js.map +0 -1
  66. package/dist/connect-utils/studio.d.ts +0 -7
  67. package/dist/connect-utils/studio.d.ts.map +0 -1
  68. package/dist/connect-utils/studio.js +0 -30
  69. package/dist/connect-utils/studio.js.map +0 -1
  70. package/dist/connect-utils/types.d.ts +0 -37
  71. package/dist/connect-utils/types.d.ts.map +0 -1
  72. package/dist/connect-utils/types.js +0 -2
  73. package/dist/connect-utils/types.js.map +0 -1
  74. package/dist/connect-utils/vite-config.d.ts +0 -61
  75. package/dist/connect-utils/vite-config.d.ts.map +0 -1
  76. package/dist/connect-utils/vite-config.js +0 -282
  77. package/dist/connect-utils/vite-config.js.map +0 -1
  78. package/dist/connect-utils/vite-plugins/base.d.ts +0 -10
  79. package/dist/connect-utils/vite-plugins/base.d.ts.map +0 -1
  80. package/dist/connect-utils/vite-plugins/base.js +0 -130
  81. package/dist/connect-utils/vite-plugins/base.js.map +0 -1
  82. package/dist/connect-utils/vite-plugins/document-models-hmr.d.ts +0 -3
  83. package/dist/connect-utils/vite-plugins/document-models-hmr.d.ts.map +0 -1
  84. package/dist/connect-utils/vite-plugins/document-models-hmr.js +0 -62
  85. package/dist/connect-utils/vite-plugins/document-models-hmr.js.map +0 -1
  86. package/dist/connect-utils/vite-plugins/editors-hmr.d.ts +0 -3
  87. package/dist/connect-utils/vite-plugins/editors-hmr.d.ts.map +0 -1
  88. package/dist/connect-utils/vite-plugins/editors-hmr.js +0 -61
  89. package/dist/connect-utils/vite-plugins/editors-hmr.js.map +0 -1
  90. package/dist/connect-utils/vite-plugins/external-packages.d.ts +0 -3
  91. package/dist/connect-utils/vite-plugins/external-packages.d.ts.map +0 -1
  92. package/dist/connect-utils/vite-plugins/external-packages.js +0 -127
  93. package/dist/connect-utils/vite-plugins/external-packages.js.map +0 -1
  94. package/dist/connect-utils/vite-plugins/importmap.d.ts +0 -23
  95. package/dist/connect-utils/vite-plugins/importmap.d.ts.map +0 -1
  96. package/dist/connect-utils/vite-plugins/importmap.js +0 -243
  97. package/dist/connect-utils/vite-plugins/importmap.js.map +0 -1
  98. package/dist/connect-utils/vite-plugins/ph-external-packages.d.ts +0 -2
  99. package/dist/connect-utils/vite-plugins/ph-external-packages.d.ts.map +0 -1
  100. package/dist/connect-utils/vite-plugins/ph-external-packages.js +0 -88
  101. package/dist/connect-utils/vite-plugins/ph-external-packages.js.map +0 -1
  102. package/dist/connect-utils/vite-plugins/studio.d.ts +0 -3
  103. package/dist/connect-utils/vite-plugins/studio.d.ts.map +0 -1
  104. package/dist/connect-utils/vite-plugins/studio.js +0 -33
  105. package/dist/connect-utils/vite-plugins/studio.js.map +0 -1
  106. package/dist/editor-utils/components/documentEditor.d.ts +0 -7
  107. package/dist/editor-utils/components/documentEditor.d.ts.map +0 -1
  108. package/dist/editor-utils/components/documentEditor.js +0 -6
  109. package/dist/editor-utils/components/documentEditor.js.map +0 -1
  110. package/dist/editor-utils/components/editorToolbar.d.ts +0 -11
  111. package/dist/editor-utils/components/editorToolbar.d.ts.map +0 -1
  112. package/dist/editor-utils/components/editorToolbar.js +0 -6
  113. package/dist/editor-utils/components/editorToolbar.js.map +0 -1
  114. package/dist/editor-utils/components/editorWorksheet.d.ts +0 -7
  115. package/dist/editor-utils/components/editorWorksheet.d.ts.map +0 -1
  116. package/dist/editor-utils/components/editorWorksheet.js +0 -5
  117. package/dist/editor-utils/components/editorWorksheet.js.map +0 -1
  118. package/dist/editor-utils/components/index.d.ts +0 -9
  119. package/dist/editor-utils/components/index.d.ts.map +0 -1
  120. package/dist/editor-utils/components/index.js +0 -10
  121. package/dist/editor-utils/components/index.js.map +0 -1
  122. package/dist/editor-utils/components/styles.d.ts +0 -40
  123. package/dist/editor-utils/components/styles.d.ts.map +0 -1
  124. package/dist/editor-utils/components/styles.js +0 -79
  125. package/dist/editor-utils/components/styles.js.map +0 -1
  126. package/dist/editor-utils/components/stylesVariant.d.ts +0 -40
  127. package/dist/editor-utils/components/stylesVariant.d.ts.map +0 -1
  128. package/dist/editor-utils/components/stylesVariant.js +0 -89
  129. package/dist/editor-utils/components/stylesVariant.js.map +0 -1
  130. package/dist/editor-utils/components/textInput.d.ts +0 -20
  131. package/dist/editor-utils/components/textInput.d.ts.map +0 -1
  132. package/dist/editor-utils/components/textInput.js +0 -84
  133. package/dist/editor-utils/components/textInput.js.map +0 -1
  134. package/dist/editor-utils/components/textInputVariant.d.ts +0 -21
  135. package/dist/editor-utils/components/textInputVariant.d.ts.map +0 -1
  136. package/dist/editor-utils/components/textInputVariant.js +0 -93
  137. package/dist/editor-utils/components/textInputVariant.js.map +0 -1
  138. package/dist/editor-utils/components/toolbarButton.d.ts +0 -7
  139. package/dist/editor-utils/components/toolbarButton.d.ts.map +0 -1
  140. package/dist/editor-utils/components/toolbarButton.js +0 -9
  141. package/dist/editor-utils/components/toolbarButton.js.map +0 -1
  142. package/dist/editor-utils/index.d.ts +0 -3
  143. package/dist/editor-utils/index.d.ts.map +0 -1
  144. package/dist/editor-utils/index.js +0 -3
  145. package/dist/editor-utils/index.js.map +0 -1
  146. package/dist/editor-utils/reducer.d.ts +0 -3
  147. package/dist/editor-utils/reducer.d.ts.map +0 -1
  148. package/dist/editor-utils/reducer.js +0 -25
  149. package/dist/editor-utils/reducer.js.map +0 -1
  150. package/dist/index.d.ts +0 -4
  151. package/dist/index.d.ts.map +0 -1
  152. package/dist/index.js +0 -4
  153. package/dist/index.js.map +0 -1
  154. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,234 +0,0 @@
1
- import { getConfig } from "@powerhousedao/config/node";
2
- import tailwindcss from "@tailwindcss/vite";
3
- import basicSsl from "@vitejs/plugin-basic-ssl";
4
- import viteReact from "@vitejs/plugin-react";
5
- import fs from "node:fs";
6
- import path, { dirname, join, parse, resolve } from "node:path";
7
- import process from "node:process";
8
- import { fileURLToPath } from "node:url";
9
- import { createLogger, createServer, loadConfigFromFile, searchForWorkspaceRoot, } from "vite";
10
- import { viteEnvs } from "vite-envs";
11
- import { nodePolyfills } from "vite-plugin-node-polyfills";
12
- import { backupIndexHtml, copyConnect, ensureNodeVersion, resolveConnectBundle, resolvePackage, runShellScriptPlugin, } from "../connect-utils/helpers.js";
13
- import { viteConnectDevStudioPlugin, viteDocumentModelsHMR, viteEditorsHMR, viteLoadExternalPackages, } from "../connect-utils/index.js";
14
- // silences dynamic import warnings
15
- const logger = createLogger();
16
- const loggerWarn = logger.warn;
17
- /**
18
- * @param {string} msg
19
- * @param {import('vite').LogOptions} options
20
- */
21
- logger.warn = (msg, options) => {
22
- if (msg.includes("The above dynamic import cannot be analyzed by Vite.")) {
23
- return;
24
- }
25
- if (msg.includes("@import must precede all other statements (besides @charset or empty @layer)")) {
26
- return;
27
- }
28
- loggerWarn(msg, options);
29
- };
30
- function getConnectPaths() {
31
- try {
32
- const connectIndexPath = resolvePackage("@powerhousedao/connect/index.html");
33
- const connectViteConfigPath = resolvePackage("@powerhousedao/connect/vite.config.ts");
34
- return { connectIndexPath, connectViteConfigPath };
35
- }
36
- catch (error) {
37
- if (error instanceof Error &&
38
- error.message.includes("Cannot find module")) {
39
- throw new Error('Please install "@powerhousedao/connect"');
40
- }
41
- throw error;
42
- }
43
- }
44
- /**
45
- * Finds the vite-plugin-node-polyfills folder by traversing up the directory tree
46
- * @param {string} startPath - The starting path to begin the search
47
- * @returns {string|null} - The path to the vite-plugin-node-polyfills folder, or null if not found
48
- */
49
- function findVitePluginNodePolyfills(startPath) {
50
- let currentPath = dirname(startPath);
51
- const root = parse(currentPath).root;
52
- while (currentPath !== root) {
53
- const nodeModulesPath = join(currentPath, "node_modules");
54
- const vitePluginPath = join(nodeModulesPath, "vite-plugin-node-polyfills");
55
- if (fs.existsSync(vitePluginPath)) {
56
- return vitePluginPath;
57
- }
58
- const parentPath = dirname(currentPath);
59
- if (parentPath === currentPath) {
60
- // Reached the root directory
61
- break;
62
- }
63
- currentPath = parentPath;
64
- }
65
- return null;
66
- }
67
- export async function startServer(options = {
68
- logLevel: "info",
69
- }) {
70
- // set from options, as they are dynamically loaded
71
- process.env.LOG_LEVEL = options.logLevel;
72
- // exits if node version is not compatible
73
- ensureNodeVersion();
74
- const connectPath = options.connectPath ?? resolveConnectBundle();
75
- const projectRoot = process.cwd();
76
- const studioPath = join(projectRoot, ".ph", "connect-studio");
77
- copyConnect(connectPath, studioPath);
78
- // backups index html if running on windows
79
- backupIndexHtml(studioPath, true);
80
- const PORT = process.env.PORT ? parseInt(process.env.PORT) : 3000;
81
- const HOST = process.env.HOST ? process.env.HOST : "0.0.0.0";
82
- const OPEN_BROWSER = typeof process.env.OPEN_BROWSER === "string"
83
- ? process.env.OPEN_BROWSER === "true"
84
- : false;
85
- process.env.PH_CONNECT_STUDIO_MODE = "true";
86
- process.env.PH_CONNECT_CLI_VERSION = options.phCliVersion;
87
- const computedEnv = { LOG_LEVEL: options.logLevel };
88
- const phConfig = getConfig(options.configFile);
89
- const phPackages = phConfig.packages?.map((p) => p.packageName) ?? [];
90
- // infers the project path from the config file path if provided,
91
- // otherwise fallbacks to the current working directory
92
- const localPackage = options.configFile
93
- ? path.dirname(path.resolve(options.configFile))
94
- : process.cwd();
95
- const hasLocalPackage = fs.existsSync(path.join(localPackage, "index.ts"));
96
- if (hasLocalPackage) {
97
- phPackages.push(localPackage);
98
- }
99
- process.env.PH_PACKAGES = phPackages.join(",");
100
- // TODO: should we move the document model editor to common or vetra
101
- // and make Connect a peerDependency of builder-tools?
102
- const { connectIndexPath, connectViteConfigPath } = getConnectPaths();
103
- const connectViteConfig = await loadConfigFromFile({ command: "serve", mode: "development" }, connectViteConfigPath);
104
- if (!connectViteConfig) {
105
- throw new Error(`Failed to load Connect vite config from ${connectViteConfigPath}`);
106
- }
107
- const currentFilePath = fileURLToPath(import.meta.url);
108
- const vitePluginNodePolyfillsPath = findVitePluginNodePolyfills(currentFilePath);
109
- const disableDynamicLoading = options.disableDynamicLoading ?? false;
110
- const ignoredPaths = ["**/subgraphs/**", "**/powerhouse.manifest.json"];
111
- if (disableDynamicLoading) {
112
- ignoredPaths.push("**/document-models/**", "**/editors/**");
113
- }
114
- const config = {
115
- customLogger: logger,
116
- configFile: false,
117
- root: studioPath,
118
- server: {
119
- port: PORT,
120
- open: options.open ?? OPEN_BROWSER,
121
- host: HOST,
122
- // Allow serving files from current project and linked packages
123
- fs: {
124
- allow: generateAllowedPaths(projectRoot),
125
- },
126
- watch: {
127
- ignored: ignoredPaths,
128
- },
129
- },
130
- optimizeDeps: {
131
- exclude: ["@electric-sql/pglite"],
132
- },
133
- worker: {
134
- format: "es",
135
- },
136
- resolve: {
137
- alias: [
138
- { find: "jszip", replacement: "jszip/dist/jszip.min.js" },
139
- {
140
- find: "react",
141
- replacement: join(projectRoot, "node_modules", "react"),
142
- },
143
- {
144
- find: "react-dom",
145
- replacement: join(projectRoot, "node_modules", "react-dom"),
146
- },
147
- {
148
- find: "vite-plugin-node-polyfills/shims/process",
149
- replacement: vitePluginNodePolyfillsPath
150
- ? join(vitePluginNodePolyfillsPath, "shims/process/dist/index.js")
151
- : join(fileURLToPath(import.meta.url), "../../../node_modules", "vite-plugin-node-polyfills/shims/process/dist/index.js"),
152
- },
153
- ],
154
- dedupe: ["@powerhousedao/reactor-browser"],
155
- },
156
- plugins: [
157
- tailwindcss(),
158
- nodePolyfills({
159
- include: ["events"],
160
- globals: {
161
- Buffer: false,
162
- global: false,
163
- process: true,
164
- },
165
- }),
166
- viteReact({
167
- // includes js|jsx|ts|tsx)$/ inside projectRoot
168
- include: [join(projectRoot, "**/*.(js|jsx|ts|tsx)")],
169
- exclude: ["node_modules", join(studioPath, "assets/*.js")],
170
- }),
171
- viteConnectDevStudioPlugin(true, studioPath),
172
- viteLoadExternalPackages(!disableDynamicLoading, options.packages, studioPath),
173
- // Only enable documents HMR when explicitly requested (e.g., from ph-cli vetra)
174
- options.enableDocumentsHMR && viteDocumentModelsHMR(studioPath),
175
- options.enableDocumentsHMR && viteEditorsHMR(studioPath),
176
- viteEnvs({
177
- declarationFile: join(studioPath, ".env"),
178
- computedEnv,
179
- }),
180
- runShellScriptPlugin("vite-envs.sh", studioPath),
181
- options.https &&
182
- basicSsl({
183
- name: "Powerhouse Connect Studio",
184
- }),
185
- ],
186
- };
187
- const server = await createServer(config);
188
- await server.listen();
189
- server.printUrls();
190
- server.bindCLIShortcuts({ print: true });
191
- }
192
- // Function to generate allowed paths for current project and linked packages
193
- function generateAllowedPaths(projectRoot) {
194
- const allowedPaths = [
195
- searchForWorkspaceRoot(projectRoot),
196
- projectRoot,
197
- join(projectRoot, "node_modules"),
198
- join(projectRoot, "node_modules", "**"),
199
- ];
200
- // Read package.json to find linked packages
201
- const packageJsonPath = join(projectRoot, "package.json");
202
- try {
203
- if (fs.existsSync(packageJsonPath)) {
204
- const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
205
- const allDependencies = {
206
- ...(packageJson.dependencies || {}),
207
- ...(packageJson.devDependencies || {}),
208
- };
209
- Object.entries(allDependencies).forEach(([, version]) => {
210
- if (typeof version === "string" && version.startsWith("link:")) {
211
- const linkedPath = version.replace("link:", "");
212
- const absoluteLinkedPath = resolve(projectRoot, linkedPath);
213
- // Verify the linked path exists
214
- if (fs.existsSync(absoluteLinkedPath)) {
215
- // Allow the linked package root and its contents
216
- allowedPaths.push(absoluteLinkedPath);
217
- allowedPaths.push(join(absoluteLinkedPath, "**"));
218
- // Allow the linked package's node_modules
219
- const linkedNodeModules = join(absoluteLinkedPath, "node_modules");
220
- allowedPaths.push(linkedNodeModules);
221
- allowedPaths.push(join(linkedNodeModules, "**"));
222
- }
223
- }
224
- });
225
- }
226
- }
227
- catch (error) {
228
- console.warn("Failed to read package.json for linked packages:", error instanceof Error ? error.message : String(error));
229
- }
230
- // Remove duplicates
231
- const uniquePaths = [...new Set(allowedPaths)];
232
- return uniquePaths;
233
- }
234
- //# sourceMappingURL=server.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../connect-studio/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,kB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tD,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC/D,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;oBAChD,MAAM,kBAAkB,GAAG,OAAO,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;oBAE5D,gCAAgC;oBAChC,IAAI,EAAE,CAAC,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;wBACtC,iDAAiD;wBACjD,YAAY,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;wBACtC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC,CAAC;wBAElD,0CAA0C;wBAC1C,MAAM,iBAAiB,GAAG,IAAI,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAAC;wBACnE,YAAY,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;wBACrC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC,CAAC;oBACnD,CAAC;gBACH,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CACV,kDAAkD,EAClD,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACvD,CAAC;IACJ,CAAC;IAED,oBAAoB;IACpB,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;IAC/C,OAAO,WAAW,CAAC;AACrB,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { ConnectStudioOptions } from "./types.js";
2
- export declare function startConnectStudio(options: ConnectStudioOptions): Promise<void> | undefined;
3
- //# sourceMappingURL=studio.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"studio.d.ts","sourceRoot":"","sources":["../../connect-studio/studio.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAsB,MAAM,YAAY,CAAC;AAE3E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,oBAAoB,6BA8E/D"}
@@ -1,66 +0,0 @@
1
- import { dirname, isAbsolute, join } from "path";
2
- import { readJsonFile } from "../connect-utils/helpers.js";
3
- import { startServer } from "./server.js";
4
- export function startConnectStudio(options) {
5
- const serverOptions = {};
6
- if (options.port) {
7
- process.env.PORT = options.port;
8
- }
9
- if (options.host) {
10
- process.env.HOST = options.host.toString();
11
- }
12
- if (typeof options.open === "boolean") {
13
- serverOptions.open = options.open;
14
- }
15
- if (options.configFile) {
16
- const config = readJsonFile(options.configFile);
17
- if (!config)
18
- return;
19
- const configFileDir = dirname(options.configFile);
20
- if (config.packages && config.packages.length > 0) {
21
- serverOptions.packages = config.packages.map((p) => p.packageName);
22
- }
23
- if (config.documentModelsDir) {
24
- process.env.LOCAL_DOCUMENT_MODELS = isAbsolute(config.documentModelsDir)
25
- ? config.documentModelsDir
26
- : join(configFileDir, config.documentModelsDir);
27
- }
28
- if (config.editorsDir) {
29
- process.env.LOCAL_DOCUMENT_EDITORS = isAbsolute(config.editorsDir)
30
- ? config.editorsDir
31
- : join(configFileDir, config.editorsDir);
32
- }
33
- if (config.studio?.port) {
34
- process.env.PORT = config.studio.port.toString();
35
- }
36
- if (typeof config.studio?.openBrowser === "boolean") {
37
- process.env.OPEN_BROWSER = config.studio.openBrowser.toString();
38
- }
39
- if (config.studio?.host) {
40
- process.env.HOST = config.studio.host;
41
- }
42
- }
43
- if (options.packages && options.packages.length > 0) {
44
- serverOptions.packages = options.packages.map((p) => p.packageName);
45
- }
46
- if (options.https) {
47
- serverOptions.https = options.https;
48
- }
49
- if (options.phCliVersion) {
50
- serverOptions.phCliVersion = options.phCliVersion;
51
- }
52
- if (options.logLevel) {
53
- process.env.LOG_LEVEL = options.logLevel;
54
- serverOptions.logLevel = options.logLevel;
55
- }
56
- if (options.enableDocumentsHMR) {
57
- serverOptions.enableDocumentsHMR = options.enableDocumentsHMR;
58
- }
59
- if (options.disableDynamicLoading !== undefined) {
60
- serverOptions.disableDynamicLoading = options.disableDynamicLoading;
61
- }
62
- return startServer(serverOptions).catch((error) => {
63
- throw error;
64
- });
65
- }
66
- //# sourceMappingURL=studio.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"studio.js","sourceRoot":"","sources":["../../connect-studio/studio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,MAAM,UAAU,kBAAkB,CAAC,OAA6B;IAC9D,MAAM,aAAa,GAAuB,EAAE,CAAC;IAE7C,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAClC,CAAC;IAED,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC7C,CAAC;IAED,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACtC,aAAa,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IACpC,CAAC;IAED,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;QACvB,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAChD,IAAI,CAAC,MAAM;YAAE,OAAO;QAEpB,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAElD,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM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CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpD,aAAa,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IACtE,CAAC;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,aAAa,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IACtC,CAAC;IAED,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;QACzB,aAAa,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;IACpD,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC;QACzC,aAAa,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAC5C,CAAC;IAED,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAC/B,aAAa,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAChE,CAAC;IAED,IAAI,OAAO,CAAC,qBAAqB,KAAK,SAAS,EAAE,CAAC;QAChD,aAAa,CAAC,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IACtE,CAAC;IAED,OAAO,WAAW,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QAChD,MAAM,KAAK,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,28 +0,0 @@
1
- import type { LogLevel } from "@powerhousedao/config";
2
- export type ConnectStudioOptions = {
3
- connectPath?: string;
4
- port?: string;
5
- host?: boolean;
6
- https?: boolean;
7
- configFile?: string;
8
- open?: boolean;
9
- packages?: {
10
- packageName: string;
11
- }[];
12
- phCliVersion?: string;
13
- logLevel?: LogLevel;
14
- enableDocumentsHMR?: boolean;
15
- disableDynamicLoading?: boolean;
16
- };
17
- export type StartServerOptions = {
18
- connectPath?: string;
19
- configFile?: string;
20
- packages?: string[];
21
- https?: boolean;
22
- open?: boolean;
23
- phCliVersion?: string;
24
- logLevel?: LogLevel;
25
- enableDocumentsHMR?: boolean;
26
- disableDynamicLoading?: boolean;
27
- };
28
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../connect-studio/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../connect-studio/types.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- import type { ConnectBuildOptions } from "./types.js";
2
- export declare function buildConnect(options?: ConnectBuildOptions): Promise<void>;
3
- //# sourceMappingURL=build.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../connect-utils/build.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,wBAAsB,YAAY,CAAC,OAAO,GAAE,mBAAwB,iBAgCnE"}
@@ -1,21 +0,0 @@
1
- import { commonConnectOptionsToEnv, DEFAULT_CONNECT_OUTDIR, loadVite, resolveConnectPublicDir, resolveViteConfigPath, } from "./helpers.js";
2
- export async function buildConnect(options = {}) {
3
- const { mode = "production" } = options;
4
- commonConnectOptionsToEnv(options);
5
- const vite = await loadVite();
6
- const viteConfigPath = resolveViteConfigPath(options);
7
- const userViteConfig = await vite.loadConfigFromFile({ command: "build", mode }, viteConfigPath);
8
- const connectPublicDir = resolveConnectPublicDir(options.projectRoot);
9
- const buildConfig = {
10
- base: options.base,
11
- publicDir: connectPublicDir,
12
- mode,
13
- configFile: false,
14
- build: {
15
- outDir: options.outDir ?? DEFAULT_CONNECT_OUTDIR,
16
- },
17
- };
18
- const mergedConfig = vite.mergeConfig(userViteConfig?.config ?? {}, buildConfig);
19
- await vite.build(mergedConfig);
20
- }
21
- //# sourceMappingURL=build.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build.js","sourceRoot":"","sources":["../../connect-utils/build.ts"],"names":[],"mappings":"AACA,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACtB,QAAQ,EACR,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAGtB,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,UAA+B,EAAE;IAClE,MAAM,EAAE,IAAI,GAAG,YAAY,EAAE,GAAG,OAAO,CAAC;IAExC,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAEnC,MAAM,IAAI,GAAG,MAAM,QAAQ,EAAE,CAAC;IAE9B,MAAM,cAAc,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAEtD,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAClD,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,EAC1B,cAAc,CACf,CAAC;IAEF,MAAM,gBAAgB,GAAG,uBAAuB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAEtE,MAAM,WAAW,GAAiB;QAChC,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,SAAS,EAAE,gBAAgB;QAC3B,IAAI;QACJ,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE;YACL,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,sBAAsB;SACjD;KACF,CAAC;IAEF,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CACnC,cAAc,EAAE,MAAM,IAAI,EAAE,EAC5B,WAAW,CACZ,CAAC;IAEF,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AACjC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const EXTERNAL_PACKAGES_IMPORT = "PH:EXTERNAL_PACKAGES";
2
- export declare const IMPORT_SCRIPT_FILE = "external-packages.js";
3
- export declare const LOCAL_PACKAGE_ID = "ph:local-package";
4
- export declare const PH_DIR_NAME = ".ph";
5
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../connect-utils/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAC/D,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AACzD,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,WAAW,QAAQ,CAAC"}
@@ -1,5 +0,0 @@
1
- export const EXTERNAL_PACKAGES_IMPORT = "PH:EXTERNAL_PACKAGES";
2
- export const IMPORT_SCRIPT_FILE = "external-packages.js";
3
- export const LOCAL_PACKAGE_ID = "ph:local-package";
4
- export const PH_DIR_NAME = ".ph";
5
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../connect-utils/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAC/D,MAAM,CAAC,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AACzD,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AACnD,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC"}
@@ -1,48 +0,0 @@
1
- import type { PowerhouseConfig } from "@powerhousedao/config";
2
- import type { Plugin } from "vite";
3
- import type { ConnectCommonOptions } from "./types.js";
4
- export declare const DEFAULT_CONNECT_OUTDIR: ".ph/connect-build/dist/";
5
- export declare function loadVite(): Promise<typeof import("vite")>;
6
- export declare function commonConnectOptionsToEnv(options: ConnectCommonOptions): void;
7
- export declare function resolveViteConfigPath(options: Pick<ConnectCommonOptions, "projectRoot" | "viteConfigFile">): string;
8
- export declare function resolvePackage(packageName: string, root?: string): string;
9
- export declare function resolveConnectPackageJson(root?: string): JSON | null;
10
- /**
11
- * Finds the dist dir of Connect on the local machine
12
- */
13
- export declare function resolveConnectBundle(root?: string): string;
14
- export declare function resolveConnectPublicDir(root?: string): string;
15
- /**
16
- * Copies the Connect dist dir to the target path
17
- */
18
- export declare function copyConnect(sourcePath: string, targetPath: string): void;
19
- /**
20
- * Backs up the index.html file
21
- *
22
- * Needed when running the Connect Studio dev server on Windows
23
- */
24
- export declare function backupIndexHtml(appPath: string, restore?: boolean): void;
25
- export declare function removeBase64EnvValues(appPath: string): void;
26
- export declare function readJsonFile(filePath: string): PowerhouseConfig | null;
27
- /**
28
- * Takes a list of Powerhouse project packages and optionally local Powerhouse packages and outputs a js file which exports those packages for use in Connect Studio.
29
- */
30
- export declare function makeImportScriptFromPackages(args: {
31
- packages: string[];
32
- importStyles?: boolean;
33
- localJsPath?: string;
34
- localCssPath?: string;
35
- }): string;
36
- export declare function ensureNodeVersion(minVersion?: string): void;
37
- export declare function runShellScriptPlugin(scriptName: string, connectPath: string): Plugin;
38
- /**
39
- * Appends the contents to the <head> tag of the index.html file
40
- */
41
- export declare function appendToHtmlHead(pathToHtml: string, contents: string): Promise<void>;
42
- /**
43
- * Prepends the contents to the <head> tag of the index.html file
44
- */
45
- export declare function prependToHtmlHead(pathToHtml: string, contents: string): Promise<void>;
46
- export declare function runTsc(outDir: string): void;
47
- export declare function stripVersionFromPackage(packageName: string): string;
48
- //# sourceMappingURL=helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../connect-utils/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAO9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,eAAO,MAAM,sBAAsB,EAAG,yBAAkC,CAAC;AAEzE,wBAAsB,QAAQ,mCAU7B;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,oBAAoB,QAmCtE;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAAE,aAAa,GAAG,gBAAgB,CAAC,UAItE;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,SAAgB,UAIvE;AAED,wBAAgB,yBAAyB,CAAC,IAAI,SAAgB,eAY7D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,SAAgB,UAOxD;AAED,wBAAgB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