@powerhousedao/builder-tools 6.0.2-staging.1 → 6.0.2-staging.3

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 (41) hide show
  1. package/dist/index.d.mts +175 -0
  2. package/dist/index.d.mts.map +1 -0
  3. package/dist/index.mjs +628 -0
  4. package/dist/index.mjs.map +1 -0
  5. package/package.json +14 -23
  6. package/dist/bundle.d.ts +0 -2
  7. package/dist/bundle.d.ts.map +0 -1
  8. package/dist/connect-utils/build.d.ts +0 -3
  9. package/dist/connect-utils/build.d.ts.map +0 -1
  10. package/dist/connect-utils/constants.d.ts +0 -5
  11. package/dist/connect-utils/constants.d.ts.map +0 -1
  12. package/dist/connect-utils/helpers.d.ts +0 -48
  13. package/dist/connect-utils/helpers.d.ts.map +0 -1
  14. package/dist/connect-utils/index.d.ts +0 -15
  15. package/dist/connect-utils/index.d.ts.map +0 -1
  16. package/dist/connect-utils/preview.d.ts +0 -3
  17. package/dist/connect-utils/preview.d.ts.map +0 -1
  18. package/dist/connect-utils/studio.d.ts +0 -7
  19. package/dist/connect-utils/studio.d.ts.map +0 -1
  20. package/dist/connect-utils/types.d.ts +0 -37
  21. package/dist/connect-utils/types.d.ts.map +0 -1
  22. package/dist/connect-utils/vite-config.d.ts +0 -61
  23. package/dist/connect-utils/vite-config.d.ts.map +0 -1
  24. package/dist/connect-utils/vite-plugins/base.d.ts +0 -10
  25. package/dist/connect-utils/vite-plugins/base.d.ts.map +0 -1
  26. package/dist/connect-utils/vite-plugins/document-models-hmr.d.ts +0 -3
  27. package/dist/connect-utils/vite-plugins/document-models-hmr.d.ts.map +0 -1
  28. package/dist/connect-utils/vite-plugins/editors-hmr.d.ts +0 -3
  29. package/dist/connect-utils/vite-plugins/editors-hmr.d.ts.map +0 -1
  30. package/dist/connect-utils/vite-plugins/external-packages.d.ts +0 -3
  31. package/dist/connect-utils/vite-plugins/external-packages.d.ts.map +0 -1
  32. package/dist/connect-utils/vite-plugins/importmap.d.ts +0 -23
  33. package/dist/connect-utils/vite-plugins/importmap.d.ts.map +0 -1
  34. package/dist/connect-utils/vite-plugins/ph-external-packages.d.ts +0 -2
  35. package/dist/connect-utils/vite-plugins/ph-external-packages.d.ts.map +0 -1
  36. package/dist/connect-utils/vite-plugins/studio.d.ts +0 -3
  37. package/dist/connect-utils/vite-plugins/studio.d.ts.map +0 -1
  38. package/dist/index.d.ts +0 -2
  39. package/dist/index.d.ts.map +0 -1
  40. package/dist/index.js +0 -111943
  41. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,175 @@
1
+ import { CommonServerOptions, HtmlTagDescriptor, InlineConfig, Plugin } from "vite";
2
+ import { PowerhouseConfig } from "@powerhousedao/config";
3
+
4
+ //#region connect-utils/constants.d.ts
5
+ declare const EXTERNAL_PACKAGES_IMPORT = "PH:EXTERNAL_PACKAGES";
6
+ declare const IMPORT_SCRIPT_FILE = "external-packages.js";
7
+ declare const LOCAL_PACKAGE_ID = "ph:local-package";
8
+ declare const PH_DIR_NAME = ".ph";
9
+ //#endregion
10
+ //#region connect-utils/types.d.ts
11
+ type IConnectOptions = {
12
+ mode: string;
13
+ dirname: string;
14
+ envDir?: string;
15
+ powerhouseConfig?: PowerhouseConfig;
16
+ watchTimeout?: number;
17
+ };
18
+ type ConnectCommonOptions = {
19
+ base?: string;
20
+ mode?: string;
21
+ configFile?: string;
22
+ projectRoot?: string;
23
+ viteConfigFile?: string;
24
+ disableLocalPackage?: boolean;
25
+ defaultDrivesUrl?: string[];
26
+ drivesPreserveStrategy?: "preserve-all" | "preserve-by-url-and-detach";
27
+ };
28
+ type ViteDevOptions = Pick<CommonServerOptions, "port" | "host" | "open" | "cors" | "strictPort"> & {
29
+ force?: boolean;
30
+ };
31
+ type ConnectStudioOptions = ConnectCommonOptions & {
32
+ devServerOptions?: ViteDevOptions;
33
+ printUrls?: boolean;
34
+ bindCLIShortcuts?: boolean;
35
+ };
36
+ type ConnectBuildOptions = ConnectCommonOptions & {
37
+ outDir?: string;
38
+ };
39
+ type ConnectPreviewOptions = ConnectCommonOptions & Omit<ViteDevOptions, "cors"> & {
40
+ outDir?: string;
41
+ printUrls?: boolean;
42
+ bindCLIShortcuts?: boolean;
43
+ };
44
+ //#endregion
45
+ //#region connect-utils/helpers.d.ts
46
+ declare const DEFAULT_CONNECT_OUTDIR: ".ph/connect-build/dist/";
47
+ declare function commonConnectOptionsToEnv(options: ConnectCommonOptions): void;
48
+ declare function resolveViteConfigPath(options: Pick<ConnectCommonOptions, "projectRoot" | "viteConfigFile">): string;
49
+ declare function resolvePackage(packageName: string, root?: string): string;
50
+ declare function resolveConnectPackageJson(root?: string): JSON | null;
51
+ /**
52
+ * Finds the dist dir of Connect on the local machine
53
+ */
54
+ declare function resolveConnectBundle(root?: string): string;
55
+ declare function resolveConnectPublicDir(root?: string): string;
56
+ /**
57
+ * Copies the Connect dist dir to the target path
58
+ */
59
+ declare function copyConnect(sourcePath: string, targetPath: string): void;
60
+ /**
61
+ * Backs up the index.html file
62
+ *
63
+ * Needed when running the Connect Studio dev server on Windows
64
+ */
65
+ declare function backupIndexHtml(appPath: string, restore?: boolean): void;
66
+ declare function removeBase64EnvValues(appPath: string): void;
67
+ declare function readJsonFile(filePath: string): PowerhouseConfig | null;
68
+ /**
69
+ * 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.
70
+ */
71
+ declare function makeImportScriptFromPackages(args: {
72
+ packages: string[];
73
+ importStyles?: boolean;
74
+ localJsPath?: string;
75
+ localCssPath?: string;
76
+ }): string;
77
+ declare function ensureNodeVersion(minVersion?: string): void;
78
+ declare function runShellScriptPlugin(scriptName: string, connectPath: string): Plugin;
79
+ /**
80
+ * Appends the contents to the <head> tag of the index.html file
81
+ */
82
+ declare function appendToHtmlHead(pathToHtml: string, contents: string): Promise<void>;
83
+ /**
84
+ * Prepends the contents to the <head> tag of the index.html file
85
+ */
86
+ declare function prependToHtmlHead(pathToHtml: string, contents: string): Promise<void>;
87
+ declare function runTsc(outDir: string): void;
88
+ declare function stripVersionFromPackage(packageName: string): string;
89
+ //#endregion
90
+ //#region connect-utils/vite-config.d.ts
91
+ declare function getConnectHtmlTags(options?: {
92
+ registryUrl?: string | null;
93
+ injectTo?: HtmlTagDescriptor["injectTo"];
94
+ }): [{
95
+ readonly tag: "meta";
96
+ readonly attrs: {
97
+ readonly "http-equiv": "Content-Security-Policy";
98
+ readonly content: `script-src 'self' 'unsafe-inline' 'unsafe-eval' https://esm.sh${string}; object-src 'none'; base-uri 'self';`;
99
+ };
100
+ readonly injectTo: "head" | "body" | "head-prepend" | "body-prepend";
101
+ }, {
102
+ readonly tag: "meta";
103
+ readonly attrs: {
104
+ readonly property: "og:title";
105
+ readonly content: "Connect";
106
+ };
107
+ readonly injectTo: "head" | "body" | "head-prepend" | "body-prepend";
108
+ }, {
109
+ readonly tag: "meta";
110
+ readonly attrs: {
111
+ readonly property: "og:type";
112
+ readonly content: "website";
113
+ };
114
+ readonly injectTo: "head" | "body" | "head-prepend" | "body-prepend";
115
+ }, {
116
+ readonly tag: "meta";
117
+ readonly attrs: {
118
+ readonly property: "og:url";
119
+ readonly content: "https://apps.powerhouse.io/powerhouse/connect/";
120
+ };
121
+ readonly injectTo: "head" | "body" | "head-prepend" | "body-prepend";
122
+ }, {
123
+ readonly tag: "meta";
124
+ readonly attrs: {
125
+ readonly property: "og:description";
126
+ 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.";
127
+ };
128
+ readonly injectTo: "head" | "body" | "head-prepend" | "body-prepend";
129
+ }, {
130
+ readonly tag: "meta";
131
+ readonly attrs: {
132
+ readonly property: "og:image";
133
+ readonly content: "https://cf-ipfs.com/ipfs/bafkreigrmclndf2jpbolaq22535q2sw5t44uad3az3dpvkzrnt4lpjt63e";
134
+ };
135
+ readonly injectTo: "head" | "body" | "head-prepend" | "body-prepend";
136
+ }, {
137
+ readonly tag: "meta";
138
+ readonly attrs: {
139
+ readonly name: "twitter:card";
140
+ readonly content: "summary_large_image";
141
+ };
142
+ readonly injectTo: "head" | "body" | "head-prepend" | "body-prepend";
143
+ }, {
144
+ readonly tag: "meta";
145
+ readonly attrs: {
146
+ readonly name: "twitter:image";
147
+ readonly content: "https://cf-ipfs.com/ipfs/bafkreigrmclndf2jpbolaq22535q2sw5t44uad3az3dpvkzrnt4lpjt63e";
148
+ };
149
+ readonly injectTo: "head" | "body" | "head-prepend" | "body-prepend";
150
+ }, {
151
+ readonly tag: "meta";
152
+ readonly attrs: {
153
+ readonly name: "twitter:title";
154
+ readonly content: "Connect";
155
+ };
156
+ readonly injectTo: "head" | "body" | "head-prepend" | "body-prepend";
157
+ }, {
158
+ readonly tag: "meta";
159
+ readonly attrs: {
160
+ readonly name: "twitter:description";
161
+ 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.";
162
+ };
163
+ readonly injectTo: "head" | "body" | "head-prepend" | "body-prepend";
164
+ }];
165
+ declare function getConnectBaseViteConfig(options: IConnectOptions): InlineConfig;
166
+ //#endregion
167
+ //#region connect-utils/vite-plugins/ph-packages.d.ts
168
+ type PhPackagesPluginOptions = {
169
+ packages: string[];
170
+ projectRoot?: string;
171
+ };
172
+ declare function phPackagesPlugin(options: PhPackagesPluginOptions): Plugin;
173
+ //#endregion
174
+ export { ConnectBuildOptions, ConnectCommonOptions, ConnectPreviewOptions, ConnectStudioOptions, DEFAULT_CONNECT_OUTDIR, EXTERNAL_PACKAGES_IMPORT, IConnectOptions, IMPORT_SCRIPT_FILE, LOCAL_PACKAGE_ID, PH_DIR_NAME, PhPackagesPluginOptions, ViteDevOptions, appendToHtmlHead, backupIndexHtml, commonConnectOptionsToEnv, copyConnect, ensureNodeVersion, getConnectBaseViteConfig, getConnectHtmlTags, makeImportScriptFromPackages, phPackagesPlugin, prependToHtmlHead, readJsonFile, removeBase64EnvValues, resolveConnectBundle, resolveConnectPackageJson, resolveConnectPublicDir, resolvePackage, resolveViteConfigPath, runShellScriptPlugin, runTsc, stripVersionFromPackage };
175
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../connect-utils/constants.ts","../connect-utils/types.ts","../connect-utils/helpers.ts","../connect-utils/vite-config.ts","../connect-utils/vite-plugins/ph-packages.ts"],"mappings":";;;;cAAa,wBAAA;AAAA,cACA,kBAAA;AAAA,cACA,gBAAA;AAAA,cACA,WAAA;;;KCAD,eAAA;EACV,IAAA;EACA,OAAA;EACA,MAAA;EACA,gBAAA,GAAmB,gBAAA;EACnB,YAAA;AAAA;AAAA,KAGU,oBAAA;EAEV,IAAA;EAEA,IAAA;EAEA,UAAA;EAEA,WAAA;EAEA,cAAA;EAEA,mBAAA;EAEA,gBAAA;EAEA,sBAAA;AAAA;AAAA,KAGU,cAAA,GAAiB,IAAA,CAC3B,mBAAA;EAEI,KAAA;AAAA;AAAA,KAEM,oBAAA,GAAuB,oBAAA;EACjC,gBAAA,GAAmB,cAAA;EACnB,SAAA;EACA,gBAAA;AAAA;AAAA,KAGU,mBAAA,GAAsB,oBAAA;EAEhC,MAAA;AAAA;AAAA,KAGU,qBAAA,GAAwB,oBAAA,GAClC,IAAA,CAAK,cAAA;EAEH,MAAA;EACA,SAAA;EACA,gBAAA;AAAA;;;cCvCS,sBAAA;AAAA,iBAEG,yBAAA,CAA0B,OAAA,EAAS,oBAAA;AAAA,iBAqCnC,qBAAA,CACd,OAAA,EAAS,IAAA,CAAK,oBAAA;AAAA,iBAMA,cAAA,CAAe,WAAA,UAAqB,IAAA;AAAA,iBAMpC,yBAAA,CAA0B,IAAA,YAAoB,IAAA;;AF/D9D;;iBEgFgB,oBAAA,CAAqB,IAAA;AAAA,iBASrB,uBAAA,CAAwB,IAAA;;AFxFxC;;iBEmGgB,WAAA,CAAY,UAAA,UAAoB,UAAA;;;AFlGhD;;;iBEmHgB,eAAA,CAAgB,OAAA,UAAiB,OAAA;AAAA,iBAWjC,qBAAA,CAAsB,OAAA;AAAA,iBAmCtB,YAAA,CAAa,QAAA,WAAmB,gBAAA;;;ADjKhD;iBC+KgB,4BAAA,CAA6B,IAAA;EAC3C,QAAA;EACA,YAAA;EACA,WAAA;EACA,YAAA;AAAA;AAAA,iBAsDc,iBAAA,CAAkB,UAAA;AAAA,iBAclB,oBAAA,CACd,UAAA,UACA,WAAA,WACC,MAAA;;;;iBAwCmB,gBAAA,CAAiB,UAAA,UAAoB,QAAA,WAAgB,OAAA;;;;iBAYrD,iBAAA,CAAkB,UAAA,UAAoB,QAAA,WAAgB,OAAA;AAAA,iBAS5D,MAAA,CAAO,MAAA;AAAA,iBAMP,uBAAA,CAAwB,WAAA;;;iBC3RxB,kBAAA,CACd,OAAA;EACE,WAAA;EACA,QAAA,GAAW,iBAAA;AAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8IC,wBAAA,CAAyB,OAAA,EAAS,eAAA,GAAe,YAAA;;;KClLrD,uBAAA;EACV,QAAA;EACA,WAAA;AAAA;AAAA,iBAsBc,gBAAA,CAAiB,OAAA,EAAS,uBAAA,GAA0B,MAAA"}