@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,265 +0,0 @@
1
- import { exec, execSync } from "node:child_process";
2
- import fs, { existsSync } from "node:fs";
3
- import { readFile, writeFile } from "node:fs/promises";
4
- import { createRequire } from "node:module";
5
- import path, { join, resolve } from "node:path";
6
- import { cwd } from "node:process";
7
- import { LOCAL_PACKAGE_ID } from "./constants.js";
8
- import { setConnectEnv } from "@powerhousedao/shared/connect";
9
- export const DEFAULT_CONNECT_OUTDIR = ".ph/connect-build/dist/";
10
- export async function loadVite() {
11
- try {
12
- return await import("vite");
13
- }
14
- catch (error) {
15
- const viteError = new Error("Could not load 'vite'. Is it installed in your project?");
16
- throw viteError;
17
- }
18
- }
19
- export function commonConnectOptionsToEnv(options) {
20
- const { base, configFile, defaultDrivesUrl, drivesPreserveStrategy, disableLocalPackage, } = options;
21
- if (base) {
22
- setConnectEnv({
23
- PH_CONNECT_BASE_PATH: base,
24
- });
25
- }
26
- if (configFile) {
27
- setConnectEnv({
28
- PH_CONFIG_PATH: configFile,
29
- });
30
- }
31
- if (defaultDrivesUrl) {
32
- setConnectEnv({
33
- PH_CONNECT_DEFAULT_DRIVES_URL: defaultDrivesUrl.join(","),
34
- });
35
- }
36
- if (drivesPreserveStrategy) {
37
- setConnectEnv({
38
- PH_CONNECT_DRIVES_PRESERVE_STRATEGY: drivesPreserveStrategy,
39
- });
40
- }
41
- if (disableLocalPackage) {
42
- setConnectEnv({
43
- PH_DISABLE_LOCAL_PACKAGE: true,
44
- });
45
- }
46
- }
47
- export function resolveViteConfigPath(options) {
48
- const { projectRoot = cwd(), viteConfigFile } = options;
49
- return viteConfigFile || join(projectRoot, "vite.config.ts");
50
- }
51
- export function resolvePackage(packageName, root = process.cwd()) {
52
- // find connect installation
53
- const require = createRequire(root);
54
- return require.resolve(packageName, { paths: [root] });
55
- }
56
- export function resolveConnectPackageJson(root = process.cwd()) {
57
- try {
58
- const connectPackageJsonPath = resolvePackage("@powerhousedao/connect/package.json", root);
59
- const fileContents = fs.readFileSync(connectPackageJsonPath, "utf-8");
60
- return JSON.parse(fileContents);
61
- }
62
- catch (error) {
63
- console.error(`Error reading Connect package.json:`, error);
64
- return null;
65
- }
66
- }
67
- /**
68
- * Finds the dist dir of Connect on the local machine
69
- */
70
- export function resolveConnectBundle(root = process.cwd()) {
71
- const connectIndexPath = resolvePackage("@powerhousedao/connect", root);
72
- const connectRootPath = connectIndexPath.substring(0, connectIndexPath.indexOf("connect") + "connect".length);
73
- return join(connectRootPath, "dist/");
74
- }
75
- export function resolveConnectPublicDir(root = process.cwd()) {
76
- const connectIconPath = resolvePackage("@powerhousedao/connect/public/icon.ico", root);
77
- return path.join(connectIconPath, "../");
78
- }
79
- /**
80
- * Copies the Connect dist dir to the target path
81
- */
82
- export function copyConnect(sourcePath, targetPath) {
83
- try {
84
- // Ensure targetPath is removed before copying
85
- fs.rmSync(targetPath, { recursive: true, force: true });
86
- // Copy everything from sourcePath to targetPath
87
- fs.cpSync(sourcePath, targetPath, { recursive: true });
88
- }
89
- catch (error) {
90
- console.error(`❌ Error copying ${sourcePath} to ${targetPath}:`, error);
91
- }
92
- }
93
- /**
94
- * Backs up the index.html file
95
- *
96
- * Needed when running the Connect Studio dev server on Windows
97
- */
98
- export function backupIndexHtml(appPath, restore = false) {
99
- const filePath = join(appPath, "index.html");
100
- const backupPath = join(appPath, "index.html.bak");
101
- const paths = restore ? [backupPath, filePath] : [filePath, backupPath];
102
- if (fs.existsSync(paths[0])) {
103
- fs.copyFileSync(paths[0], paths[1]);
104
- }
105
- }
106
- export function removeBase64EnvValues(appPath) {
107
- backupIndexHtml(appPath);
108
- const filePath = join(appPath, "index.html");
109
- // Read the HTML file
110
- fs.readFile(filePath, "utf-8", (err, data) => {
111
- if (err) {
112
- console.error("Error reading file:", err);
113
- return;
114
- }
115
- // Use regex to replace the dynamic Base64 values with empty strings
116
- // TODO is this needed?
117
- const modifiedData = data
118
- .replace(/"LOCAL_DOCUMENT_MODELS":\s*".*?",/, `"LOCAL_DOCUMENT_MODELS": "",`)
119
- .replace(/"LOCAL_DOCUMENT_EDITORS":\s*".*?"/, `"LOCAL_DOCUMENT_EDITORS": ""`);
120
- console.log("Modified data:", modifiedData);
121
- // Write the modified content back to the file
122
- fs.writeFile(filePath, modifiedData, "utf-8", (err) => {
123
- if (err) {
124
- console.error("Error writing file:", err);
125
- return;
126
- }
127
- });
128
- });
129
- }
130
- export function readJsonFile(filePath) {
131
- try {
132
- const absolutePath = resolve(filePath);
133
- const fileContents = fs.readFileSync(absolutePath, "utf-8");
134
- return JSON.parse(fileContents);
135
- }
136
- catch (error) {
137
- console.error(`Error reading file: ${filePath}`);
138
- return null;
139
- }
140
- }
141
- /**
142
- * 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.
143
- */
144
- export function makeImportScriptFromPackages(args) {
145
- const { packages, localJsPath, localCssPath, importStyles = true } = args;
146
- const imports = [];
147
- const moduleNames = [];
148
- let counter = 0;
149
- for (const packageName of packages) {
150
- const moduleName = `module${counter}`;
151
- moduleNames.push(moduleName);
152
- imports.push(`import * as ${moduleName} from '${packageName}';`);
153
- if (importStyles) {
154
- imports.push(`import '${packageName}/style.css';`);
155
- }
156
- counter++;
157
- }
158
- const exports = moduleNames.map((name, index) => `{
159
- id: "${packages[index]}",
160
- ...${name},
161
- }`);
162
- const hasModule = localJsPath !== undefined;
163
- const hasStyles = importStyles && localCssPath !== undefined;
164
- const hasLocalPackage = hasModule || hasStyles;
165
- if (hasLocalPackage) {
166
- if (hasStyles) {
167
- imports.push(`import '${localCssPath}';`);
168
- }
169
- if (hasModule) {
170
- const moduleName = `module${counter}`;
171
- imports.push(`import * as ${moduleName} from '${localJsPath}';`);
172
- exports.push(`{
173
- id: "${LOCAL_PACKAGE_ID}",
174
- ...${moduleName},
175
- }`);
176
- }
177
- }
178
- const exportsString = exports.length
179
- ? `
180
- ${exports.join(",\n")}
181
- `
182
- : "";
183
- const exportStatement = `export default [${exportsString}];`;
184
- const fileContent = `${imports.join("\n")}\n\n${exportStatement}`;
185
- return fileContent;
186
- }
187
- export function ensureNodeVersion(minVersion = "24") {
188
- const version = process.versions.node;
189
- if (!version) {
190
- return;
191
- }
192
- if (version < minVersion) {
193
- console.error(`Node version ${minVersion} or higher is required. Current version: ${version}`);
194
- process.exit(1);
195
- }
196
- }
197
- export function runShellScriptPlugin(scriptName, connectPath) {
198
- return {
199
- name: "vite-plugin-run-shell-script",
200
- buildStart() {
201
- const scriptPath = join(connectPath, scriptName);
202
- if (fs.existsSync(scriptPath)) {
203
- exec(`sh ${scriptPath}`, (error, stdout, stderr) => {
204
- if (error) {
205
- console.error(`Error executing the script: ${error.message}`);
206
- removeBase64EnvValues(connectPath);
207
- return;
208
- }
209
- if (stderr) {
210
- console.error(stderr);
211
- }
212
- });
213
- }
214
- },
215
- };
216
- }
217
- /**
218
- * Shared helper to modify the <head> tag of an HTML file by transforming its contents.
219
- */
220
- async function modifyHtmlHead(pathToHtml, contents, transform) {
221
- if (!existsSync(pathToHtml)) {
222
- throw new Error(`File ${pathToHtml} does not exist.`);
223
- }
224
- let html = await readFile(pathToHtml, "utf8");
225
- html = transform(html, contents);
226
- await writeFile(pathToHtml, html, "utf8");
227
- }
228
- /**
229
- * Appends the contents to the <head> tag of the index.html file
230
- */
231
- export async function appendToHtmlHead(pathToHtml, contents) {
232
- return modifyHtmlHead(pathToHtml, contents, (html, contents) => {
233
- if (!html.includes("</head>")) {
234
- throw new Error("No </head> tag found in the HTML file.");
235
- }
236
- return html.replace("</head>", `\n${contents}\n</head>`);
237
- });
238
- }
239
- /**
240
- * Prepends the contents to the <head> tag of the index.html file
241
- */
242
- export async function prependToHtmlHead(pathToHtml, contents) {
243
- return modifyHtmlHead(pathToHtml, contents, (html, contents) => {
244
- if (!html.includes("</head>")) {
245
- throw new Error("No </head> tag found in the HTML file.");
246
- }
247
- return html.replace("<head>", `<head>\n${contents}\n`);
248
- });
249
- }
250
- export function runTsc(outDir) {
251
- execSync(`npx tsc --outDir ${outDir}`, { stdio: "inherit" });
252
- }
253
- // Helper function to remove version suffix from package name
254
- // Handles formats like: @scope/package@version -> @scope/package
255
- export function stripVersionFromPackage(packageName) {
256
- const trimmed = packageName.trim();
257
- if (!trimmed)
258
- return "";
259
- const lastAtIndex = trimmed.lastIndexOf("@");
260
- if (lastAtIndex > 0) {
261
- return trimmed.substring(0, lastAtIndex);
262
- }
263
- return trimmed;
264
- }
265
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../connect-utils/helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,gBAA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C,QAAQ,EAAE,WAAW,QAAQ,IAAI,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,MAAc;IACnC,QAAQ,CAAC,oBAAoB,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AAC/D,CAAC;AAED,6DAA6D;AAC7D,iEAAiE;AACjE,MAAM,UAAU,uBAAuB,CAAC,WAAmB;IACzD,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;IACnC,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IACxB,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC7C,IAAI,WAAW,GAAG,CAAC,EAAE,CAAC;QACpB,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1,15 +0,0 @@
1
- export * from "./build.js";
2
- export * from "./constants.js";
3
- export * from "./helpers.js";
4
- export * from "./preview.js";
5
- export * from "./studio.js";
6
- export * from "./types.js";
7
- export * from "./vite-config.js";
8
- export * from "./vite-plugins/base.js";
9
- export * from "./vite-plugins/document-models-hmr.js";
10
- export * from "./vite-plugins/editors-hmr.js";
11
- export * from "./vite-plugins/external-packages.js";
12
- export * from "./vite-plugins/importmap.js";
13
- export * from "./vite-plugins/ph-external-packages.js";
14
- export * from "./vite-plugins/studio.js";
15
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../connect-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,0BAA0B,CAAC"}
@@ -1,15 +0,0 @@
1
- export * from "./build.js";
2
- export * from "./constants.js";
3
- export * from "./helpers.js";
4
- export * from "./preview.js";
5
- export * from "./studio.js";
6
- export * from "./types.js";
7
- export * from "./vite-config.js";
8
- export * from "./vite-plugins/base.js";
9
- export * from "./vite-plugins/document-models-hmr.js";
10
- export * from "./vite-plugins/editors-hmr.js";
11
- export * from "./vite-plugins/external-packages.js";
12
- export * from "./vite-plugins/importmap.js";
13
- export * from "./vite-plugins/ph-external-packages.js";
14
- export * from "./vite-plugins/studio.js";
15
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../connect-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,0BAA0B,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { ConnectPreviewOptions } from "./types.js";
2
- export declare function previewConnect(options?: ConnectPreviewOptions): Promise<void>;
3
- //# sourceMappingURL=preview.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../connect-utils/preview.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,wBAAsB,cAAc,CAAC,OAAO,GAAE,qBAA0B,iBA6CvE"}
@@ -1,33 +0,0 @@
1
- import { commonConnectOptionsToEnv, DEFAULT_CONNECT_OUTDIR, loadVite, resolveConnectPublicDir, resolveViteConfigPath, } from "./helpers.js";
2
- export async function previewConnect(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 previewConfig = {
10
- base: options.base,
11
- publicDir: connectPublicDir,
12
- mode,
13
- configFile: false,
14
- build: {
15
- outDir: options.outDir ?? DEFAULT_CONNECT_OUTDIR,
16
- },
17
- preview: {
18
- port: options.port,
19
- strictPort: options.strictPort,
20
- host: options.host,
21
- open: options.open,
22
- },
23
- };
24
- const mergedConfig = vite.mergeConfig(userViteConfig?.config ?? {}, previewConfig);
25
- const server = await vite.preview(mergedConfig);
26
- if (options.printUrls !== false) {
27
- server.printUrls();
28
- }
29
- if (options.bindCLIShortcuts !== false) {
30
- server.bindCLIShortcuts();
31
- }
32
- }
33
- //# sourceMappingURL=preview.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"preview.js","sourceRoot":"","sources":["../../connect-utils/preview.ts"],"names":[],"mappings":"AACA,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACtB,QAAQ,EACR,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAGtB,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,UAAiC,EAAE;IACtE,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,aAAa,GAAiB;QAClC,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;QACD,OAAO,EAAE;YACP,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB;KACF,CAAC;IAEF,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CACnC,cAAc,EAAE,MAAM,IAAI,EAAE,EAC5B,aAAa,CACd,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAEhD,IAAI,OAAO,CAAC,SAAS,KAAK,KAAK,EAAE,CAAC;QAChC,MAAM,CAAC,SAAS,EAAE,CAAC;IACrB,CAAC;IACD,IAAI,OAAO,CAAC,gBAAgB,KAAK,KAAK,EAAE,CAAC;QACvC,MAAM,CAAC,gBAAgB,EAAE,CAAC;IAC5B,CAAC;AACH,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { ConnectStudioOptions } from "./types.js";
2
- export declare const ConnectStudioDefaultOptions: {
3
- readonly printUrls: true;
4
- readonly bindCLIShortcuts: true;
5
- };
6
- export declare function startConnectStudio(options?: ConnectStudioOptions): Promise<void>;
7
- //# sourceMappingURL=studio.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"studio.d.ts","sourceRoot":"","sources":["../../connect-utils/studio.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,eAAO,MAAM,2BAA2B;;;CAGC,CAAC;AAE1C,wBAAsB,kBAAkB,CACtC,OAAO,GAAE,oBAAkD,iBA0C5D"}
@@ -1,30 +0,0 @@
1
- import { commonConnectOptionsToEnv, loadVite, resolveConnectPublicDir, resolveViteConfigPath, } from "./helpers.js";
2
- export const ConnectStudioDefaultOptions = {
3
- printUrls: true,
4
- bindCLIShortcuts: true,
5
- };
6
- export async function startConnectStudio(options = ConnectStudioDefaultOptions) {
7
- const { mode = "development", printUrls, bindCLIShortcuts, devServerOptions, } = {
8
- ...ConnectStudioDefaultOptions,
9
- ...options,
10
- };
11
- commonConnectOptionsToEnv(options);
12
- const vite = await loadVite();
13
- const viteConfigPath = resolveViteConfigPath(options);
14
- const userViteConfig = await vite.loadConfigFromFile({ command: "serve", mode }, viteConfigPath);
15
- const connectPublicDir = resolveConnectPublicDir(options.projectRoot);
16
- const devServerConfig = {
17
- mode,
18
- configFile: false,
19
- publicDir: connectPublicDir,
20
- server: devServerOptions,
21
- };
22
- const mergedConfig = vite.mergeConfig(userViteConfig?.config ?? {}, devServerConfig);
23
- const server = await vite.createServer(mergedConfig);
24
- await server.listen();
25
- if (printUrls)
26
- server.printUrls();
27
- if (bindCLIShortcuts)
28
- server.bindCLIShortcuts({ print: true });
29
- }
30
- //# sourceMappingURL=studio.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"studio.js","sourceRoot":"","sources":["../../connect-utils/studio.ts"],"names":[],"mappings":"AACA,OAAO,EACL,yBAAyB,EACzB,QAAQ,EACR,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAGtB,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,SAAS,EAAE,IAAI;IACf,gBAAgB,EAAE,IAAI;CACiB,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,UAAgC,2BAA2B;IAE3D,MAAM,EACJ,IAAI,GAAG,aAAa,EACpB,SAAS,EACT,gBAAgB,EAChB,gBAAgB,GACjB,GAAG;QACF,GAAG,2BAA2B;QAC9B,GAAG,OAAO;KACX,CAAC;IAEF,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAEnC,MAAM,IAAI,GAAG,MAAM,QAAQ,EAAE,CAAC;IAE9B,MAAM,cAAc,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;IACtD,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,eAAe,GAAiB;QACpC,IAAI;QACJ,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE,gBAAgB;QAC3B,MAAM,EAAE,gBAAgB;KACzB,CAAC;IAEF,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CACnC,cAAc,EAAE,MAAM,IAAI,EAAE,EAC5B,eAAe,CAChB,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IAErD,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC;IAEtB,IAAI,SAAS;QAAE,MAAM,CAAC,SAAS,EAAE,CAAC;IAClC,IAAI,gBAAgB;QAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AACjE,CAAC"}
@@ -1,37 +0,0 @@
1
- import type { PowerhouseConfig } from "@powerhousedao/config";
2
- import type { CommonServerOptions } from "vite";
3
- export type IConnectOptions = {
4
- mode: string;
5
- dirname: string;
6
- envDir?: string;
7
- powerhouseConfig?: PowerhouseConfig;
8
- localPackage?: string | false;
9
- watchTimeout?: number;
10
- };
11
- export type ConnectCommonOptions = {
12
- base?: string;
13
- mode?: string;
14
- configFile?: string;
15
- projectRoot?: string;
16
- viteConfigFile?: string;
17
- disableLocalPackage?: boolean;
18
- defaultDrivesUrl?: string[];
19
- drivesPreserveStrategy?: "preserve-all" | "preserve-by-url-and-detach";
20
- };
21
- export type ViteDevOptions = Pick<CommonServerOptions, "port" | "host" | "open" | "cors" | "strictPort"> & {
22
- force?: boolean;
23
- };
24
- export type ConnectStudioOptions = ConnectCommonOptions & {
25
- devServerOptions?: ViteDevOptions;
26
- printUrls?: boolean;
27
- bindCLIShortcuts?: boolean;
28
- };
29
- export type ConnectBuildOptions = ConnectCommonOptions & {
30
- outDir?: string;
31
- };
32
- export type ConnectPreviewOptions = ConnectCommonOptions & Omit<ViteDevOptions, "cors"> & {
33
- outDir?: string;
34
- printUrls?: boolean;
35
- bindCLIShortcuts?: boolean;
36
- };
37
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../connect-utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAEhD,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAEjC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE5B,sBAAsB,CAAC,EAAE,cAAc,GAAG,4BAA4B,CAAC;CACxE,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,mBAAmB,EACnB,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CACjD,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAExB,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,GAAG;IACxD,gBAAgB,CAAC,EAAE,cAAc,CAAC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,GAAG;IAEvD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,GACtD,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG;IAE7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../connect-utils/types.ts"],"names":[],"mappings":""}
@@ -1,61 +0,0 @@
1
- import { type UserConfig } from "vite";
2
- import type { IConnectOptions } from "./types.js";
3
- export declare const connectClientConfig: {
4
- readonly meta: readonly [{
5
- readonly tag: "meta";
6
- readonly attrs: {
7
- readonly property: "og:title";
8
- readonly content: "Connect";
9
- };
10
- }, {
11
- readonly tag: "meta";
12
- readonly attrs: {
13
- readonly property: "og:type";
14
- readonly content: "website";
15
- };
16
- }, {
17
- readonly tag: "meta";
18
- readonly attrs: {
19
- readonly property: "og:url";
20
- readonly content: "https://apps.powerhouse.io/powerhouse/connect/";
21
- };
22
- }, {
23
- readonly tag: "meta";
24
- readonly attrs: {
25
- readonly property: "og:description";
26
- readonly content: "Navigate your organisation’s toughest operational challenges and steer your contributors to success with Connect. A navigation, collaboration and reporting tool for decentralised and open organisation.";
27
- };
28
- }, {
29
- readonly tag: "meta";
30
- readonly attrs: {
31
- readonly property: "og:image";
32
- readonly content: "https://cf-ipfs.com/ipfs/bafkreigrmclndf2jpbolaq22535q2sw5t44uad3az3dpvkzrnt4lpjt63e";
33
- };
34
- }, {
35
- readonly tag: "meta";
36
- readonly attrs: {
37
- readonly name: "twitter:card";
38
- readonly content: "summary_large_image";
39
- };
40
- }, {
41
- readonly tag: "meta";
42
- readonly attrs: {
43
- readonly name: "twitter:image";
44
- readonly content: "https://cf-ipfs.com/ipfs/bafkreigrmclndf2jpbolaq22535q2sw5t44uad3az3dpvkzrnt4lpjt63e";
45
- };
46
- }, {
47
- readonly tag: "meta";
48
- readonly attrs: {
49
- readonly name: "twitter:title";
50
- readonly content: "Connect";
51
- };
52
- }, {
53
- readonly tag: "meta";
54
- readonly attrs: {
55
- readonly name: "twitter:description";
56
- readonly content: "Navigate your organisation’s toughest operational challenges and steer your contributors to success with Connect. A navigation, collaboration and reporting tool for decentralised and open organisation.";
57
- };
58
- }];
59
- };
60
- export declare function getConnectBaseViteConfig(options: IConnectOptions): UserConfig;
61
- //# sourceMappingURL=vite-config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vite-config.d.ts","sourceRoot":"","sources":["../../connect-utils/vite-config.ts"],"names":[],"mappings":"AAMA,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,MAAM,CAAC;AAcd,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsEtB,CAAC;AAiDX,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,eAAe,cAgMhE"}