everything-dev 1.26.0 → 1.26.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/dist/cli/init.cjs +6 -1
- package/dist/cli/init.cjs.map +1 -1
- package/dist/cli/init.d.cts +2 -1
- package/dist/cli/init.d.cts.map +1 -1
- package/dist/cli/init.d.mts +2 -1
- package/dist/cli/init.d.mts.map +1 -1
- package/dist/cli/init.mjs +6 -2
- package/dist/cli/init.mjs.map +1 -1
- package/dist/cli/prompts.cjs +3 -3
- package/dist/cli/prompts.cjs.map +1 -1
- package/dist/cli/prompts.mjs +2 -2
- package/dist/cli/prompts.mjs.map +1 -1
- package/dist/cli/upgrade.cjs +2 -2
- package/dist/cli/upgrade.mjs +1 -1
- package/dist/contract.d.cts +11 -11
- package/dist/contract.d.mts +11 -11
- package/dist/contract.meta.cjs +1 -1
- package/dist/contract.meta.cjs.map +1 -1
- package/dist/contract.meta.d.cts +1 -1
- package/dist/contract.meta.d.mts +1 -1
- package/dist/contract.meta.mjs +1 -1
- package/dist/contract.meta.mjs.map +1 -1
- package/dist/plugin.cjs +52 -17
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +7 -7
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts +7 -7
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +36 -2
- package/dist/plugin.mjs.map +1 -1
- package/dist/types.d.cts +4 -4
- package/dist/types.d.mts +4 -4
- package/package.json +1 -1
- package/src/cli/init.ts +12 -1
- package/src/cli/prompts.ts +1 -1
- package/src/contract.meta.ts +1 -1
- package/src/plugin.ts +57 -0
package/dist/contract.d.mts
CHANGED
|
@@ -263,8 +263,8 @@ declare const PublishOptionsSchema: z.ZodObject<{
|
|
|
263
263
|
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
264
264
|
packages: z.ZodDefault<z.ZodString>;
|
|
265
265
|
network: z.ZodOptional<z.ZodEnum<{
|
|
266
|
-
testnet: "testnet";
|
|
267
266
|
mainnet: "mainnet";
|
|
267
|
+
testnet: "testnet";
|
|
268
268
|
}>>;
|
|
269
269
|
privateKey: z.ZodOptional<z.ZodString>;
|
|
270
270
|
}, z.core.$strip>;
|
|
@@ -290,8 +290,8 @@ declare const KeyPublishResultSchema: z.ZodObject<{
|
|
|
290
290
|
}>;
|
|
291
291
|
account: z.ZodString;
|
|
292
292
|
network: z.ZodEnum<{
|
|
293
|
-
testnet: "testnet";
|
|
294
293
|
mainnet: "mainnet";
|
|
294
|
+
testnet: "testnet";
|
|
295
295
|
}>;
|
|
296
296
|
contract: z.ZodString;
|
|
297
297
|
allowance: z.ZodString;
|
|
@@ -303,8 +303,8 @@ declare const KeyPublishResultSchema: z.ZodObject<{
|
|
|
303
303
|
declare const OverrideSectionSchema: z.ZodEnum<{
|
|
304
304
|
plugins: "plugins";
|
|
305
305
|
ui: "ui";
|
|
306
|
-
host: "host";
|
|
307
306
|
api: "api";
|
|
307
|
+
host: "host";
|
|
308
308
|
}>;
|
|
309
309
|
declare const InitOptionsSchema: z.ZodObject<{
|
|
310
310
|
extends: z.ZodOptional<z.ZodString>;
|
|
@@ -316,8 +316,8 @@ declare const InitOptionsSchema: z.ZodObject<{
|
|
|
316
316
|
overrides: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
317
317
|
plugins: "plugins";
|
|
318
318
|
ui: "ui";
|
|
319
|
-
host: "host";
|
|
320
319
|
api: "api";
|
|
320
|
+
host: "host";
|
|
321
321
|
}>>>;
|
|
322
322
|
noInteractive: z.ZodDefault<z.ZodBoolean>;
|
|
323
323
|
noInstall: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -340,8 +340,8 @@ declare const InitResultSchema: z.ZodObject<{
|
|
|
340
340
|
overrides: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
341
341
|
plugins: "plugins";
|
|
342
342
|
ui: "ui";
|
|
343
|
-
host: "host";
|
|
344
343
|
api: "api";
|
|
344
|
+
host: "host";
|
|
345
345
|
}>>>;
|
|
346
346
|
filesCopied: z.ZodNumber;
|
|
347
347
|
timings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -428,8 +428,8 @@ declare const StatusResultSchema: z.ZodObject<{
|
|
|
428
428
|
}, z.core.$strip>;
|
|
429
429
|
declare const TypesGenOptionsSchema: z.ZodObject<{
|
|
430
430
|
env: z.ZodOptional<z.ZodEnum<{
|
|
431
|
-
development: "development";
|
|
432
431
|
production: "production";
|
|
432
|
+
development: "development";
|
|
433
433
|
}>>;
|
|
434
434
|
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
435
435
|
}, z.core.$strip>;
|
|
@@ -704,8 +704,8 @@ declare const bosContract: {
|
|
|
704
704
|
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
705
705
|
packages: z.ZodDefault<z.ZodString>;
|
|
706
706
|
network: z.ZodOptional<z.ZodEnum<{
|
|
707
|
-
testnet: "testnet";
|
|
708
707
|
mainnet: "mainnet";
|
|
708
|
+
testnet: "testnet";
|
|
709
709
|
}>>;
|
|
710
710
|
privateKey: z.ZodOptional<z.ZodString>;
|
|
711
711
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -729,8 +729,8 @@ declare const bosContract: {
|
|
|
729
729
|
}>;
|
|
730
730
|
account: z.ZodString;
|
|
731
731
|
network: z.ZodEnum<{
|
|
732
|
-
testnet: "testnet";
|
|
733
732
|
mainnet: "mainnet";
|
|
733
|
+
testnet: "testnet";
|
|
734
734
|
}>;
|
|
735
735
|
contract: z.ZodString;
|
|
736
736
|
allowance: z.ZodString;
|
|
@@ -749,8 +749,8 @@ declare const bosContract: {
|
|
|
749
749
|
overrides: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
750
750
|
plugins: "plugins";
|
|
751
751
|
ui: "ui";
|
|
752
|
-
host: "host";
|
|
753
752
|
api: "api";
|
|
753
|
+
host: "host";
|
|
754
754
|
}>>>;
|
|
755
755
|
noInteractive: z.ZodDefault<z.ZodBoolean>;
|
|
756
756
|
noInstall: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -768,8 +768,8 @@ declare const bosContract: {
|
|
|
768
768
|
overrides: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
769
769
|
plugins: "plugins";
|
|
770
770
|
ui: "ui";
|
|
771
|
-
host: "host";
|
|
772
771
|
api: "api";
|
|
772
|
+
host: "host";
|
|
773
773
|
}>>>;
|
|
774
774
|
filesCopied: z.ZodNumber;
|
|
775
775
|
timings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -854,8 +854,8 @@ declare const bosContract: {
|
|
|
854
854
|
}, z.core.$strip>, MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
855
855
|
typesGen: ContractProcedure<z.ZodObject<{
|
|
856
856
|
env: z.ZodOptional<z.ZodEnum<{
|
|
857
|
-
development: "development";
|
|
858
857
|
production: "production";
|
|
858
|
+
development: "development";
|
|
859
859
|
}>>;
|
|
860
860
|
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
861
861
|
}, z.core.$strip>, z.ZodObject<{
|
package/dist/contract.meta.cjs
CHANGED
|
@@ -89,7 +89,7 @@ const cliCommandMeta = {
|
|
|
89
89
|
directory: { description: "Target directory (auto-derived from domain)" },
|
|
90
90
|
source: { description: "Local source dir (skips GitHub download)" },
|
|
91
91
|
plugins: { description: "Comma-separated plugin keys to include (requires --overrides=plugins)" },
|
|
92
|
-
overrides: { description: "Comma-separated sections to
|
|
92
|
+
overrides: { description: "Comma-separated sections to customize locally: ui,api,host,plugins" },
|
|
93
93
|
noInteractive: { description: "Skip prompts, use flags only" },
|
|
94
94
|
noInstall: { description: "Skip bun install" }
|
|
95
95
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.meta.cjs","names":[],"sources":["../src/contract.meta.ts"],"sourcesContent":["export type CliCommandMeta = {\n commandPath?: string[];\n summary: string;\n description?: string;\n examples?: string[];\n interactive?: boolean;\n longRunning?: boolean;\n fields?: Record<string, { positional?: boolean; description?: string }>;\n};\n\nexport const cliCommandMeta = {\n dev: {\n commandPath: [\"dev\"],\n summary: \"Start a development session\",\n interactive: true,\n longRunning: true,\n },\n start: {\n commandPath: [\"start\"],\n summary: \"Start the production host\",\n interactive: false,\n longRunning: true,\n fields: {\n env: { description: \"Environment: production or staging\" },\n },\n },\n build: {\n commandPath: [\"build\"],\n summary: \"Build selected workspaces\",\n interactive: false,\n fields: {\n packages: { positional: true, description: \"Comma-separated package list\" },\n },\n },\n config: {\n commandPath: [\"config\"],\n summary: \"Print the loaded BOS configuration\",\n interactive: false,\n },\n pluginAdd: {\n commandPath: [\"plugin\", \"add\"],\n summary: \"Add a plugin attachment\",\n interactive: false,\n fields: {\n source: {\n positional: true,\n description: \"Plugin source (local:path, bos://account/domain, or URL)\",\n },\n as: { description: \"Plugin alias\" },\n production: { description: \"Production URL override\" },\n },\n },\n pluginRemove: {\n commandPath: [\"plugin\", \"remove\"],\n summary: \"Remove a plugin attachment\",\n interactive: false,\n fields: { key: { positional: true, description: \"Plugin key\" } },\n },\n pluginList: {\n commandPath: [\"plugin\", \"list\"],\n summary: \"List configured plugins\",\n interactive: false,\n },\n pluginPublish: {\n commandPath: [\"plugin\", \"publish\"],\n summary: \"Publish a single plugin\",\n interactive: false,\n fields: { key: { positional: true, description: \"Plugin key\" } },\n },\n publish: {\n commandPath: [\"publish\"],\n summary: \"Publish the current workspace configuration\",\n interactive: false,\n },\n keyPublish: {\n commandPath: [\"key\", \"publish\"],\n summary: \"Generate a publish access key\",\n interactive: false,\n },\n init: {\n commandPath: [\"init\"],\n summary: \"Scaffold a new project by extending a deployed app or template\",\n interactive: true,\n fields: {\n domain: {\n positional: true,\n description: \"New project domain (e.g. myapp.everything.dev)\",\n },\n extends: {\n description: \"Parent to extend from (e.g. bos://account/gateway or account/gateway)\",\n },\n account: { description: \"New project NEAR account (auto-derived from extends)\" },\n directory: { description: \"Target directory (auto-derived from domain)\" },\n source: { description: \"Local source dir (skips GitHub download)\" },\n plugins: {\n description: \"Comma-separated plugin keys to include (requires --overrides=plugins)\",\n },\n overrides: {\n description: \"Comma-separated sections to
|
|
1
|
+
{"version":3,"file":"contract.meta.cjs","names":[],"sources":["../src/contract.meta.ts"],"sourcesContent":["export type CliCommandMeta = {\n commandPath?: string[];\n summary: string;\n description?: string;\n examples?: string[];\n interactive?: boolean;\n longRunning?: boolean;\n fields?: Record<string, { positional?: boolean; description?: string }>;\n};\n\nexport const cliCommandMeta = {\n dev: {\n commandPath: [\"dev\"],\n summary: \"Start a development session\",\n interactive: true,\n longRunning: true,\n },\n start: {\n commandPath: [\"start\"],\n summary: \"Start the production host\",\n interactive: false,\n longRunning: true,\n fields: {\n env: { description: \"Environment: production or staging\" },\n },\n },\n build: {\n commandPath: [\"build\"],\n summary: \"Build selected workspaces\",\n interactive: false,\n fields: {\n packages: { positional: true, description: \"Comma-separated package list\" },\n },\n },\n config: {\n commandPath: [\"config\"],\n summary: \"Print the loaded BOS configuration\",\n interactive: false,\n },\n pluginAdd: {\n commandPath: [\"plugin\", \"add\"],\n summary: \"Add a plugin attachment\",\n interactive: false,\n fields: {\n source: {\n positional: true,\n description: \"Plugin source (local:path, bos://account/domain, or URL)\",\n },\n as: { description: \"Plugin alias\" },\n production: { description: \"Production URL override\" },\n },\n },\n pluginRemove: {\n commandPath: [\"plugin\", \"remove\"],\n summary: \"Remove a plugin attachment\",\n interactive: false,\n fields: { key: { positional: true, description: \"Plugin key\" } },\n },\n pluginList: {\n commandPath: [\"plugin\", \"list\"],\n summary: \"List configured plugins\",\n interactive: false,\n },\n pluginPublish: {\n commandPath: [\"plugin\", \"publish\"],\n summary: \"Publish a single plugin\",\n interactive: false,\n fields: { key: { positional: true, description: \"Plugin key\" } },\n },\n publish: {\n commandPath: [\"publish\"],\n summary: \"Publish the current workspace configuration\",\n interactive: false,\n },\n keyPublish: {\n commandPath: [\"key\", \"publish\"],\n summary: \"Generate a publish access key\",\n interactive: false,\n },\n init: {\n commandPath: [\"init\"],\n summary: \"Scaffold a new project by extending a deployed app or template\",\n interactive: true,\n fields: {\n domain: {\n positional: true,\n description: \"New project domain (e.g. myapp.everything.dev)\",\n },\n extends: {\n description: \"Parent to extend from (e.g. bos://account/gateway or account/gateway)\",\n },\n account: { description: \"New project NEAR account (auto-derived from extends)\" },\n directory: { description: \"Target directory (auto-derived from domain)\" },\n source: { description: \"Local source dir (skips GitHub download)\" },\n plugins: {\n description: \"Comma-separated plugin keys to include (requires --overrides=plugins)\",\n },\n overrides: {\n description: \"Comma-separated sections to customize locally: ui,api,host,plugins\",\n },\n noInteractive: { description: \"Skip prompts, use flags only\" },\n noInstall: { description: \"Skip bun install\" },\n },\n },\n sync: {\n commandPath: [\"sync\"],\n summary: \"Sync template files from parent project\",\n interactive: false,\n fields: {\n dryRun: { description: \"Preview changes without writing files\" },\n force: { description: \"Overwrite user-modified files\" },\n noInstall: { description: \"Skip bun install\" },\n },\n },\n upgrade: {\n commandPath: [\"upgrade\"],\n summary: \"Upgrade framework packages and sync template files\",\n interactive: true,\n fields: {\n dryRun: { description: \"Preview changes without writing\" },\n force: { description: \"Overwrite user-modified files during sync\" },\n noInstall: { description: \"Skip bun install\" },\n noSync: { description: \"Only upgrade packages, skip template sync\" },\n },\n },\n typesGen: {\n commandPath: [\"types\", \"gen\"],\n summary: \"Generate type definitions from configured API and plugin contracts\",\n interactive: false,\n fields: {\n env: { description: \"Environment: development (default) or production\" },\n dryRun: { description: \"Preview what would be fetched without writing files\" },\n },\n },\n status: {\n commandPath: [\"status\"],\n summary: \"Show project health, versions, and update availability\",\n interactive: false,\n },\n} as const satisfies Record<string, CliCommandMeta>;\n"],"mappings":";;;AAUA,MAAa,iBAAiB;CAC5B,KAAK;EACH,aAAa,CAAC,MAAM;EACpB,SAAS;EACT,aAAa;EACb,aAAa;EACd;CACD,OAAO;EACL,aAAa,CAAC,QAAQ;EACtB,SAAS;EACT,aAAa;EACb,aAAa;EACb,QAAQ,EACN,KAAK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ACF;CACD,MAAM;EACJ,aAAa,CAAC,OAAO;EACrB,SAAS;EACT,aAAa;EACb,QAAQ;GACN,QAAQ,EAAE,aAAa,yCAAyC;GAChE,OAAO,EAAE,aAAa,iCAAiC;GACvD,WAAW,EAAE,aAAa,oBAAoB;GAC/C;EACF;CACD,SAAS;EACP,aAAa,CAAC,UAAU;EACxB,SAAS;EACT,aAAa;EACb,QAAQ;GACN,QAAQ,EAAE,aAAa,mCAAmC;GAC1D,OAAO,EAAE,aAAa,6CAA6C;GACnE,WAAW,EAAE,aAAa,oBAAoB;GAC9C,QAAQ,EAAE,aAAa,6CAA6C;GACrE;EACF;CACD,UAAU;EACR,aAAa,CAAC,SAAS,MAAM;EAC7B,SAAS;EACT,aAAa;EACb,QAAQ;GACN,KAAK,EAAE,aAAa,oDAAoD;GACxE,QAAQ,EAAE,aAAa,uDAAuD;GAC/E;EACF;CACD,QAAQ;EACN,aAAa,CAAC,SAAS;EACvB,SAAS;EACT,aAAa;EACd;CACF"}
|
package/dist/contract.meta.d.cts
CHANGED
|
@@ -124,7 +124,7 @@ declare const cliCommandMeta: {
|
|
|
124
124
|
readonly description: "Comma-separated plugin keys to include (requires --overrides=plugins)";
|
|
125
125
|
};
|
|
126
126
|
readonly overrides: {
|
|
127
|
-
readonly description: "Comma-separated sections to
|
|
127
|
+
readonly description: "Comma-separated sections to customize locally: ui,api,host,plugins";
|
|
128
128
|
};
|
|
129
129
|
readonly noInteractive: {
|
|
130
130
|
readonly description: "Skip prompts, use flags only";
|
package/dist/contract.meta.d.mts
CHANGED
|
@@ -124,7 +124,7 @@ declare const cliCommandMeta: {
|
|
|
124
124
|
readonly description: "Comma-separated plugin keys to include (requires --overrides=plugins)";
|
|
125
125
|
};
|
|
126
126
|
readonly overrides: {
|
|
127
|
-
readonly description: "Comma-separated sections to
|
|
127
|
+
readonly description: "Comma-separated sections to customize locally: ui,api,host,plugins";
|
|
128
128
|
};
|
|
129
129
|
readonly noInteractive: {
|
|
130
130
|
readonly description: "Skip prompts, use flags only";
|
package/dist/contract.meta.mjs
CHANGED
|
@@ -87,7 +87,7 @@ const cliCommandMeta = {
|
|
|
87
87
|
directory: { description: "Target directory (auto-derived from domain)" },
|
|
88
88
|
source: { description: "Local source dir (skips GitHub download)" },
|
|
89
89
|
plugins: { description: "Comma-separated plugin keys to include (requires --overrides=plugins)" },
|
|
90
|
-
overrides: { description: "Comma-separated sections to
|
|
90
|
+
overrides: { description: "Comma-separated sections to customize locally: ui,api,host,plugins" },
|
|
91
91
|
noInteractive: { description: "Skip prompts, use flags only" },
|
|
92
92
|
noInstall: { description: "Skip bun install" }
|
|
93
93
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.meta.mjs","names":[],"sources":["../src/contract.meta.ts"],"sourcesContent":["export type CliCommandMeta = {\n commandPath?: string[];\n summary: string;\n description?: string;\n examples?: string[];\n interactive?: boolean;\n longRunning?: boolean;\n fields?: Record<string, { positional?: boolean; description?: string }>;\n};\n\nexport const cliCommandMeta = {\n dev: {\n commandPath: [\"dev\"],\n summary: \"Start a development session\",\n interactive: true,\n longRunning: true,\n },\n start: {\n commandPath: [\"start\"],\n summary: \"Start the production host\",\n interactive: false,\n longRunning: true,\n fields: {\n env: { description: \"Environment: production or staging\" },\n },\n },\n build: {\n commandPath: [\"build\"],\n summary: \"Build selected workspaces\",\n interactive: false,\n fields: {\n packages: { positional: true, description: \"Comma-separated package list\" },\n },\n },\n config: {\n commandPath: [\"config\"],\n summary: \"Print the loaded BOS configuration\",\n interactive: false,\n },\n pluginAdd: {\n commandPath: [\"plugin\", \"add\"],\n summary: \"Add a plugin attachment\",\n interactive: false,\n fields: {\n source: {\n positional: true,\n description: \"Plugin source (local:path, bos://account/domain, or URL)\",\n },\n as: { description: \"Plugin alias\" },\n production: { description: \"Production URL override\" },\n },\n },\n pluginRemove: {\n commandPath: [\"plugin\", \"remove\"],\n summary: \"Remove a plugin attachment\",\n interactive: false,\n fields: { key: { positional: true, description: \"Plugin key\" } },\n },\n pluginList: {\n commandPath: [\"plugin\", \"list\"],\n summary: \"List configured plugins\",\n interactive: false,\n },\n pluginPublish: {\n commandPath: [\"plugin\", \"publish\"],\n summary: \"Publish a single plugin\",\n interactive: false,\n fields: { key: { positional: true, description: \"Plugin key\" } },\n },\n publish: {\n commandPath: [\"publish\"],\n summary: \"Publish the current workspace configuration\",\n interactive: false,\n },\n keyPublish: {\n commandPath: [\"key\", \"publish\"],\n summary: \"Generate a publish access key\",\n interactive: false,\n },\n init: {\n commandPath: [\"init\"],\n summary: \"Scaffold a new project by extending a deployed app or template\",\n interactive: true,\n fields: {\n domain: {\n positional: true,\n description: \"New project domain (e.g. myapp.everything.dev)\",\n },\n extends: {\n description: \"Parent to extend from (e.g. bos://account/gateway or account/gateway)\",\n },\n account: { description: \"New project NEAR account (auto-derived from extends)\" },\n directory: { description: \"Target directory (auto-derived from domain)\" },\n source: { description: \"Local source dir (skips GitHub download)\" },\n plugins: {\n description: \"Comma-separated plugin keys to include (requires --overrides=plugins)\",\n },\n overrides: {\n description: \"Comma-separated sections to
|
|
1
|
+
{"version":3,"file":"contract.meta.mjs","names":[],"sources":["../src/contract.meta.ts"],"sourcesContent":["export type CliCommandMeta = {\n commandPath?: string[];\n summary: string;\n description?: string;\n examples?: string[];\n interactive?: boolean;\n longRunning?: boolean;\n fields?: Record<string, { positional?: boolean; description?: string }>;\n};\n\nexport const cliCommandMeta = {\n dev: {\n commandPath: [\"dev\"],\n summary: \"Start a development session\",\n interactive: true,\n longRunning: true,\n },\n start: {\n commandPath: [\"start\"],\n summary: \"Start the production host\",\n interactive: false,\n longRunning: true,\n fields: {\n env: { description: \"Environment: production or staging\" },\n },\n },\n build: {\n commandPath: [\"build\"],\n summary: \"Build selected workspaces\",\n interactive: false,\n fields: {\n packages: { positional: true, description: \"Comma-separated package list\" },\n },\n },\n config: {\n commandPath: [\"config\"],\n summary: \"Print the loaded BOS configuration\",\n interactive: false,\n },\n pluginAdd: {\n commandPath: [\"plugin\", \"add\"],\n summary: \"Add a plugin attachment\",\n interactive: false,\n fields: {\n source: {\n positional: true,\n description: \"Plugin source (local:path, bos://account/domain, or URL)\",\n },\n as: { description: \"Plugin alias\" },\n production: { description: \"Production URL override\" },\n },\n },\n pluginRemove: {\n commandPath: [\"plugin\", \"remove\"],\n summary: \"Remove a plugin attachment\",\n interactive: false,\n fields: { key: { positional: true, description: \"Plugin key\" } },\n },\n pluginList: {\n commandPath: [\"plugin\", \"list\"],\n summary: \"List configured plugins\",\n interactive: false,\n },\n pluginPublish: {\n commandPath: [\"plugin\", \"publish\"],\n summary: \"Publish a single plugin\",\n interactive: false,\n fields: { key: { positional: true, description: \"Plugin key\" } },\n },\n publish: {\n commandPath: [\"publish\"],\n summary: \"Publish the current workspace configuration\",\n interactive: false,\n },\n keyPublish: {\n commandPath: [\"key\", \"publish\"],\n summary: \"Generate a publish access key\",\n interactive: false,\n },\n init: {\n commandPath: [\"init\"],\n summary: \"Scaffold a new project by extending a deployed app or template\",\n interactive: true,\n fields: {\n domain: {\n positional: true,\n description: \"New project domain (e.g. myapp.everything.dev)\",\n },\n extends: {\n description: \"Parent to extend from (e.g. bos://account/gateway or account/gateway)\",\n },\n account: { description: \"New project NEAR account (auto-derived from extends)\" },\n directory: { description: \"Target directory (auto-derived from domain)\" },\n source: { description: \"Local source dir (skips GitHub download)\" },\n plugins: {\n description: \"Comma-separated plugin keys to include (requires --overrides=plugins)\",\n },\n overrides: {\n description: \"Comma-separated sections to customize locally: ui,api,host,plugins\",\n },\n noInteractive: { description: \"Skip prompts, use flags only\" },\n noInstall: { description: \"Skip bun install\" },\n },\n },\n sync: {\n commandPath: [\"sync\"],\n summary: \"Sync template files from parent project\",\n interactive: false,\n fields: {\n dryRun: { description: \"Preview changes without writing files\" },\n force: { description: \"Overwrite user-modified files\" },\n noInstall: { description: \"Skip bun install\" },\n },\n },\n upgrade: {\n commandPath: [\"upgrade\"],\n summary: \"Upgrade framework packages and sync template files\",\n interactive: true,\n fields: {\n dryRun: { description: \"Preview changes without writing\" },\n force: { description: \"Overwrite user-modified files during sync\" },\n noInstall: { description: \"Skip bun install\" },\n noSync: { description: \"Only upgrade packages, skip template sync\" },\n },\n },\n typesGen: {\n commandPath: [\"types\", \"gen\"],\n summary: \"Generate type definitions from configured API and plugin contracts\",\n interactive: false,\n fields: {\n env: { description: \"Environment: development (default) or production\" },\n dryRun: { description: \"Preview what would be fetched without writing files\" },\n },\n },\n status: {\n commandPath: [\"status\"],\n summary: \"Show project health, versions, and update availability\",\n interactive: false,\n },\n} as const satisfies Record<string, CliCommandMeta>;\n"],"mappings":";AAUA,MAAa,iBAAiB;CAC5B,KAAK;EACH,aAAa,CAAC,MAAM;EACpB,SAAS;EACT,aAAa;EACb,aAAa;EACd;CACD,OAAO;EACL,aAAa,CAAC,QAAQ;EACtB,SAAS;EACT,aAAa;EACb,aAAa;EACb,QAAQ,EACN,KAAK,EAAE,aAAa,sCAAsC,EAC3D;EACF;CACD,OAAO;EACL,aAAa,CAAC,QAAQ;EACtB,SAAS;EACT,aAAa;EACb,QAAQ,EACN,UAAU;GAAE,YAAY;GAAM,aAAa;GAAgC,EAC5E;EACF;CACD,QAAQ;EACN,aAAa,CAAC,SAAS;EACvB,SAAS;EACT,aAAa;EACd;CACD,WAAW;EACT,aAAa,CAAC,UAAU,MAAM;EAC9B,SAAS;EACT,aAAa;EACb,QAAQ;GACN,QAAQ;IACN,YAAY;IACZ,aAAa;IACd;GACD,IAAI,EAAE,aAAa,gBAAgB;GACnC,YAAY,EAAE,aAAa,2BAA2B;GACvD;EACF;CACD,cAAc;EACZ,aAAa,CAAC,UAAU,SAAS;EACjC,SAAS;EACT,aAAa;EACb,QAAQ,EAAE,KAAK;GAAE,YAAY;GAAM,aAAa;GAAc,EAAE;EACjE;CACD,YAAY;EACV,aAAa,CAAC,UAAU,OAAO;EAC/B,SAAS;EACT,aAAa;EACd;CACD,eAAe;EACb,aAAa,CAAC,UAAU,UAAU;EAClC,SAAS;EACT,aAAa;E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('./utils/run.cjs');
|
|
|
23
23
|
const require_theme = require('./utils/theme.cjs');
|
|
24
24
|
let node_fs = require("node:fs");
|
|
25
25
|
let node_path = require("node:path");
|
|
26
|
+
let node_process = require("node:process");
|
|
27
|
+
node_process = require_runtime.__toESM(node_process, 1);
|
|
26
28
|
let _clack_prompts = require("@clack/prompts");
|
|
27
29
|
_clack_prompts = require_runtime.__toESM(_clack_prompts, 1);
|
|
28
30
|
let effect = require("effect");
|
|
@@ -176,8 +178,8 @@ async function buildEveryPluginQuietly(cwd) {
|
|
|
176
178
|
console.log("[build:ssr] build succeeded");
|
|
177
179
|
return;
|
|
178
180
|
}
|
|
179
|
-
if (result.stdout.trim())
|
|
180
|
-
if (result.stderr.trim())
|
|
181
|
+
if (result.stdout.trim()) node_process.default.stdout.write(result.stdout);
|
|
182
|
+
if (result.stderr.trim()) node_process.default.stderr.write(result.stderr);
|
|
181
183
|
throw new Error(`bun run --cwd packages/every-plugin build failed with exit code ${result.exitCode}`);
|
|
182
184
|
}
|
|
183
185
|
async function buildEverythingDevQuietly(cwd) {
|
|
@@ -198,8 +200,8 @@ async function buildEverythingDevQuietly(cwd) {
|
|
|
198
200
|
console.log("[everything-dev] build succeeded");
|
|
199
201
|
return;
|
|
200
202
|
}
|
|
201
|
-
if (result.stdout.trim())
|
|
202
|
-
if (result.stderr.trim())
|
|
203
|
+
if (result.stdout.trim()) node_process.default.stdout.write(result.stdout);
|
|
204
|
+
if (result.stderr.trim()) node_process.default.stderr.write(result.stderr);
|
|
203
205
|
throw new Error(`bun run --cwd packages/everything-dev build failed with exit code ${result.exitCode}`);
|
|
204
206
|
}
|
|
205
207
|
async function fetchPublishedConfig(accountId, gatewayId) {
|
|
@@ -239,7 +241,7 @@ async function buildWorkspaceTargets(opts) {
|
|
|
239
241
|
if (existing.some((entry) => entry.key === "api")) await buildEveryPluginQuietly(opts.configDir);
|
|
240
242
|
await buildEverythingDevQuietly(opts.configDir);
|
|
241
243
|
const env = {
|
|
242
|
-
...
|
|
244
|
+
...node_process.default.env,
|
|
243
245
|
NODE_ENV: opts.deploy ? "production" : "development"
|
|
244
246
|
};
|
|
245
247
|
if (opts.deploy) env.DEPLOY = "true";
|
|
@@ -389,16 +391,16 @@ var plugin_default = (0, every_plugin.createPlugin)({
|
|
|
389
391
|
capture: true
|
|
390
392
|
});
|
|
391
393
|
if (exitCode !== 0) {
|
|
392
|
-
if (stdout.trim())
|
|
393
|
-
if (stderr.trim())
|
|
394
|
+
if (stdout.trim()) node_process.default.stdout.write(stdout);
|
|
395
|
+
if (stderr.trim()) node_process.default.stderr.write(stderr);
|
|
394
396
|
return {
|
|
395
397
|
status: "error",
|
|
396
398
|
key: input.key,
|
|
397
399
|
error: `Publish failed with exit code ${exitCode}`
|
|
398
400
|
};
|
|
399
401
|
}
|
|
400
|
-
if (stdout.trim())
|
|
401
|
-
if (stderr.trim())
|
|
402
|
+
if (stdout.trim()) node_process.default.stdout.write(stdout);
|
|
403
|
+
if (stderr.trim()) node_process.default.stderr.write(stderr);
|
|
402
404
|
let publishedUrl = extractPublishedUrl(`${stdout}\n${stderr}`);
|
|
403
405
|
let manifest = null;
|
|
404
406
|
if (publishedUrl) manifest = await require_fastkv.fetchRemotePluginManifest(publishedUrl);
|
|
@@ -510,8 +512,8 @@ var plugin_default = (0, every_plugin.createPlugin)({
|
|
|
510
512
|
}),
|
|
511
513
|
start: builder.start.handler(async ({ input }) => {
|
|
512
514
|
require_infra.ensureEnvFile(deps.configDir);
|
|
513
|
-
const account = input.account ??
|
|
514
|
-
const domain = input.domain ??
|
|
515
|
+
const account = input.account ?? node_process.default.env.BOS_ACCOUNT;
|
|
516
|
+
const domain = input.domain ?? node_process.default.env.BOS_GATEWAY;
|
|
515
517
|
let config = null;
|
|
516
518
|
let remoteConfig = null;
|
|
517
519
|
if (account && domain) {
|
|
@@ -550,7 +552,7 @@ var plugin_default = (0, every_plugin.createPlugin)({
|
|
|
550
552
|
});
|
|
551
553
|
const productionEnv = {};
|
|
552
554
|
const warnings = [];
|
|
553
|
-
if (!
|
|
555
|
+
if (!node_process.default.env.CORS_ORIGIN && config.domain) {
|
|
554
556
|
const defaultOrigin = `https://${config.domain}`;
|
|
555
557
|
productionEnv.CORS_ORIGIN = defaultOrigin;
|
|
556
558
|
warnings.push(`CORS_ORIGIN defaulting to ${defaultOrigin}`);
|
|
@@ -561,7 +563,7 @@ var plugin_default = (0, every_plugin.createPlugin)({
|
|
|
561
563
|
if (runtimeConfig.api?.secrets) for (const s of runtimeConfig.api.secrets) requiredSecrets.add(s);
|
|
562
564
|
for (const plugin of Object.values(runtimeConfig.plugins ?? {})) if (plugin.secrets) for (const s of plugin.secrets) requiredSecrets.add(s);
|
|
563
565
|
for (const secret of requiredSecrets) {
|
|
564
|
-
const value =
|
|
566
|
+
const value = node_process.default.env[secret];
|
|
565
567
|
if (!value || value.length === 0) missingSecrets.push(secret);
|
|
566
568
|
}
|
|
567
569
|
if (missingSecrets.length > 0) warnings.push(`Missing ${missingSecrets.length} secret(s): ${missingSecrets.join(", ")}`);
|
|
@@ -692,7 +694,7 @@ var plugin_default = (0, every_plugin.createPlugin)({
|
|
|
692
694
|
const registryEntries = { [`apps/${account}/${gateway}/bos.config.json`]: JSON.stringify(publishConfig) };
|
|
693
695
|
const payload = JSON.stringify(registryEntries);
|
|
694
696
|
const argsBase64 = Buffer.from(payload).toString("base64");
|
|
695
|
-
const privateKey = input.privateKey ||
|
|
697
|
+
const privateKey = input.privateKey || node_process.default.env.NEAR_PRIVATE_KEY || node_process.default.env.BOS_NEAR_PRIVATE_KEY;
|
|
696
698
|
try {
|
|
697
699
|
await effect.Effect.runPromise(require_near_cli.ensureNearCli);
|
|
698
700
|
let txHash;
|
|
@@ -805,6 +807,8 @@ var plugin_default = (0, every_plugin.createPlugin)({
|
|
|
805
807
|
} catch {}
|
|
806
808
|
if (!input.noInteractive) {
|
|
807
809
|
s.stop("Config fetched");
|
|
810
|
+
const initialExtendsAccount = extendsAccount;
|
|
811
|
+
const initialExtendsGateway = extendsGateway;
|
|
808
812
|
const prompted = await require_prompts.promptInitOptions({
|
|
809
813
|
extends: `bos://${extendsAccount}/${extendsGateway}`,
|
|
810
814
|
directory,
|
|
@@ -821,6 +825,35 @@ var plugin_default = (0, every_plugin.createPlugin)({
|
|
|
821
825
|
domain = prompted.domain;
|
|
822
826
|
plugins = prompted.plugins;
|
|
823
827
|
overrides = prompted.overrides;
|
|
828
|
+
if (!parentConfig || prompted.extendsAccount !== initialExtendsAccount || prompted.extendsGateway !== initialExtendsGateway) {
|
|
829
|
+
try {
|
|
830
|
+
parentConfig = await require_timing.timePhase(timings, "parent config", () => require_cli_init.fetchParentConfig(prompted.extendsAccount, prompted.extendsGateway), s);
|
|
831
|
+
if (parentConfig?.plugins && typeof parentConfig.plugins === "object") parentPluginKeys = Object.keys(parentConfig.plugins);
|
|
832
|
+
else parentPluginKeys = [];
|
|
833
|
+
} catch {
|
|
834
|
+
return {
|
|
835
|
+
status: "error",
|
|
836
|
+
directory,
|
|
837
|
+
extendsRef: `bos://${prompted.extendsAccount}/${prompted.extendsGateway}`,
|
|
838
|
+
account,
|
|
839
|
+
domain,
|
|
840
|
+
extends: `bos://${prompted.extendsAccount}/${prompted.extendsGateway}`,
|
|
841
|
+
plugins,
|
|
842
|
+
overrides,
|
|
843
|
+
filesCopied: 0,
|
|
844
|
+
timings,
|
|
845
|
+
error: `No config found at bos://${prompted.extendsAccount}/${prompted.extendsGateway} — are you sure this is the right parent?`
|
|
846
|
+
};
|
|
847
|
+
}
|
|
848
|
+
s.stop("Config fetched");
|
|
849
|
+
}
|
|
850
|
+
if (typeof parentConfig?.title === "string" && parentConfig.title.trim() && typeof parentConfig.description === "string" && parentConfig.description.trim()) {
|
|
851
|
+
const shouldContinue = await _clack_prompts.confirm({
|
|
852
|
+
message: `You will be extending ${parentConfig.title} - ${parentConfig.description}. Continue?`,
|
|
853
|
+
initialValue: true
|
|
854
|
+
});
|
|
855
|
+
if (_clack_prompts.isCancel(shouldContinue) || !shouldContinue) node_process.default.exit(0);
|
|
856
|
+
}
|
|
824
857
|
s.start("Setting up project");
|
|
825
858
|
}
|
|
826
859
|
overrides = overrides?.length ? overrides : ["ui", "api"];
|
|
@@ -830,7 +863,7 @@ var plugin_default = (0, every_plugin.createPlugin)({
|
|
|
830
863
|
const targetDir = (0, node_path.resolve)(directory);
|
|
831
864
|
const extendsRef = `bos://${extendsAccount}/${extendsGateway}`;
|
|
832
865
|
if (overrides.includes("plugins") && !plugins.length) {}
|
|
833
|
-
const repository = await require_cli_init.detectGitRemoteUrl(
|
|
866
|
+
const repository = await require_cli_init.detectGitRemoteUrl(node_process.default.cwd()).catch(() => void 0) ?? parentConfig?.repository;
|
|
834
867
|
if (!parentConfig) try {
|
|
835
868
|
parentConfig = await require_timing.timePhase(timings, "parent config", () => require_cli_init.fetchParentConfig(extendsAccount, extendsGateway), s);
|
|
836
869
|
} catch {
|
|
@@ -922,7 +955,9 @@ var plugin_default = (0, every_plugin.createPlugin)({
|
|
|
922
955
|
pluginRoutes
|
|
923
956
|
}), s);
|
|
924
957
|
}
|
|
925
|
-
|
|
958
|
+
const lockfilePath = (0, node_path.join)(targetDir, "bun.lock");
|
|
959
|
+
require_cli_init.stripOrphanedWorkspacesFromLockfile(lockfilePath, computeAllowedWorkspaces(overrides, plugins));
|
|
960
|
+
require_cli_init.removeInitLockfile(lockfilePath);
|
|
926
961
|
const initConfig = await require_timing.timePhase(timings, "resolve config", () => require_config.loadConfig({ cwd: targetDir }), s);
|
|
927
962
|
if (initConfig?.runtime) await require_timing.timePhase(timings, "generate env/docker", async () => {
|
|
928
963
|
require_infra.writeGeneratedInfra(targetDir, initConfig.runtime);
|
|
@@ -1043,7 +1078,7 @@ var plugin_default = (0, every_plugin.createPlugin)({
|
|
|
1043
1078
|
const projectDir = (0, node_path.resolve)((0, node_path.dirname)(configPath));
|
|
1044
1079
|
const refreshed = await require_config.loadConfig({
|
|
1045
1080
|
cwd: projectDir,
|
|
1046
|
-
env: input.env ?? (
|
|
1081
|
+
env: input.env ?? (node_process.default.env.NODE_ENV === "production" ? "production" : "development")
|
|
1047
1082
|
});
|
|
1048
1083
|
if (!refreshed) return {
|
|
1049
1084
|
status: "error",
|