@powerhousedao/builder-tools 6.0.2-staging.2 → 6.0.2-staging.4
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/index.d.mts +175 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +628 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +14 -23
- package/dist/bundle.d.ts +0 -2
- package/dist/bundle.d.ts.map +0 -1
- package/dist/connect-utils/build.d.ts +0 -3
- package/dist/connect-utils/build.d.ts.map +0 -1
- package/dist/connect-utils/constants.d.ts +0 -5
- package/dist/connect-utils/constants.d.ts.map +0 -1
- package/dist/connect-utils/helpers.d.ts +0 -48
- package/dist/connect-utils/helpers.d.ts.map +0 -1
- package/dist/connect-utils/index.d.ts +0 -15
- package/dist/connect-utils/index.d.ts.map +0 -1
- package/dist/connect-utils/preview.d.ts +0 -3
- package/dist/connect-utils/preview.d.ts.map +0 -1
- package/dist/connect-utils/studio.d.ts +0 -7
- package/dist/connect-utils/studio.d.ts.map +0 -1
- package/dist/connect-utils/types.d.ts +0 -37
- package/dist/connect-utils/types.d.ts.map +0 -1
- package/dist/connect-utils/vite-config.d.ts +0 -61
- package/dist/connect-utils/vite-config.d.ts.map +0 -1
- package/dist/connect-utils/vite-plugins/base.d.ts +0 -10
- package/dist/connect-utils/vite-plugins/base.d.ts.map +0 -1
- package/dist/connect-utils/vite-plugins/document-models-hmr.d.ts +0 -3
- package/dist/connect-utils/vite-plugins/document-models-hmr.d.ts.map +0 -1
- package/dist/connect-utils/vite-plugins/editors-hmr.d.ts +0 -3
- package/dist/connect-utils/vite-plugins/editors-hmr.d.ts.map +0 -1
- package/dist/connect-utils/vite-plugins/external-packages.d.ts +0 -3
- package/dist/connect-utils/vite-plugins/external-packages.d.ts.map +0 -1
- package/dist/connect-utils/vite-plugins/importmap.d.ts +0 -23
- package/dist/connect-utils/vite-plugins/importmap.d.ts.map +0 -1
- package/dist/connect-utils/vite-plugins/ph-external-packages.d.ts +0 -2
- package/dist/connect-utils/vite-plugins/ph-external-packages.d.ts.map +0 -1
- package/dist/connect-utils/vite-plugins/studio.d.ts +0 -3
- package/dist/connect-utils/vite-plugins/studio.d.ts.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -111943
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../connect-utils/constants.ts","../connect-utils/helpers.ts","../connect-utils/vite-plugins/dev-external-react.ts","../connect-utils/vite-plugins/favicon.ts","../connect-utils/vite-plugins/ph-bundled-packages.ts","../connect-utils/vite-plugins/ph-packages.ts","../connect-utils/vite-config.ts"],"sourcesContent":["export const EXTERNAL_PACKAGES_IMPORT = \"PH:EXTERNAL_PACKAGES\";\nexport const IMPORT_SCRIPT_FILE = \"external-packages.js\";\nexport const LOCAL_PACKAGE_ID = \"ph:local-package\";\nexport const PH_DIR_NAME = \".ph\";\n","import type { PowerhouseConfig } from \"@powerhousedao/config\";\nimport { exec, execSync } from \"node:child_process\";\nimport fs, { existsSync } from \"node:fs\";\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\nimport path, { join, resolve } from \"node:path\";\nimport { cwd } from \"node:process\";\nimport type { Plugin } from \"vite\";\nimport { LOCAL_PACKAGE_ID } from \"./constants.js\";\nimport { setConnectEnv } from \"@powerhousedao/shared/connect\";\nimport type { ConnectCommonOptions } from \"./types.js\";\n\nexport const DEFAULT_CONNECT_OUTDIR = \".ph/connect-build/dist/\" as const;\n\nexport function commonConnectOptionsToEnv(options: ConnectCommonOptions) {\n const {\n base,\n configFile,\n defaultDrivesUrl,\n drivesPreserveStrategy,\n disableLocalPackage,\n } = options;\n\n if (base) {\n setConnectEnv({\n PH_CONNECT_BASE_PATH: base,\n });\n }\n\n if (configFile) {\n setConnectEnv({\n PH_CONFIG_PATH: configFile,\n });\n }\n if (defaultDrivesUrl) {\n setConnectEnv({\n PH_CONNECT_DEFAULT_DRIVES_URL: defaultDrivesUrl.join(\",\"),\n });\n }\n if (drivesPreserveStrategy) {\n setConnectEnv({\n PH_CONNECT_DRIVES_PRESERVE_STRATEGY: drivesPreserveStrategy,\n });\n }\n if (disableLocalPackage) {\n setConnectEnv({\n PH_DISABLE_LOCAL_PACKAGE: true,\n });\n }\n}\n\nexport function resolveViteConfigPath(\n options: Pick<ConnectCommonOptions, \"projectRoot\" | \"viteConfigFile\">,\n) {\n const { projectRoot = cwd(), viteConfigFile } = options;\n return viteConfigFile || join(projectRoot, \"vite.config.ts\");\n}\n\nexport function resolvePackage(packageName: string, root = process.cwd()) {\n // find connect installation\n const require = createRequire(root);\n return require.resolve(packageName, { paths: [root] });\n}\n\nexport function resolveConnectPackageJson(root = process.cwd()) {\n try {\n const connectPackageJsonPath = resolvePackage(\n \"@powerhousedao/connect/package.json\",\n root,\n );\n const fileContents = fs.readFileSync(connectPackageJsonPath, \"utf-8\");\n return JSON.parse(fileContents) as JSON;\n } catch (error) {\n console.error(`Error reading Connect package.json:`, error);\n return null;\n }\n}\n\n/**\n * Finds the dist dir of Connect on the local machine\n */\nexport function resolveConnectBundle(root = process.cwd()) {\n const connectIndexPath = resolvePackage(\"@powerhousedao/connect\", root);\n const connectRootPath = connectIndexPath.substring(\n 0,\n connectIndexPath.indexOf(\"connect\") + \"connect\".length,\n );\n return join(connectRootPath, \"dist/\");\n}\n\nexport function resolveConnectPublicDir(root = process.cwd()) {\n const connectIconPath = resolvePackage(\n \"@powerhousedao/connect/public/icon.ico\",\n root,\n );\n return path.join(connectIconPath, \"../\");\n}\n\n/**\n * Copies the Connect dist dir to the target path\n */\nexport function copyConnect(sourcePath: string, targetPath: string) {\n try {\n // Ensure targetPath is removed before copying\n fs.rmSync(targetPath, { recursive: true, force: true });\n\n // Copy everything from sourcePath to targetPath\n fs.cpSync(sourcePath, targetPath, { recursive: true });\n } catch (error) {\n console.error(`❌ Error copying ${sourcePath} to ${targetPath}:`, error);\n }\n}\n\n/**\n * Backs up the index.html file\n *\n * Needed when running the Connect Studio dev server on Windows\n */\nexport function backupIndexHtml(appPath: string, restore = false) {\n const filePath = join(appPath, \"index.html\");\n const backupPath = join(appPath, \"index.html.bak\");\n\n const paths = restore ? [backupPath, filePath] : [filePath, backupPath];\n\n if (fs.existsSync(paths[0])) {\n fs.copyFileSync(paths[0], paths[1]);\n }\n}\n\nexport function removeBase64EnvValues(appPath: string) {\n backupIndexHtml(appPath);\n\n const filePath = join(appPath, \"index.html\");\n\n // Read the HTML file\n fs.readFile(filePath, \"utf-8\", (err, data) => {\n if (err) {\n console.error(\"Error reading file:\", err);\n return;\n }\n\n // Use regex to replace the dynamic Base64 values with empty strings\n // TODO is this needed?\n const modifiedData = data\n .replace(\n /\"LOCAL_DOCUMENT_MODELS\":\\s*\".*?\",/,\n `\"LOCAL_DOCUMENT_MODELS\": \"\",`,\n )\n .replace(\n /\"LOCAL_DOCUMENT_EDITORS\":\\s*\".*?\"/,\n `\"LOCAL_DOCUMENT_EDITORS\": \"\"`,\n );\n\n console.log(\"Modified data:\", modifiedData);\n // Write the modified content back to the file\n fs.writeFile(filePath, modifiedData, \"utf-8\", (err) => {\n if (err) {\n console.error(\"Error writing file:\", err);\n return;\n }\n });\n });\n}\n\nexport function readJsonFile(filePath: string): PowerhouseConfig | null {\n try {\n const absolutePath = resolve(filePath);\n const fileContents = fs.readFileSync(absolutePath, \"utf-8\");\n return JSON.parse(fileContents) as PowerhouseConfig;\n } catch (error) {\n console.error(`Error reading file: ${filePath}`);\n return null;\n }\n}\n\n/**\n * 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.\n */\nexport function makeImportScriptFromPackages(args: {\n packages: string[];\n importStyles?: boolean;\n localJsPath?: string;\n localCssPath?: string;\n}) {\n const { packages, localJsPath, localCssPath, importStyles = true } = args;\n const imports: string[] = [];\n const moduleNames: string[] = [];\n let counter = 0;\n\n for (const packageName of packages) {\n const moduleName = `module${counter}`;\n moduleNames.push(moduleName);\n imports.push(`import * as ${moduleName} from '${packageName}';`);\n if (importStyles) {\n imports.push(`import '${packageName}/style.css';`);\n }\n counter++;\n }\n\n const exports = moduleNames.map(\n (name, index) => `{\n id: \"${packages[index]}\",\n ...${name},\n }`,\n );\n\n const hasModule = localJsPath !== undefined;\n const hasStyles = importStyles && localCssPath !== undefined;\n const hasLocalPackage = hasModule || hasStyles;\n\n if (hasLocalPackage) {\n if (hasStyles) {\n imports.push(`import '${localCssPath}';`);\n }\n if (hasModule) {\n const moduleName = `module${counter}`;\n imports.push(`import * as ${moduleName} from '${localJsPath}';`);\n exports.push(`{\n id: \"${LOCAL_PACKAGE_ID}\",\n ...${moduleName},\n }`);\n }\n }\n const exportsString = exports.length\n ? `\n ${exports.join(\",\\n\")}\n `\n : \"\";\n\n const exportStatement = `export default [${exportsString}];`;\n\n const fileContent = `${imports.join(\"\\n\")}\\n\\n${exportStatement}`;\n\n return fileContent;\n}\n\nexport function ensureNodeVersion(minVersion = \"24\") {\n const version = process.versions.node;\n if (!version) {\n return;\n }\n\n if (version < minVersion) {\n console.error(\n `Node version ${minVersion} or higher is required. Current version: ${version}`,\n );\n process.exit(1);\n }\n}\n\nexport function runShellScriptPlugin(\n scriptName: string,\n connectPath: string,\n): Plugin {\n return {\n name: \"vite-plugin-run-shell-script\",\n buildStart() {\n const scriptPath = join(connectPath, scriptName);\n if (fs.existsSync(scriptPath)) {\n exec(`sh ${scriptPath}`, (error, stdout, stderr) => {\n if (error) {\n console.error(`Error executing the script: ${error.message}`);\n removeBase64EnvValues(connectPath);\n return;\n }\n if (stderr) {\n console.error(stderr);\n }\n });\n }\n },\n };\n}\n\n/**\n * Shared helper to modify the <head> tag of an HTML file by transforming its contents.\n */\nasync function modifyHtmlHead(\n pathToHtml: string,\n contents: string,\n transform: (html: string, contents: string) => string,\n) {\n if (!existsSync(pathToHtml)) {\n throw new Error(`File ${pathToHtml} does not exist.`);\n }\n let html = await readFile(pathToHtml, \"utf8\");\n html = transform(html, contents);\n await writeFile(pathToHtml, html, \"utf8\");\n}\n\n/**\n * Appends the contents to the <head> tag of the index.html file\n */\nexport async function appendToHtmlHead(pathToHtml: string, contents: string) {\n return modifyHtmlHead(pathToHtml, contents, (html, contents) => {\n if (!html.includes(\"</head>\")) {\n throw new Error(\"No </head> tag found in the HTML file.\");\n }\n return html.replace(\"</head>\", `\\n${contents}\\n</head>`);\n });\n}\n\n/**\n * Prepends the contents to the <head> tag of the index.html file\n */\nexport async function prependToHtmlHead(pathToHtml: string, contents: string) {\n return modifyHtmlHead(pathToHtml, contents, (html, contents) => {\n if (!html.includes(\"</head>\")) {\n throw new Error(\"No </head> tag found in the HTML file.\");\n }\n return html.replace(\"<head>\", `<head>\\n${contents}\\n`);\n });\n}\n\nexport function runTsc(outDir: string) {\n execSync(`npx tsc --outDir ${outDir}`, { stdio: \"inherit\" });\n}\n\n// Helper function to remove version suffix from package name\n// Handles formats like: @scope/package@version -> @scope/package\nexport function stripVersionFromPackage(packageName: string): string {\n const trimmed = packageName.trim();\n if (!trimmed) return \"\";\n const lastAtIndex = trimmed.lastIndexOf(\"@\");\n if (lastAtIndex > 0) {\n return trimmed.substring(0, lastAtIndex);\n }\n\n return trimmed;\n}\n","import { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport type { Plugin } from \"vite\";\n\nconst REACT_DEPS = [\n \"react\",\n \"react-dom\",\n \"react/jsx-runtime\",\n \"react/jsx-dev-runtime\",\n \"react-dom/client\",\n];\n\nconst SHIM_PREFIX = \"/__ph/dev-react-shim/\";\nconst VITE_DEPS_PREFIX = \"/node_modules/.vite/deps\";\n\n/**\n * Dev-only sibling of `esmExternalRequirePlugin`. The build path externalizes\n * React via Rolldown so an importmap hands the same React instance to both\n * Connect and CDN-served editor packages. Rolldown plugins don't run in\n * `vite createServer`, and Vite's pre-bundled CJS deps only expose a `default`\n * export — so a CDN editor that does `import { lazy } from \"react\"` would\n * fail with \"no named export 'lazy'\".\n *\n * This plugin:\n * 1. Forces React into `optimizeDeps.include` so the optimizer always knows\n * about it.\n * 2. Serves a shim per React module at a stable URL. Each shim imports\n * from Vite's live pre-bundled URL (sharing Connect's React instance)\n * and re-exports React's named members so editors importing\n * `{ lazy }`, `{ jsx }`, etc. work.\n * 3. Rewrites the page importmap to point at those shim URLs.\n */\nexport function devReactImportmapPlugin(): Plugin {\n let namedExports = new Map<string, string[]>();\n\n return {\n name: \"ph-dev-react-importmap\",\n apply: \"serve\",\n config: () => ({ optimizeDeps: { include: REACT_DEPS } }),\n configureServer(server) {\n // Resolve React's named exports from the consumer project so we don't\n // hardcode lists that drift across React versions.\n const requireFromRoot = createRequire(\n path.join(server.config.root, \"package.json\"),\n );\n namedExports = new Map(\n REACT_DEPS.map((id) => {\n try {\n const mod = requireFromRoot(id) as Record<string, unknown>;\n return [id, Object.keys(mod).filter((k) => k !== \"default\")];\n } catch {\n return [id, []];\n }\n }),\n );\n\n server.middlewares.use((req, res, next) => {\n if (!req.url?.startsWith(SHIM_PREFIX)) return next();\n const id = req.url\n .slice(SHIM_PREFIX.length)\n .replace(/\\.js(\\?.*)?$/, \"\");\n if (!REACT_DEPS.includes(id)) return next();\n\n const optimizer = server.environments.client.depsOptimizer;\n const info =\n optimizer?.metadata.optimized[id] ??\n optimizer?.metadata.discovered[id];\n if (!optimizer || !info) {\n res.statusCode = 404;\n res.end();\n return;\n }\n\n const browserHash = info.browserHash ?? optimizer.metadata.browserHash;\n const depUrl = `${VITE_DEPS_PREFIX}/${path.basename(info.file)}?v=${browserHash}`;\n const names = namedExports.get(id) ?? [];\n\n res.setHeader(\"Content-Type\", \"application/javascript\");\n res.end(\n `import * as M from ${JSON.stringify(depUrl)};\\n` +\n `const ns = M.default ?? M;\\n` +\n `export default ns;\\n` +\n (names.length\n ? `export const { ${names.join(\", \")} } = ns;\\n`\n : \"\"),\n );\n });\n },\n transformIndexHtml: {\n order: \"post\",\n handler(html, ctx) {\n const browserHash =\n ctx.server?.environments.client.depsOptimizer?.metadata.browserHash;\n if (!browserHash) return;\n const imports = Object.fromEntries(\n REACT_DEPS.map((id) => [\n id,\n `${SHIM_PREFIX}${id}.js?v=${browserHash}`,\n ]),\n );\n return html.replace(\n /<script type=\"importmap\">[\\s\\S]*?<\\/script>/,\n `<script type=\"importmap\">${JSON.stringify({ imports }, null, 2)}</script>`,\n );\n },\n },\n };\n}\n","import { readFileSync } from \"node:fs\";\nimport type { Plugin } from \"vite\";\n\n/**\n * Vite plugin to serve the Connect favicon (icon.ico) from the connect package.\n * This ensures the favicon is available in development and included in the production build.\n */\nexport function connectFaviconPlugin(): Plugin {\n return {\n name: \"copy-connect-favicon\",\n configureServer(server) {\n // Serve icon.ico before Vite's static middleware so it acts as a fallback\n server.middlewares.use(\"/icon.ico\", (_req, res, next) => {\n server.pluginContainer\n .resolveId(\"@powerhousedao/connect/assets/icon.ico\")\n .then((resolved) => {\n if (!resolved) return next();\n res.setHeader(\"Content-Type\", \"image/x-icon\");\n res.end(readFileSync(resolved.id));\n })\n .catch(() => next());\n });\n },\n async generateBundle(_options, bundle) {\n try {\n if (\"icon.ico\" in bundle) return;\n const resolved = await this.resolve(\n \"@powerhousedao/connect/assets/icon.ico\",\n );\n if (!resolved) return;\n this.emitFile({\n type: \"asset\",\n fileName: \"icon.ico\",\n source: readFileSync(resolved.id),\n });\n } catch {\n // connect package not found, skip favicon\n }\n },\n };\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport type { Plugin } from \"vite\";\n\nexport type PhBundledPackagesPluginOptions = {\n /**\n * Package names (with `provider: \"local\"` in powerhouse.config.json)\n * that should be bundled into Connect at build time. Each must be\n * resolvable from node_modules.\n */\n packages: string[];\n /** Project root used to read each bundled package's package.json version. */\n projectRoot?: string;\n};\n\nconst VIRTUAL_ID = \"ph-bundled-packages-virtual\";\nconst RESOLVED_VIRTUAL_ID = \"\\0virtual:\" + VIRTUAL_ID;\n\nfunction readBundledPackageVersion(\n projectRoot: string,\n name: string,\n): string | undefined {\n try {\n const raw = fs.readFileSync(\n path.join(projectRoot, \"node_modules\", name, \"package.json\"),\n \"utf-8\",\n );\n const pkg = JSON.parse(raw) as { version?: unknown };\n return typeof pkg.version === \"string\" ? pkg.version : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction makeRegisterModule(packages: string[], projectRoot: string): string {\n if (packages.length === 0) {\n return \"export default () => {};\\n\";\n }\n const imports: string[] = [];\n const calls: string[] = [];\n\n packages.forEach((name, i) => {\n const moduleName = `pkg${i}`;\n const version = readBundledPackageVersion(projectRoot, name);\n imports.push(`import * as ${moduleName} from ${JSON.stringify(name)};`);\n imports.push(`import ${JSON.stringify(`${name}/style.css`)};`);\n calls.push(\n ` pm.addLocalPackage(${JSON.stringify(name)}, ${moduleName}, ${JSON.stringify(version)});`,\n );\n });\n\n return `${imports.join(\"\\n\")}\\n\\nexport default function register(pm) {\\n${calls.join(\"\\n\")}\\n};\\n`;\n}\n\n/**\n * Emits a virtual module `ph-bundled-packages-virtual` whose default export\n * is a `register(packageManager)` function. When called at runtime (from\n * Connect's bootstrap), it registers each bundled package with the package\n * manager the same way Common/Vetra are registered — meaning they work\n * offline without the registry being reachable.\n *\n * When the list is empty, the module exports a no-op function so Connect's\n * bootstrap code can always import it unconditionally.\n */\nexport function phBundledPackagesPlugin(\n options: PhBundledPackagesPluginOptions,\n): Plugin {\n const projectRoot = options.projectRoot ?? process.cwd();\n const moduleSource = makeRegisterModule(options.packages, projectRoot);\n\n return {\n name: \"vite-plugin-ph-bundled-packages\",\n enforce: \"pre\",\n resolveId(id) {\n if (id === VIRTUAL_ID) return RESOLVED_VIRTUAL_ID;\n },\n load(id) {\n if (id === RESOLVED_VIRTUAL_ID) return moduleSource;\n },\n };\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport type { Plugin } from \"vite\";\n\nexport type PhPackagesPluginOptions = {\n packages: string[];\n projectRoot?: string;\n};\n\nfunction readProjectPackageInfo(\n projectRoot: string | undefined,\n): { name: string; version: string } | null {\n if (!projectRoot) return null;\n try {\n const raw = fs.readFileSync(\n path.join(projectRoot, \"package.json\"),\n \"utf-8\",\n );\n const pkg = JSON.parse(raw) as { name?: unknown; version?: unknown };\n if (typeof pkg.name !== \"string\" || typeof pkg.version !== \"string\") {\n return null;\n }\n return { name: pkg.name, version: pkg.version };\n } catch {\n return null;\n }\n}\n\nexport function phPackagesPlugin(options: PhPackagesPluginOptions): Plugin {\n const projectRoot = options.projectRoot ?? process.cwd();\n const localPackage = readProjectPackageInfo(projectRoot);\n const content = JSON.stringify(\n {\n packages: options.packages,\n localPackage,\n },\n null,\n 2,\n );\n\n return {\n name: \"vite-plugin-ph-packages\",\n configureServer(server) {\n server.middlewares.use((req, res, next) => {\n if (req.url?.endsWith(\"/ph-packages.json\")) {\n res.setHeader(\"Content-Type\", \"application/json\");\n res.end(content);\n return;\n }\n next();\n });\n },\n hotUpdate: {\n order: \"pre\",\n handler(ctx) {\n // filter out modules only imported by \"style.css\"\n // to avoid page reloads triggered by tailwind\n return ctx.modules.filter((mod) => {\n if (mod.importers.size > 1) {\n return true;\n }\n const importer = mod.importers.values().next();\n return !importer.value?.file?.endsWith(\".css\");\n });\n },\n },\n generateBundle() {\n this.emitFile({\n type: \"asset\",\n fileName: \"ph-packages.json\",\n source: content,\n });\n },\n };\n}\n","import type { PowerhouseConfig } from \"@powerhousedao/config\";\nimport { getConfig } from \"@powerhousedao/config/node\";\nimport { loadConnectEnv, setConnectEnv } from \"@powerhousedao/shared/connect\";\nimport { sentryVitePlugin } from \"@sentry/vite-plugin\";\nimport tailwind from \"@tailwindcss/vite\";\nimport react from \"@vitejs/plugin-react\";\nimport { join } from \"node:path\";\nimport {\n createLogger,\n esmExternalRequirePlugin,\n loadEnv,\n type HtmlTagDescriptor,\n type InlineConfig,\n type PluginOption,\n} from \"vite\";\nimport { createHtmlPlugin } from \"vite-plugin-html\";\nimport type { IConnectOptions } from \"./types.js\";\nimport { devReactImportmapPlugin } from \"./vite-plugins/dev-external-react.js\";\nimport { connectFaviconPlugin } from \"./vite-plugins/favicon.js\";\nimport { phBundledPackagesPlugin } from \"./vite-plugins/ph-bundled-packages.js\";\nimport { phPackagesPlugin } from \"./vite-plugins/ph-packages.js\";\n\nconst REACT_VERSION = \"19.2.0\";\n\n// Importmap injected into Connect's HTML in production builds. The build\n// pipeline externalizes react/react-dom via Rolldown's\n// `esmExternalRequirePlugin` (see below), so the browser resolves bare\n// `react` imports through this map → CDN editor packages and Connect share\n// the same React instance via esm.sh. In dev, `devReactImportmapPlugin`\n// rewrites this map to point at Vite's pre-bundled React instead.\nconst REACT_IMPORTMAP_IMPORTS: Record<string, string> = {\n react: `https://esm.sh/react@${REACT_VERSION}`,\n \"react/\": `https://esm.sh/react@${REACT_VERSION}/`,\n \"react-dom\": `https://esm.sh/react-dom@${REACT_VERSION}`,\n \"react-dom/\": `https://esm.sh/react-dom@${REACT_VERSION}/`,\n};\n\nexport function getConnectHtmlTags(\n options: {\n registryUrl?: string | null;\n injectTo?: HtmlTagDescriptor[\"injectTo\"];\n } = {},\n) {\n const { registryUrl, injectTo = \"head\" } = options;\n return [\n {\n tag: \"meta\",\n attrs: {\n \"http-equiv\": \"Content-Security-Policy\",\n content: `script-src 'self' 'unsafe-inline' 'unsafe-eval' https://esm.sh${registryUrl ? \" \" + registryUrl : \"\"}; object-src 'none'; base-uri 'self';`,\n },\n injectTo,\n },\n {\n tag: \"meta\",\n attrs: {\n property: \"og:title\",\n content: \"Connect\",\n },\n injectTo,\n },\n {\n tag: \"meta\",\n attrs: {\n property: \"og:type\",\n content: \"website\",\n },\n injectTo,\n },\n {\n tag: \"meta\",\n attrs: {\n property: \"og:url\",\n content: \"https://apps.powerhouse.io/powerhouse/connect/\",\n },\n injectTo,\n },\n {\n tag: \"meta\",\n attrs: {\n property: \"og:description\",\n content:\n \"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.\",\n },\n injectTo,\n },\n {\n tag: \"meta\",\n attrs: {\n property: \"og:image\",\n content:\n \"https://cf-ipfs.com/ipfs/bafkreigrmclndf2jpbolaq22535q2sw5t44uad3az3dpvkzrnt4lpjt63e\",\n },\n injectTo,\n },\n {\n tag: \"meta\",\n attrs: {\n name: \"twitter:card\",\n content: \"summary_large_image\",\n },\n injectTo,\n },\n {\n tag: \"meta\",\n attrs: {\n name: \"twitter:image\",\n content:\n \"https://cf-ipfs.com/ipfs/bafkreigrmclndf2jpbolaq22535q2sw5t44uad3az3dpvkzrnt4lpjt63e\",\n },\n injectTo,\n },\n {\n tag: \"meta\",\n attrs: {\n name: \"twitter:title\",\n content: \"Connect\",\n },\n injectTo,\n },\n {\n tag: \"meta\",\n attrs: {\n name: \"twitter:description\",\n content:\n \"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.\",\n },\n injectTo,\n },\n ] as const satisfies HtmlTagDescriptor[];\n}\n\nfunction viteLogger({\n silence,\n}: {\n silence?: { warnings?: string[]; errors?: string[] };\n}) {\n const logger = createLogger();\n const loggerWarn = logger.warn.bind(logger);\n const loggerError = logger.error.bind(logger);\n\n logger.warn = (msg, options) => {\n if (silence?.warnings?.some((warning) => msg.includes(warning))) {\n return;\n }\n loggerWarn(msg, options);\n };\n\n logger.error = (msg, options) => {\n if (silence?.errors?.some((error) => msg.includes(error))) {\n return;\n }\n loggerError(msg, options);\n };\n\n return logger;\n}\n\nfunction getPackageNamesFromPowerhouseConfig({ packages }: PowerhouseConfig) {\n if (!packages) return [];\n // Preserve the version/tag from powerhouse.config.json so Connect's runtime\n // resolver sees it when building the registry CDN URL. Without this the\n // registry falls back to its `latest` dist-tag, which may point to a\n // different release stream than what the project asked for (e.g. latest\n // vs. dev). Local packages resolve from node_modules and don't need a\n // version here.\n return packages.map((p) =>\n p.version && p.provider !== \"local\"\n ? `${p.packageName}@${p.version}`\n : p.packageName,\n );\n}\n\nfunction getLocalPackageNamesFromPowerhouseConfig({\n packages,\n}: PowerhouseConfig) {\n if (!packages) return [];\n return packages\n .filter((p) => p.provider === \"local\")\n .map((p) => p.packageName);\n}\n\nexport function getConnectBaseViteConfig(options: IConnectOptions) {\n const mode = options.mode;\n const envDir = options.envDir ?? options.dirname;\n const fileEnv = loadEnv(mode, envDir, \"PH_\");\n\n // Load and validate environment with priority: process.env > options > fileEnv > defaults\n const env = loadConnectEnv({\n processEnv: process.env,\n fileEnv,\n });\n\n // set the resolved env to process.env so it's loaded by vite\n setConnectEnv(env);\n\n // load powerhouse config\n const phConfigPath =\n env.PH_CONFIG_PATH ?? join(options.dirname, \"powerhouse.config.json\");\n\n const phConfig = options.powerhouseConfig ?? getConfig(phConfigPath);\n\n const packagesFromConfig = getPackageNamesFromPowerhouseConfig(phConfig);\n const localPackagesFromConfig =\n getLocalPackageNamesFromPowerhouseConfig(phConfig);\n const phPackagesStr = env.PH_PACKAGES;\n const envPhPackages = phPackagesStr?.split(\",\");\n\n const phPackages = envPhPackages ?? packagesFromConfig;\n\n const phPackageRegistryUrl =\n env.PH_CONNECT_PACKAGES_REGISTRY ?? phConfig.packageRegistryUrl ?? null;\n\n const authToken = env.PH_SENTRY_AUTH_TOKEN;\n const org = env.PH_SENTRY_ORG;\n const project = env.PH_SENTRY_PROJECT;\n const release = env.PH_CONNECT_SENTRY_RELEASE || env.PH_CONNECT_VERSION;\n const uploadSentrySourcemaps = authToken && org && project;\n\n const connectHtmlTags = getConnectHtmlTags({\n registryUrl: phPackageRegistryUrl,\n });\n\n const plugins: PluginOption[] = [\n tailwind(),\n react(),\n createHtmlPlugin({\n minify: false,\n inject: {\n tags: [\n ...connectHtmlTags,\n {\n tag: \"script\",\n attrs: { type: \"importmap\" },\n children: JSON.stringify(\n { imports: REACT_IMPORTMAP_IMPORTS },\n null,\n 2,\n ),\n injectTo: \"head-prepend\",\n },\n ],\n },\n }),\n ] as const;\n\n if (uploadSentrySourcemaps) {\n plugins.push(\n sentryVitePlugin({\n release: {\n name: release ?? \"unknown\",\n inject: false, // prevent it from injecting the release id in the service worker code, this is done in 'src/app/sentry.ts' instead\n },\n authToken,\n org,\n project,\n bundleSizeOptimizations: {\n excludeDebugStatements: true,\n },\n reactComponentAnnotation: {\n enabled: true,\n },\n }) as PluginOption,\n );\n }\n\n // hide warnings unless LOG_LEVEL is set to debug\n const isDebug =\n process.env.LOG_LEVEL === \"debug\" || env.PH_CONNECT_LOG_LEVEL === \"debug\";\n const customLogger = isDebug\n ? undefined\n : viteLogger({\n silence: {\n warnings: [\n \"@import must precede all other statements (besides @charset or empty @layer)\", // tailwindcss error when importing font file\n ],\n errors: [\"Unterminated string literal\"],\n },\n });\n\n const reactExternal = [\n \"react\",\n \"react-dom\",\n \"react/jsx-runtime\",\n \"react-dom/client\",\n ];\n\n const config: InlineConfig = {\n configFile: false,\n mode,\n server: {\n watch: {\n ignored: [\"**/backup-documents/**\", \"**/.ph/**\"],\n },\n },\n resolve: {\n dedupe: [\"react\", \"react-dom\"],\n tsconfigPaths: true,\n },\n define: {\n PH_PACKAGE_REGISTRY_URL: `\"${phPackageRegistryUrl}\"`,\n },\n customLogger,\n envPrefix: [\"PH_CONNECT_\"],\n optimizeDeps: {\n include: [\n \"document-model\",\n \"zod\",\n \"@powerhousedao/design-system/connect\",\n \"@powerhousedao/reactor-browser\",\n \"@powerhousedao/document-engineering\",\n ],\n exclude: [\"@electric-sql/pglite\", \"@electric-sql/pglite-tools\"],\n },\n plugins: [\n // phPackagesPlugin must be registered before tailwind so its hotUpdate\n // hook runs first and can suppress HMR updates for codegen-generated\n // files, preventing tailwind from triggering full page reloads.\n phPackagesPlugin({\n packages: phPackages,\n projectRoot: options.dirname,\n }),\n phBundledPackagesPlugin({\n packages: localPackagesFromConfig,\n projectRoot: options.dirname,\n }),\n // Dev-only: rewrite the importmap so it points at Vite's pre-bundled\n // React (the same URL Connect's own modules resolve to). Without this,\n // CDN editors load React from esm.sh while Connect uses Vite's local\n // copy → two React instances → useSyncExternalStore crash. The build\n // path stays untouched; `esmExternalRequirePlugin` below still owns it.\n devReactImportmapPlugin(),\n ...plugins,\n // Externalize React so both Connect and dynamically loaded registry\n // packages share the same React instance via the import map in index.html.\n // Without this, Vite bundles React into Connect's chunks while registry\n // packages resolve React from the import map (esm.sh), creating two\n // separate React instances that don't share context/state.\n //\n // In Vite 8 (Rolldown), require() calls for external modules are preserved\n // as-is, which fails in browsers. esmExternalRequirePlugin handles both\n // externalization AND converting require() to import statements.\n // NOTE: Do NOT also list these in build.rolldownOptions.external — overlapping\n // entries prevent the plugin from transforming require() calls.\n esmExternalRequirePlugin({ external: reactExternal }),\n connectFaviconPlugin(),\n ],\n worker: {\n format: \"es\",\n },\n build: {\n sourcemap: true,\n },\n };\n return config;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,MAAa,2BAA2B;AACxC,MAAa,qBAAqB;AAClC,MAAa,mBAAmB;AAChC,MAAa,cAAc;;;ACS3B,MAAa,yBAAyB;AAEtC,SAAgB,0BAA0B,SAA+B;CACvE,MAAM,EACJ,MACA,YACA,kBACA,wBACA,wBACE;AAEJ,KAAI,KACF,eAAc,EACZ,sBAAsB,MACvB,CAAC;AAGJ,KAAI,WACF,eAAc,EACZ,gBAAgB,YACjB,CAAC;AAEJ,KAAI,iBACF,eAAc,EACZ,+BAA+B,iBAAiB,KAAK,IAAI,EAC1D,CAAC;AAEJ,KAAI,uBACF,eAAc,EACZ,qCAAqC,wBACtC,CAAC;AAEJ,KAAI,oBACF,eAAc,EACZ,0BAA0B,MAC3B,CAAC;;AAIN,SAAgB,sBACd,SACA;CACA,MAAM,EAAE,cAAc,KAAK,EAAE,mBAAmB;AAChD,QAAO,kBAAkB,KAAK,aAAa,iBAAiB;;AAG9D,SAAgB,eAAe,aAAqB,OAAO,QAAQ,KAAK,EAAE;AAGxE,QADgB,cAAc,KAAK,CACpB,QAAQ,aAAa,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;;AAGxD,SAAgB,0BAA0B,OAAO,QAAQ,KAAK,EAAE;A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Q,EACN,OAAO,EACL,SAAS,CAAC,0BAA0B,YAAY,EACjD,EACF;EACD,SAAS;GACP,QAAQ,CAAC,SAAS,YAAY;GAC9B,eAAe;GAChB;EACD,QAAQ,EACN,yBAAyB,IAAI,qBAAqB,IACnD;EACD;EACA,WAAW,CAAC,cAAc;EAC1B,cAAc;GACZ,SAAS;IACP;IACA;IACA;IACA;IACA;IACD;GACD,SAAS,CAAC,wBAAwB,6BAA6B;GAChE;EACD,SAAS;GAIP,iBAAiB;IACf,UAAU;IACV,aAAa,QAAQ;IACtB,CAAC;GACF,wBAAwB;IACtB,UAAU;IACV,aAAa,QAAQ;IACtB,CAAC;GAMF,yBAAyB;GACzB,GAAG;GAYH,yBAAyB,EAAE,UAAU,eAAe,CAAC;GACrD,sBAAsB;GACvB;EACD,QAAQ,EACN,QAAQ,MACT;EACD,OAAO,EACL,WAAW,MACZ;EACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/builder-tools",
|
|
3
|
-
"version": "6.0.2-staging.
|
|
3
|
+
"version": "6.0.2-staging.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"publishConfig": {
|
|
@@ -15,38 +15,29 @@
|
|
|
15
15
|
],
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
|
-
"types": "./dist/index.d.
|
|
19
|
-
"import": "./dist/index.
|
|
18
|
+
"types": "./dist/index.d.mts",
|
|
19
|
+
"import": "./dist/index.mjs"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@
|
|
25
|
-
"@
|
|
26
|
-
"@vitejs/plugin-react": "
|
|
27
|
-
"vite": "
|
|
24
|
+
"@sentry/vite-plugin": "^4.3.0",
|
|
25
|
+
"@tailwindcss/vite": "4.2.2",
|
|
26
|
+
"@vitejs/plugin-react": "6.0.1",
|
|
27
|
+
"vite": "8.0.8",
|
|
28
28
|
"vite-plugin-html": "3.2.2",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
29
|
+
"zod": "4.3.6",
|
|
30
|
+
"@powerhousedao/shared": "6.0.2-staging.4",
|
|
31
|
+
"document-model": "6.0.2-staging.4",
|
|
32
|
+
"@powerhousedao/config": "6.0.2-staging.4"
|
|
31
33
|
},
|
|
32
34
|
"devDependencies": {
|
|
33
|
-
"
|
|
34
|
-
"tsx": "4.21.0"
|
|
35
|
-
"@sentry/vite-plugin": "^4.3.0",
|
|
36
|
-
"esbuild-plugins-node-modules-polyfill": "1.8.1",
|
|
37
|
-
"vite-envs": "4.6.2",
|
|
38
|
-
"esbuild": "^0.25.5",
|
|
39
|
-
"fast-glob": "^3.3.3",
|
|
40
|
-
"magic-string": "^0.30.17",
|
|
41
|
-
"read-pkg": "10.1.0",
|
|
42
|
-
"resolve.exports": "^2.0.3",
|
|
43
|
-
"zod": "4.3.6",
|
|
44
|
-
"@powerhousedao/shared": "6.0.2-staging.2",
|
|
45
|
-
"@powerhousedao/config": "6.0.2-staging.2"
|
|
35
|
+
"tsdown": "0.21.1",
|
|
36
|
+
"tsx": "4.21.0"
|
|
46
37
|
},
|
|
47
38
|
"scripts": {
|
|
48
39
|
"tsc": "tsc",
|
|
49
40
|
"lint": "eslint",
|
|
50
|
-
"build
|
|
41
|
+
"build": "tsdown"
|
|
51
42
|
}
|
|
52
43
|
}
|
package/dist/bundle.d.ts
DELETED
package/dist/bundle.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../bundle.ts"],"names":[],"mappings":""}
|
|
@@ -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,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,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;A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QAAQ,EAAE,MAAM,iBAO1E;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAO3E;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,QAEpC;AAID,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CASnE"}
|
|
@@ -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 +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,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,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,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":"AAYA,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,MAAM,CAAC;AAId,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsEtB,CAAC;AAyCX,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,eAAe,cAqKhE"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Package } from "resolve.exports";
|
|
2
|
-
import type { Plugin, PluginOption } from "vite";
|
|
3
|
-
export declare const externalIds: RegExp[];
|
|
4
|
-
export declare function viteIgnoreStaticImport(_importKeys: (string | RegExp | false | undefined)[]): Plugin;
|
|
5
|
-
export declare function viteReplaceImports(imports: Record<string, string>): PluginOption;
|
|
6
|
-
export declare function findPackageJson(packageName: string): Promise<{
|
|
7
|
-
packageJson: Package;
|
|
8
|
-
path: string;
|
|
9
|
-
}>;
|
|
10
|
-
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../connect-utils/vite-plugins/base.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAuB,MAAM,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAGtE,eAAO,MAAM,WAAW,UAAyC,CAAC;AAKlE,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC,EAAE,GACnD,MAAM,CAgER;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B,YAAY,CAgDd;AAED,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM;iBAsBT,OAAO;;GAOtD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"document-models-hmr.d.ts","sourceRoot":"","sources":["../../../connect-utils/vite-plugins/document-models-hmr.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,MAAM,CAAC;AAGxD,eAAO,MAAM,qBAAqB,GAAI,WAAW,MAAM,KAAG,YAwEzD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editors-hmr.d.ts","sourceRoot":"","sources":["../../../connect-utils/vite-plugins/editors-hmr.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,MAAM,CAAC;AAGxD,eAAO,MAAM,cAAc,GAAI,WAAW,MAAM,KAAG,YAsElD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"external-packages.d.ts","sourceRoot":"","sources":["../../../connect-utils/vite-plugins/external-packages.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,MAAM,CAAC;AA6FxD,eAAO,MAAM,wBAAwB,GACnC,cAAc,OAAO,EACrB,UAAU,MAAM,EAAE,GAAG,SAAS,EAC9B,WAAW,MAAM,KAChB,YAAY,EAgEd,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { PluginOption } from "vite";
|
|
2
|
-
export type Provider = "node_modules" | "esm.sh";
|
|
3
|
-
export type Dependency = {
|
|
4
|
-
name: string;
|
|
5
|
-
version?: string;
|
|
6
|
-
provider: Provider;
|
|
7
|
-
dependencies?: string[];
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Vite plugin to bundle or copy dependencies and inject an import map into `index.html`.
|
|
11
|
-
*
|
|
12
|
-
* @param {string} outputDir - The directory where the modules should be placed.
|
|
13
|
-
* @param {(string | { name: string; provider: string })[]} dependencies -
|
|
14
|
-
* List of dependencies to process. Can be:
|
|
15
|
-
* - A string (dependency is copied as is).
|
|
16
|
-
* - An object `{ name, provide }` where:
|
|
17
|
-
* - `name` (string): The module name.
|
|
18
|
-
* - `provider` (string): Where to retrieve the module bundle. Defaults to node_modules.
|
|
19
|
-
*
|
|
20
|
-
* @returns {Plugin} A Vite plugin that processes dependencies and injects an import map.
|
|
21
|
-
*/
|
|
22
|
-
export declare function generateImportMapPlugin(outputDir: string, dependencies: (string | Dependency)[]): PluginOption[];
|
|
23
|
-
//# sourceMappingURL=importmap.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"importmap.d.ts","sourceRoot":"","sources":["../../../connect-utils/vite-plugins/importmap.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAGzC,MAAM,MAAM,QAAQ,GAAG,cAAc,GAAG,QAAQ,CAAC;AAEjD,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAyRF;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,GACpC,YAAY,EAAE,CAiChB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ph-external-packages.d.ts","sourceRoot":"","sources":["../../../connect-utils/vite-plugins/ph-external-packages.ts"],"names":[],"mappings":"AAiDA,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,MAAM,EAAE,EACpB,YAAY,CAAC,EAAE,MAAM,8BAyDtB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"studio.d.ts","sourceRoot":"","sources":["../../../connect-utils/vite-plugins/studio.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAGzC,wBAAgB,0BAA0B,CACxC,OAAO,qBAAQ,EACf,WAAW,EAAE,MAAM,EACnB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,YAAY,EAAE,CAgChB"}
|
package/dist/index.d.ts
DELETED
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|