@powerhousedao/builder-tools 0.9.44-dev.0 → 0.9.44-dev.1
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/README.md +79 -0
- package/dist/connect-build/build.d.ts +6 -0
- package/dist/connect-build/build.d.ts.map +1 -0
- package/dist/connect-build/build.js +35 -0
- package/dist/connect-build/build.js.map +1 -0
- package/dist/connect-build/constants.d.ts +9 -0
- package/dist/connect-build/constants.d.ts.map +1 -0
- package/dist/connect-build/constants.js +9 -0
- package/dist/connect-build/constants.js.map +1 -0
- package/dist/connect-build/helpers.d.ts +24 -0
- package/dist/connect-build/helpers.d.ts.map +1 -0
- package/dist/connect-build/helpers.js +57 -0
- package/dist/connect-build/helpers.js.map +1 -0
- package/dist/connect-build/index.d.ts +5 -0
- package/dist/connect-build/index.d.ts.map +1 -0
- package/dist/connect-build/index.js +4 -0
- package/dist/connect-build/index.js.map +1 -0
- package/dist/connect-build/preview.d.ts +3 -0
- package/dist/connect-build/preview.d.ts.map +1 -0
- package/dist/connect-build/preview.js +18 -0
- package/dist/connect-build/preview.js.map +1 -0
- package/dist/connect-build/types.d.ts +23 -0
- package/dist/connect-build/types.d.ts.map +1 -0
- package/dist/connect-build/types.js +2 -0
- package/dist/connect-build/types.js.map +1 -0
- package/dist/connect-studio/index.d.ts +1 -5
- package/dist/connect-studio/index.d.ts.map +1 -1
- package/dist/connect-studio/index.js +1 -5
- package/dist/connect-studio/index.js.map +1 -1
- package/dist/connect-studio/server.d.ts.map +1 -1
- package/dist/connect-studio/server.js +3 -47
- package/dist/connect-studio/server.js.map +1 -1
- package/dist/connect-studio/studio.js +1 -1
- package/dist/connect-studio/studio.js.map +1 -1
- package/dist/connect-utils/constants.d.ts +5 -0
- package/dist/connect-utils/constants.d.ts.map +1 -0
- package/dist/connect-utils/constants.js +5 -0
- package/dist/connect-utils/constants.js.map +1 -0
- package/dist/connect-utils/helpers.d.ts +38 -0
- package/dist/connect-utils/helpers.d.ts.map +1 -0
- package/dist/connect-utils/helpers.js +167 -0
- package/dist/connect-utils/helpers.js.map +1 -0
- package/dist/connect-utils/index.d.ts +7 -0
- package/dist/connect-utils/index.d.ts.map +1 -0
- package/dist/connect-utils/index.js +7 -0
- package/dist/connect-utils/index.js.map +1 -0
- package/dist/connect-utils/vite-plugins/base.d.ts.map +1 -0
- package/dist/connect-utils/vite-plugins/base.js.map +1 -0
- package/dist/connect-utils/vite-plugins/external-packages.d.ts +3 -0
- package/dist/connect-utils/vite-plugins/external-packages.d.ts.map +1 -0
- package/dist/{connect-studio → connect-utils}/vite-plugins/external-packages.js +15 -37
- package/dist/connect-utils/vite-plugins/external-packages.js.map +1 -0
- package/dist/connect-utils/vite-plugins/importmap.d.ts.map +1 -0
- package/dist/connect-utils/vite-plugins/importmap.js.map +1 -0
- package/dist/connect-utils/vite-plugins/studio.d.ts.map +1 -0
- package/dist/connect-utils/vite-plugins/studio.js.map +1 -0
- package/dist/document-model-editor/components/form.d.ts.map +1 -1
- package/dist/editor-utils/components/styles.d.ts.map +1 -1
- package/dist/editor-utils/components/stylesVariant.d.ts.map +1 -1
- package/dist/editor-utils/hooks/useEnsInfo.d.ts.map +1 -1
- package/dist/style.css +16 -12
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -6
- package/dist/connect-studio/helpers.d.ts +0 -6
- package/dist/connect-studio/helpers.d.ts.map +0 -1
- package/dist/connect-studio/helpers.js +0 -57
- package/dist/connect-studio/helpers.js.map +0 -1
- package/dist/connect-studio/vite-plugins/base.d.ts.map +0 -1
- package/dist/connect-studio/vite-plugins/base.js.map +0 -1
- package/dist/connect-studio/vite-plugins/external-packages.d.ts +0 -6
- package/dist/connect-studio/vite-plugins/external-packages.d.ts.map +0 -1
- package/dist/connect-studio/vite-plugins/external-packages.js.map +0 -1
- package/dist/connect-studio/vite-plugins/importmap.d.ts.map +0 -1
- package/dist/connect-studio/vite-plugins/importmap.js.map +0 -1
- package/dist/connect-studio/vite-plugins/studio.d.ts.map +0 -1
- package/dist/connect-studio/vite-plugins/studio.js.map +0 -1
- /package/dist/{connect-studio → connect-utils}/vite-plugins/base.d.ts +0 -0
- /package/dist/{connect-studio → connect-utils}/vite-plugins/base.js +0 -0
- /package/dist/{connect-studio → connect-utils}/vite-plugins/importmap.d.ts +0 -0
- /package/dist/{connect-studio → connect-utils}/vite-plugins/importmap.js +0 -0
- /package/dist/{connect-studio → connect-utils}/vite-plugins/studio.d.ts +0 -0
- /package/dist/{connect-studio → connect-utils}/vite-plugins/studio.js +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# @powerhousedao/builder-tools
|
|
2
|
+
|
|
3
|
+
A comprehensive toolkit for building and managing Powerhouse DAO applications. This package provides essential tools and utilities for development, including document model editing, connection management, and various editor utilities.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Connect Studio**: Tools for managing and configuring connections
|
|
8
|
+
- **Connect Build**: Build utilities for connection management
|
|
9
|
+
- **Document Model Editor**: A powerful editor for document models
|
|
10
|
+
- **Editor Utils**: Common utilities for editor functionality
|
|
11
|
+
- **Connect Utils**: Shared utilities for connection management
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @powerhousedao/builder-tools
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
The package provides several modules that can be imported as needed:
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
// Import specific modules
|
|
25
|
+
import { ... } from '@powerhousedao/builder-tools/connect-studio';
|
|
26
|
+
import { ... } from '@powerhousedao/builder-tools/connect-build';
|
|
27
|
+
import { ... } from '@powerhousedao/builder-tools/document-model-editor';
|
|
28
|
+
import { ... } from '@powerhousedao/builder-tools/editor-utils';
|
|
29
|
+
|
|
30
|
+
// Import styles
|
|
31
|
+
import '@powerhousedao/builder-tools/style.css';
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Development
|
|
35
|
+
|
|
36
|
+
### Prerequisites
|
|
37
|
+
|
|
38
|
+
- Node.js (Latest LTS version recommended)
|
|
39
|
+
- npm or yarn
|
|
40
|
+
|
|
41
|
+
### Setup
|
|
42
|
+
|
|
43
|
+
1. Clone the repository
|
|
44
|
+
2. Install dependencies:
|
|
45
|
+
```bash
|
|
46
|
+
npm install
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Available Scripts
|
|
50
|
+
|
|
51
|
+
- `npm run build` - Build the package
|
|
52
|
+
- `npm run build:css` - Build CSS files
|
|
53
|
+
- `npm run storybook` - Run Storybook development server
|
|
54
|
+
- `npm run lint` - Run ESLint
|
|
55
|
+
- `npm run lint:nx` - Run ESLint with auto-fix
|
|
56
|
+
- `npm run clean` - Clean build artifacts
|
|
57
|
+
|
|
58
|
+
## Dependencies
|
|
59
|
+
|
|
60
|
+
This package has several key dependencies:
|
|
61
|
+
|
|
62
|
+
- React 18+
|
|
63
|
+
- TailwindCSS
|
|
64
|
+
- CodeMirror 6
|
|
65
|
+
- GraphQL Tools
|
|
66
|
+
- Various Radix UI components
|
|
67
|
+
- And more (see package.json for complete list)
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
AGPL-3.0-only
|
|
72
|
+
|
|
73
|
+
## Contributing
|
|
74
|
+
|
|
75
|
+
Please read our contributing guidelines before submitting pull requests.
|
|
76
|
+
|
|
77
|
+
## Support
|
|
78
|
+
|
|
79
|
+
For support, please open an issue in the repository or contact the Powerhouse DAO team.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ConnectBuildOptions } from "./types.js";
|
|
2
|
+
/** Builds Connect with a given project's local and external packages included
|
|
3
|
+
* @see {@link ConnectBuildOptions} for options
|
|
4
|
+
*/
|
|
5
|
+
export declare function buildConnect(options: ConnectBuildOptions): Promise<void>;
|
|
6
|
+
//# sourceMappingURL=build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../connect-build/build.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,mBAAmB,iBA4D9D"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { appendToHtmlHead, copyConnect, PH_DIR_NAME, resolveConnect, } from "#connect-utils";
|
|
2
|
+
import { mkdir, rm } from "fs/promises";
|
|
3
|
+
import { join } from "path";
|
|
4
|
+
import { CONNECT_BUILD_ASSETS_DIR_NAME, CONNECT_BUILD_DIR_NAME, CONNECT_BUILD_DIST_DIR_NAME, CONNECT_BUILD_EXTERNAL_PACKAGES_CSS_FILE_NAME, DEFAULT_ASSETS_DIR_NAME, DEFAULT_EXTERNAL_PACKAGES_FILE_NAME, DEFAULT_STYLES_FILE_NAME, } from "./constants.js";
|
|
5
|
+
import { buildAndBundleCss, bundleExternalPackages, copyAssets, } from "./helpers.js";
|
|
6
|
+
/** Builds Connect with a given project's local and external packages included
|
|
7
|
+
* @see {@link ConnectBuildOptions} for options
|
|
8
|
+
*/
|
|
9
|
+
export async function buildConnect(options) {
|
|
10
|
+
const { projectRoot = process.cwd(), assetsDirName = DEFAULT_ASSETS_DIR_NAME, externalPackagesFileName = DEFAULT_EXTERNAL_PACKAGES_FILE_NAME, stylesFileName = DEFAULT_STYLES_FILE_NAME, connectPath = resolveConnect(), } = options;
|
|
11
|
+
// In this context, `project*` paths are relative to the project root
|
|
12
|
+
// `connectBuild*` paths are relative to the Connect build directory
|
|
13
|
+
const projectAssetsDir = join(projectRoot, assetsDirName);
|
|
14
|
+
const projectExternalPackagesPath = join(projectRoot, externalPackagesFileName);
|
|
15
|
+
const projectStylesPath = join(projectRoot, stylesFileName);
|
|
16
|
+
const connectBuildDir = join(projectRoot, PH_DIR_NAME, CONNECT_BUILD_DIR_NAME);
|
|
17
|
+
const connectBuildDistDir = join(connectBuildDir, CONNECT_BUILD_DIST_DIR_NAME);
|
|
18
|
+
const connectBuildAssetsDir = join(connectBuildDistDir, CONNECT_BUILD_ASSETS_DIR_NAME);
|
|
19
|
+
const externalPackagesStylesPath = join(connectBuildAssetsDir, CONNECT_BUILD_EXTERNAL_PACKAGES_CSS_FILE_NAME);
|
|
20
|
+
const connectBuildIndexHtmlPath = join(connectBuildDistDir, "index.html");
|
|
21
|
+
// Remove and recreate the Connect build directory so that we are starting from scratch
|
|
22
|
+
await rm(connectBuildDir, { recursive: true, force: true });
|
|
23
|
+
await mkdir(connectBuildDir, { recursive: true });
|
|
24
|
+
// Copy the Connect dist directory to the Connect build directory, this is either a local installation or the dist code from the installed npm package
|
|
25
|
+
copyConnect(connectPath, connectBuildDistDir);
|
|
26
|
+
// Bundle the external packages with esbuild so that they can be referenced asynchronously from the Connect build
|
|
27
|
+
await bundleExternalPackages(projectExternalPackagesPath, connectBuildDistDir);
|
|
28
|
+
// Copy over assets in the project assets dir so that editors etc. that might need them can reference them with /assets
|
|
29
|
+
await copyAssets(projectAssetsDir, connectBuildAssetsDir);
|
|
30
|
+
// Run tailwind to build and bundle the CSS and output it to the Connect build dist assets directory
|
|
31
|
+
await buildAndBundleCss(projectStylesPath, externalPackagesStylesPath);
|
|
32
|
+
// Add a link to the built project styles, since the original Connect build does not know about them
|
|
33
|
+
await appendToHtmlHead(connectBuildIndexHtmlPath, `<link rel="stylesheet" href="/${CONNECT_BUILD_ASSETS_DIR_NAME}/${CONNECT_BUILD_EXTERNAL_PACKAGES_CSS_FILE_NAME}">`);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../connect-build/build.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,OAA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AAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5D,MAAM,KAAK,CAAC,eAAe,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAElD,sJAAsJ;IACtJ,WAAW,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;IAE9C,iHAAiH;IACjH,MAAM,sBAAsB,CAC1B,2BAA2B,EAC3B,mBAAmB,CACpB,CAAC;IAEF,uHAAuH;IACvH,MAAM,UAAU,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAAC;IAE1D,oGAAoG;IACpG,MAAM,iBAAiB,CAAC,iBAAiB,EAAE,0BAA0B,CAAC,CAAC;IAEvE,oGAAoG;IACpG,MAAM,gBAAgB,CACpB,yBAAyB,EACzB,iCAAiC,6BAA6B,IAAI,6CAA6C,IAAI,CACpH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const DEFAULT_ASSETS_DIR_NAME = "assets";
|
|
2
|
+
export declare const DEFAULT_EXTERNAL_PACKAGES_FILE_NAME = "external-packages.js";
|
|
3
|
+
export declare const DEFAULT_STYLES_FILE_NAME = "style.css";
|
|
4
|
+
export declare const CONNECT_BUILD_DIR_NAME = "connect-build";
|
|
5
|
+
export declare const CONNECT_BUILD_DIST_DIR_NAME = "dist";
|
|
6
|
+
export declare const CONNECT_BUILD_ASSETS_DIR_NAME = "assets";
|
|
7
|
+
export declare const CONNECT_BUILD_INDEX_HTML_FILE_NAME = "index.html";
|
|
8
|
+
export declare const CONNECT_BUILD_EXTERNAL_PACKAGES_CSS_FILE_NAME = "external-packages.css";
|
|
9
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../connect-build/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAChD,eAAO,MAAM,mCAAmC,yBAAyB,CAAC;AAC1E,eAAO,MAAM,wBAAwB,cAAc,CAAC;AACpD,eAAO,MAAM,sBAAsB,kBAAkB,CAAC;AACtD,eAAO,MAAM,2BAA2B,SAAS,CAAC;AAClD,eAAO,MAAM,6BAA6B,WAAW,CAAC;AACtD,eAAO,MAAM,kCAAkC,eAAe,CAAC;AAC/D,eAAO,MAAM,6CAA6C,0BACjC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const DEFAULT_ASSETS_DIR_NAME = "assets";
|
|
2
|
+
export const DEFAULT_EXTERNAL_PACKAGES_FILE_NAME = "external-packages.js";
|
|
3
|
+
export const DEFAULT_STYLES_FILE_NAME = "style.css";
|
|
4
|
+
export const CONNECT_BUILD_DIR_NAME = "connect-build";
|
|
5
|
+
export const CONNECT_BUILD_DIST_DIR_NAME = "dist";
|
|
6
|
+
export const CONNECT_BUILD_ASSETS_DIR_NAME = "assets";
|
|
7
|
+
export const CONNECT_BUILD_INDEX_HTML_FILE_NAME = "index.html";
|
|
8
|
+
export const CONNECT_BUILD_EXTERNAL_PACKAGES_CSS_FILE_NAME = "external-packages.css";
|
|
9
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../connect-build/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uBAAuB,GAAG,QAAQ,CAAC;AAChD,MAAM,CAAC,MAAM,mCAAmC,GAAG,sBAAsB,CAAC;AAC1E,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,CAAC;AACpD,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAe,CAAC;AACtD,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC;AAClD,MAAM,CAAC,MAAM,6BAA6B,GAAG,QAAQ,CAAC;AACtD,MAAM,CAAC,MAAM,kCAAkC,GAAG,YAAY,CAAC;AAC/D,MAAM,CAAC,MAAM,6CAA6C,GACxD,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import postcss from "postcss";
|
|
2
|
+
/** Runs esbuild to bundle the external packages */
|
|
3
|
+
export declare function bundleExternalPackages(externalPackagesPath: string, connectBuildDistDirPath: string): Promise<import("esbuild").BuildResult<{
|
|
4
|
+
entryPoints: string[];
|
|
5
|
+
outdir: string;
|
|
6
|
+
bundle: true;
|
|
7
|
+
minify: true;
|
|
8
|
+
format: "esm";
|
|
9
|
+
external: string[];
|
|
10
|
+
loader: {
|
|
11
|
+
".png": "dataurl";
|
|
12
|
+
".mp4": "dataurl";
|
|
13
|
+
".svg": "dataurl";
|
|
14
|
+
".jpg": "dataurl";
|
|
15
|
+
".jpeg": "dataurl";
|
|
16
|
+
".gif": "dataurl";
|
|
17
|
+
".webp": "dataurl";
|
|
18
|
+
};
|
|
19
|
+
}>>;
|
|
20
|
+
/** Copies the assets from the project to the connect build dist assets directory */
|
|
21
|
+
export declare function copyAssets(projectAssetsDir: string, connectBuildAssetsDir: string): Promise<void>;
|
|
22
|
+
/** Builds and bundles the CSS with tailwind */
|
|
23
|
+
export declare function buildAndBundleCss(inputPath: string, outputPath: string): Promise<postcss.Result<postcss.Root> | undefined>;
|
|
24
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../connect-build/helpers.ts"],"names":[],"mappings":"AAIA,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,mDAAmD;AACnD,wBAAsB,sBAAsB,CAC1C,oBAAoB,EAAE,MAAM,EAC5B,uBAAuB,EAAE,MAAM;;;;;;;;;;;;;;;;IAoBhC;AAED,oFAAoF;AACpF,wBAAsB,UAAU,CAC9B,gBAAgB,EAAE,MAAM,EACxB,qBAAqB,EAAE,MAAM,iBAa9B;AAED,+CAA+C;AAC/C,wBAAsB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,qDAY5E"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import tailwindPostcssPlugin from "@tailwindcss/postcss";
|
|
2
|
+
import { build } from "esbuild";
|
|
3
|
+
import { existsSync } from "fs";
|
|
4
|
+
import { cp, mkdir, readFile, writeFile } from "fs/promises";
|
|
5
|
+
import postcss from "postcss";
|
|
6
|
+
/** Runs esbuild to bundle the external packages */
|
|
7
|
+
export async function bundleExternalPackages(externalPackagesPath, connectBuildDistDirPath) {
|
|
8
|
+
const result = await build({
|
|
9
|
+
entryPoints: [externalPackagesPath],
|
|
10
|
+
outdir: connectBuildDistDirPath,
|
|
11
|
+
bundle: true,
|
|
12
|
+
minify: true,
|
|
13
|
+
format: "esm",
|
|
14
|
+
external: ["react", "react-dom"],
|
|
15
|
+
loader: {
|
|
16
|
+
".png": "dataurl",
|
|
17
|
+
".mp4": "dataurl",
|
|
18
|
+
".svg": "dataurl",
|
|
19
|
+
".jpg": "dataurl",
|
|
20
|
+
".jpeg": "dataurl",
|
|
21
|
+
".gif": "dataurl",
|
|
22
|
+
".webp": "dataurl",
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
/** Copies the assets from the project to the connect build dist assets directory */
|
|
28
|
+
export async function copyAssets(projectAssetsDir, connectBuildAssetsDir) {
|
|
29
|
+
try {
|
|
30
|
+
if (!existsSync(projectAssetsDir)) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (!existsSync(connectBuildAssetsDir)) {
|
|
34
|
+
await mkdir(connectBuildAssetsDir, { recursive: true });
|
|
35
|
+
}
|
|
36
|
+
await cp(projectAssetsDir, connectBuildAssetsDir);
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
console.error("Error copying assets", { error });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/** Builds and bundles the CSS with tailwind */
|
|
43
|
+
export async function buildAndBundleCss(inputPath, outputPath) {
|
|
44
|
+
try {
|
|
45
|
+
const inputCss = await readFile(inputPath, "utf8");
|
|
46
|
+
const result = await postcss([tailwindPostcssPlugin]).process(inputCss, {
|
|
47
|
+
from: inputPath,
|
|
48
|
+
to: outputPath,
|
|
49
|
+
});
|
|
50
|
+
await writeFile(outputPath, result.css, "utf8");
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
console.error("Error building and bundling CSS", { error });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../connect-build/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,mDAAmD;AACnD,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,oBAA4B,EAC5B,uBAA+B;IAE/B,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC;QACzB,WAAW,EAAE,CAAC,oBAAoB,CAAC;QACnC,MAAM,EAAE,uBAAuB;QAC/B,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;QAChC,MAAM,EAAE;YACN,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,SAAS;YAClB,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,SAAS;SACnB;KACF,CAAC,C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[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../connect-build/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../connect-build/preview.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,wBAAsB,cAAc,CAAC,OAAO,EAAE,qBAAqB,iBAiBlE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PH_DIR_NAME } from "#connect-utils";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { preview } from "vite";
|
|
4
|
+
import { CONNECT_BUILD_DIR_NAME } from "./constants.js";
|
|
5
|
+
export async function previewConnect(options) {
|
|
6
|
+
const { projectRoot = process.cwd(), port = 4173, open = true } = options;
|
|
7
|
+
const connectBuildDir = join(projectRoot, PH_DIR_NAME, CONNECT_BUILD_DIR_NAME);
|
|
8
|
+
const previewServer = await preview({
|
|
9
|
+
root: connectBuildDir,
|
|
10
|
+
preview: {
|
|
11
|
+
port,
|
|
12
|
+
open,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
previewServer.printUrls();
|
|
16
|
+
previewServer.bindCLIShortcuts({ print: true });
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=preview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview.js","sourceRoot":"","sources":["../../connect-build/preview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAGxD,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAA8B;IACjE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;IAC1E,MAAM,eAAe,GAAG,IAAI,CAC1B,WAAW,EACX,WAAW,EACX,sBAAsB,CACvB,CAAC;IACF,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC;QAClC,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE;YACP,IAAI;YACJ,IAAI;SACL;KACF,CAAC,CAAC;IAEH,aAAa,CAAC,SAAS,EAAE,CAAC;IAC1B,aAAa,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Options for building Connect with a given project's local and external packages included */
|
|
2
|
+
export type ConnectBuildOptions = {
|
|
3
|
+
/** The root directory of the project, defaults to `process.cwd()` */
|
|
4
|
+
projectRoot?: string;
|
|
5
|
+
/** The name of the assets directory, defaults to DEFAULT_ASSETS_DIR_NAME */
|
|
6
|
+
assetsDirName?: string;
|
|
7
|
+
/** The name of the external packages file, defaults to DEFAULT_EXTERNAL_PACKAGES_FILE_NAME */
|
|
8
|
+
externalPackagesFileName?: string;
|
|
9
|
+
/** The name of the styles file, defaults to DEFAULT_STYLES_FILE_NAME */
|
|
10
|
+
stylesFileName?: string;
|
|
11
|
+
/** The path to the Connect dist directory, calls `resolveConnect()` if not provided */
|
|
12
|
+
connectPath?: string;
|
|
13
|
+
};
|
|
14
|
+
/** Options for previewing a built Connect project */
|
|
15
|
+
export type ConnectPreviewOptions = {
|
|
16
|
+
/** The root directory of the project, defaults to `process.cwd()` */
|
|
17
|
+
projectRoot?: string;
|
|
18
|
+
/** The port to run the server on, defaults to 4173 (vite preview default) */
|
|
19
|
+
port?: number;
|
|
20
|
+
/** Whether to open the browser, defaults to true */
|
|
21
|
+
open?: boolean;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../connect-build/types.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,MAAM,MAAM,mBAAmB,GAAG;IAChC,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,8FAA8F;IAC9F,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,wEAAwE;IACxE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uFAAuF;IACvF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,qDAAqD;AACrD,MAAM,MAAM,qBAAqB,GAAG;IAClC,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../connect-build/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { externalIds, generateImportMapPlugin, viteConnectDevStudioPlugin, viteLoadExternalPackages, } from "#connect-utils";
|
|
2
2
|
export { startConnectStudio } from "./studio.js";
|
|
3
3
|
export type { ConnectStudioOptions } from "./types.js";
|
|
4
|
-
export { externalIds } from "./vite-plugins/base.js";
|
|
5
|
-
export { viteLoadExternalPackages } from "./vite-plugins/external-packages.js";
|
|
6
|
-
export { generateImportMapPlugin } from "./vite-plugins/importmap.js";
|
|
7
|
-
export { viteConnectDevStudioPlugin } from "./vite-plugins/studio.js";
|
|
8
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../connect-studio/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../connect-studio/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,YAAY,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { externalIds, generateImportMapPlugin, viteConnectDevStudioPlugin, viteLoadExternalPackages, } from "#connect-utils";
|
|
2
2
|
export { startConnectStudio } from "./studio.js";
|
|
3
|
-
export { externalIds } from "./vite-plugins/base.js";
|
|
4
|
-
export { viteLoadExternalPackages } from "./vite-plugins/external-packages.js";
|
|
5
|
-
export { generateImportMapPlugin } from "./vite-plugins/importmap.js";
|
|
6
|
-
export { viteConnectDevStudioPlugin } from "./vite-plugins/studio.js";
|
|
7
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../connect-studio/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../connect-studio/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../connect-studio/server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../connect-studio/server.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAiBrD,wBAAsB,WAAW,CAC/B,OAAO,GAAE,kBAER,iBAgGF"}
|
|
@@ -1,25 +1,11 @@
|
|
|
1
|
+
import { backupIndexHtml, copyConnect, ensureNodeVersion, generateImportMapPlugin, resolveConnect, runShellScriptPlugin, viteConnectDevStudioPlugin, viteLoadExternalPackages, } from "#connect-utils";
|
|
1
2
|
import tailwindcss from "@tailwindcss/vite";
|
|
2
3
|
import basicSsl from "@vitejs/plugin-basic-ssl";
|
|
3
4
|
import viteReact from "@vitejs/plugin-react";
|
|
4
|
-
import { exec } from "node:child_process";
|
|
5
5
|
import fs from "node:fs";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { createLogger, createServer, } from "vite";
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
import { createLogger, createServer } from "vite";
|
|
9
8
|
import { viteEnvs } from "vite-envs";
|
|
10
|
-
import { backupIndexHtml, copyConnect, removeBase64EnvValues, } from "./helpers.js";
|
|
11
|
-
import { viteLoadExternalPackages } from "./vite-plugins/external-packages.js";
|
|
12
|
-
import { generateImportMapPlugin } from "./vite-plugins/importmap.js";
|
|
13
|
-
import { viteConnectDevStudioPlugin } from "./vite-plugins/studio.js";
|
|
14
|
-
function resolvePackage(packageName, root = process.cwd()) {
|
|
15
|
-
// find connect installation
|
|
16
|
-
const require = createRequire(root);
|
|
17
|
-
return require.resolve(packageName, { paths: [root] });
|
|
18
|
-
}
|
|
19
|
-
function resolveConnect(root = process.cwd()) {
|
|
20
|
-
const connectHTMLPath = resolvePackage("@powerhousedao/connect", root);
|
|
21
|
-
return resolve(connectHTMLPath, "..");
|
|
22
|
-
}
|
|
23
9
|
// silences dynamic import warnings
|
|
24
10
|
const logger = createLogger();
|
|
25
11
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
@@ -34,36 +20,6 @@ logger.warn = (msg, options) => {
|
|
|
34
20
|
}
|
|
35
21
|
loggerWarn(msg, options);
|
|
36
22
|
};
|
|
37
|
-
function ensureNodeVersion(minVersion = "20") {
|
|
38
|
-
const version = process.versions.node;
|
|
39
|
-
if (!version) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
if (version < minVersion) {
|
|
43
|
-
console.error(`Node version ${minVersion} or higher is required. Current version: ${version}`);
|
|
44
|
-
process.exit(1);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function runShellScriptPlugin(scriptName, connectPath) {
|
|
48
|
-
return {
|
|
49
|
-
name: "vite-plugin-run-shell-script",
|
|
50
|
-
buildStart() {
|
|
51
|
-
const scriptPath = join(connectPath, scriptName);
|
|
52
|
-
if (fs.existsSync(scriptPath)) {
|
|
53
|
-
exec(`sh ${scriptPath}`, (error, stdout, stderr) => {
|
|
54
|
-
if (error) {
|
|
55
|
-
console.error(`Error executing the script: ${error.message}`);
|
|
56
|
-
removeBase64EnvValues(connectPath);
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
if (stderr) {
|
|
60
|
-
console.error(stderr);
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
23
|
export async function startServer(options = {
|
|
68
24
|
logLevel: "info",
|
|
69
25
|
}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../connect-studio/server.ts"],"names":[],"mappings":"AAAA,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AQ,EAAE,QAAQ,EAAE;aAC1C,CAAC;SACH;KACF,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;IAE1C,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC;IAEtB,MAAM,CAAC,SAAS,EAAE,CAAC;IACnB,MAAM,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"studio.js","sourceRoot":"","sources":["../../connect-studio/studio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"studio.js","sourceRoot":"","sources":["../../connect-studio/studio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACjD,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,IA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OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;QACxC,CAAC;IACH,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,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,OAAO,WAAW,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QAChD,MAAM,KAAK,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type PowerhouseConfig } from "@powerhousedao/config/powerhouse";
|
|
2
|
+
import { type Plugin } from "vite";
|
|
3
|
+
export declare function resolvePackage(packageName: string, root?: string): string;
|
|
4
|
+
/**
|
|
5
|
+
* Finds the dist dir of Connect on the local machine
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolveConnect(root?: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* Copies the Connect dist dir to the target path
|
|
10
|
+
*/
|
|
11
|
+
export declare function copyConnect(sourcePath: string, targetPath: string): void;
|
|
12
|
+
/**
|
|
13
|
+
* Backs up the index.html file
|
|
14
|
+
*
|
|
15
|
+
* Needed when running the Connect Studio dev server on Windows
|
|
16
|
+
*/
|
|
17
|
+
export declare function backupIndexHtml(appPath: string, restore?: boolean): void;
|
|
18
|
+
export declare function removeBase64EnvValues(appPath: string): void;
|
|
19
|
+
export declare function readJsonFile(filePath: string): PowerhouseConfig | null;
|
|
20
|
+
/**
|
|
21
|
+
* 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.
|
|
22
|
+
*/
|
|
23
|
+
export declare function makeImportScriptFromPackages(args: {
|
|
24
|
+
packages: string[];
|
|
25
|
+
localPackage: boolean;
|
|
26
|
+
hasStyles: boolean;
|
|
27
|
+
hasModule: boolean;
|
|
28
|
+
localJsPath: string;
|
|
29
|
+
localCssPath: string;
|
|
30
|
+
localPackageId: string;
|
|
31
|
+
}): string;
|
|
32
|
+
export declare function ensureNodeVersion(minVersion?: string): void;
|
|
33
|
+
export declare function runShellScriptPlugin(scriptName: string, connectPath: string): Plugin;
|
|
34
|
+
/**
|
|
35
|
+
* Appends the contents to the <head> tag of the index.html file
|
|
36
|
+
*/
|
|
37
|
+
export declare function appendToHtmlHead(pathToHtml: string, contents: string): Promise<void>;
|
|
38
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../connect-utils/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAMzE,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,SAAgB,UAIvE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,SAAgB,UAGlD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAUjE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,UAAQ,QAS/D;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,QAiCpD;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAStE;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE;IACjD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CACxB,UAkDA;AAED,wBAAgB,iBAAiB,CAAC,UAAU,SAAO,QAYlD;AAED,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,MAAM,CAmBR;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAiB1E"}
|