everything-dev 1.26.1 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-contract.cjs.map +1 -1
- package/dist/api-contract.mjs.map +1 -1
- package/dist/cli/catalog.cjs.map +1 -1
- package/dist/cli/catalog.mjs.map +1 -1
- package/dist/cli/framework-version.cjs.map +1 -1
- package/dist/cli/framework-version.mjs.map +1 -1
- package/dist/cli/infra.cjs.map +1 -1
- package/dist/cli/infra.mjs.map +1 -1
- package/dist/cli/init.cjs +121 -113
- package/dist/cli/init.cjs.map +1 -1
- package/dist/cli/init.d.cts +6 -6
- package/dist/cli/init.d.cts.map +1 -1
- package/dist/cli/init.d.mts +6 -6
- package/dist/cli/init.d.mts.map +1 -1
- package/dist/cli/init.mjs +119 -113
- package/dist/cli/init.mjs.map +1 -1
- package/dist/cli/parse.cjs.map +1 -1
- package/dist/cli/parse.mjs.map +1 -1
- package/dist/cli/prompts.cjs +1 -1
- package/dist/cli/prompts.cjs.map +1 -1
- package/dist/cli/prompts.mjs +1 -1
- package/dist/cli/prompts.mjs.map +1 -1
- package/dist/cli/status.cjs.map +1 -1
- package/dist/cli/status.mjs.map +1 -1
- package/dist/cli/sync.cjs +42 -92
- package/dist/cli/sync.cjs.map +1 -1
- package/dist/cli/sync.mjs +45 -95
- package/dist/cli/sync.mjs.map +1 -1
- package/dist/cli/timing.cjs.map +1 -1
- package/dist/cli/timing.mjs.map +1 -1
- package/dist/cli/upgrade.cjs +41 -20
- package/dist/cli/upgrade.cjs.map +1 -1
- package/dist/cli/upgrade.mjs +43 -22
- package/dist/cli/upgrade.mjs.map +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/cli.mjs.map +1 -1
- package/dist/components/dev-view.cjs.map +1 -1
- package/dist/components/dev-view.mjs.map +1 -1
- package/dist/components/streaming-view.cjs.map +1 -1
- package/dist/components/streaming-view.mjs.map +1 -1
- package/dist/config.cjs.map +1 -1
- package/dist/config.mjs.map +1 -1
- package/dist/contract.cjs +174 -173
- package/dist/contract.cjs.map +1 -1
- package/dist/contract.d.cts +10 -10
- package/dist/contract.d.cts.map +1 -1
- package/dist/contract.d.mts +10 -10
- package/dist/contract.d.mts.map +1 -1
- package/dist/contract.mjs +2 -1
- package/dist/contract.mjs.map +1 -1
- package/dist/dev-logs.cjs.map +1 -1
- package/dist/dev-logs.mjs.map +1 -1
- package/dist/fastkv.cjs.map +1 -1
- package/dist/fastkv.mjs.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/integrity.cjs.map +1 -1
- package/dist/integrity.mjs.map +1 -1
- package/dist/internal/manifest-normalizer.cjs.map +1 -1
- package/dist/internal/manifest-normalizer.mjs.map +1 -1
- package/dist/merge.cjs.map +1 -1
- package/dist/merge.mjs.map +1 -1
- package/dist/near-cli.cjs.map +1 -1
- package/dist/near-cli.mjs.map +1 -1
- package/dist/orchestrator.cjs.map +1 -1
- package/dist/orchestrator.mjs.map +1 -1
- package/dist/plugin.cjs +20 -33
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +5 -5
- package/dist/plugin.d.mts +5 -5
- package/dist/plugin.mjs +18 -31
- package/dist/plugin.mjs.map +1 -1
- package/dist/sdk.cjs +2 -2
- package/dist/sdk.d.cts +1 -1
- package/dist/sdk.d.mts +1 -1
- package/dist/sdk.mjs +1 -1
- package/dist/shared.cjs.map +1 -1
- package/dist/shared.mjs.map +1 -1
- package/dist/types.cjs +184 -184
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +3 -3
- package/dist/types.d.mts +3 -3
- package/dist/types.mjs +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/ui/types.d.cts +1 -0
- package/dist/ui/types.d.cts.map +1 -1
- package/dist/ui/types.d.mts +1 -0
- package/dist/ui/types.d.mts.map +1 -1
- package/dist/utils/banner.cjs.map +1 -1
- package/dist/utils/banner.mjs.map +1 -1
- package/dist/utils/run.cjs.map +1 -1
- package/dist/utils/run.mjs.map +1 -1
- package/package.json +2 -2
- package/skills/init-upgrade/SKILL.md +22 -16
- package/skills/publish-sync/SKILL.md +7 -18
- package/src/cli/init.ts +137 -194
- package/src/cli/prompts.ts +1 -1
- package/src/cli/sync.ts +48 -137
- package/src/cli/upgrade.ts +66 -25
- package/src/contract.ts +2 -1
- package/src/plugin.ts +12 -34
- package/src/sdk.ts +1 -1
- package/src/types.ts +1 -1
- package/src/ui/types.ts +1 -0
- package/dist/utils/path-match.cjs +0 -18
- package/dist/utils/path-match.cjs.map +0 -1
- package/dist/utils/path-match.mjs +0 -17
- package/dist/utils/path-match.mjs.map +0 -1
package/dist/cli/init.d.cts
CHANGED
|
@@ -2,6 +2,7 @@ import { OverrideSection } from "../contract.cjs";
|
|
|
2
2
|
import { BosConfig, BosConfigInput } from "../types.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/cli/init.d.ts
|
|
5
|
+
declare const INIT_ROOT_PATTERNS: readonly ["bos.config.json", "package.json", ".env.example", ".gitignore", "biome.json", "bunfig.toml", "Dockerfile", "docker-compose.yml", "railway.json", ".agent/**", "AGENTS.md", ".opencode/skills/everything-dev/**", ".changeset/config.json", ".changeset/README.md", "README.md", "CONTRIBUTING.md", ".github/templates/**"];
|
|
5
6
|
interface SourceResult {
|
|
6
7
|
sourceDir: string;
|
|
7
8
|
parentConfig: BosConfig;
|
|
@@ -12,7 +13,8 @@ declare function resolveSourceDir(opts: {
|
|
|
12
13
|
extendsGateway: string;
|
|
13
14
|
source?: string;
|
|
14
15
|
}): Promise<SourceResult>;
|
|
15
|
-
declare function
|
|
16
|
+
declare function buildInitPatterns(overrides: OverrideSection[], plugins?: string[]): string[];
|
|
17
|
+
declare function sourcePathToDestinationPath(filePath: string): string;
|
|
16
18
|
declare function fetchParentConfig(extendsAccount: string, extendsGateway: string): Promise<BosConfig>;
|
|
17
19
|
declare function resolveRepositoryViaExtendsChain(extendsAccount: string, extendsGateway: string, visited?: Set<string>): Promise<{
|
|
18
20
|
repository: string;
|
|
@@ -23,10 +25,9 @@ declare function downloadTarball(repoUrl: string): Promise<{
|
|
|
23
25
|
dir: string;
|
|
24
26
|
cleanup: () => Promise<void>;
|
|
25
27
|
}>;
|
|
26
|
-
declare function copyFilteredFiles(sourceDir: string, destination: string, patterns: string[],
|
|
28
|
+
declare function copyFilteredFiles(sourceDir: string, destination: string, patterns: string[], _options: {
|
|
27
29
|
overrides: OverrideSection[];
|
|
28
30
|
plugins?: string[];
|
|
29
|
-
pluginRoutes?: Record<string, string[]>;
|
|
30
31
|
}): Promise<number>;
|
|
31
32
|
declare function personalizeConfig(destination: string, opts: {
|
|
32
33
|
extendsAccount: string;
|
|
@@ -70,15 +71,14 @@ declare function scaffoldMinimalProject(destination: string, parentConfig: BosCo
|
|
|
70
71
|
title?: string;
|
|
71
72
|
description?: string;
|
|
72
73
|
}): Promise<number>;
|
|
73
|
-
declare function writeInitSnapshot(destination: string, extendsAccount: string, extendsGateway: string, sourceDir: string, patterns: string[],
|
|
74
|
+
declare function writeInitSnapshot(destination: string, extendsAccount: string, extendsGateway: string, sourceDir: string, patterns: string[], _options: {
|
|
74
75
|
overrides: OverrideSection[];
|
|
75
76
|
plugins?: string[];
|
|
76
|
-
pluginRoutes?: Record<string, string[]>;
|
|
77
77
|
}): Promise<void>;
|
|
78
78
|
declare function generateDatabaseMigrations(destination: string): Promise<void>;
|
|
79
79
|
declare function execCommand(command: string, args: string[], cwd?: string, options?: {
|
|
80
80
|
stdio?: "pipe" | "inherit";
|
|
81
81
|
}): Promise<void>;
|
|
82
82
|
//#endregion
|
|
83
|
-
export { copyFilteredFiles, detectGitRemoteUrl, downloadTarball, execCommand, fetchParentConfig, generateDatabaseMigrations, personalizeConfig,
|
|
83
|
+
export { INIT_ROOT_PATTERNS, buildInitPatterns, copyFilteredFiles, detectGitRemoteUrl, downloadTarball, execCommand, fetchParentConfig, generateDatabaseMigrations, personalizeConfig, removeInitLockfile, resolveRepositoryViaExtendsChain, resolveSourceDir, runBunInstall, runBunInstallForUpgrade, runDockerComposeUp, runTypesGen, scaffoldMinimalProject, sourcePathToDestinationPath, stripOrphanedWorkspacesFromLockfile, writeInitSnapshot };
|
|
84
84
|
//# sourceMappingURL=init.d.cts.map
|
package/dist/cli/init.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.cts","names":[],"sources":["../../src/cli/init.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"init.d.cts","names":[],"sources":["../../src/cli/init.ts"],"mappings":";;;;cA6Ba,kBAAA;AAAA,UA6BH,YAAA;EACR,SAAA;EACA,YAAA,EAAc,SAAA;EACd,OAAA,QAAe,OAAA;AAAA;AAAA,iBAGK,gBAAA,CAAiB,IAAA;EACrC,cAAA;EACA,cAAA;EACA,MAAA;AAAA,IACE,OAAA,CAAQ,YAAA;AAAA,iBAmCI,iBAAA,CAAkB,SAAA,EAAW,eAAA,IAAmB,OAAA;AAAA,iBAgBhD,2BAAA,CAA4B,QAAA;AAAA,iBAMtB,iBAAA,CACpB,cAAA,UACA,cAAA,WACC,OAAA,CAAQ,SAAA;AAAA,iBAKW,gCAAA,CACpB,cAAA,UACA,cAAA,UACA,OAAA,GAAO,GAAA,WACN,OAAA;EAAU,UAAA;EAAoB,MAAA,EAAQ,SAAA;AAAA;AAAA,iBA2BnB,kBAAA,CAAmB,SAAA,WAAoB,OAAA;AAAA,iBA0BvC,eAAA,CACpB,OAAA,WACC,OAAA;EAAU,GAAA;EAAa,OAAA,QAAe,OAAA;AAAA;AAAA,iBAiEnB,iBAAA,CACpB,SAAA,UACA,WAAA,UACA,QAAA,YACA,QAAA;EACE,SAAA,EAAW,eAAA;EACX,OAAA;AAAA,IAED,OAAA;AAAA,iBA6CmB,iBAAA,CACpB,WAAA,UACA,IAAA;EACE,cAAA;EACA,cAAA;EACA,OAAA;EACA,MAAA;EACA,OAAA;EACA,SAAA,EAAW,eAAA;EACX,YAAA,GAAe,MAAA;EACf,aAAA;IAAkB,cAAA;IAA0B,SAAA;EAAA;EAC5C,IAAA;EACA,UAAA;EACA,KAAA;EACA,WAAA;EACA,OAAA;EACA,OAAA;AAAA,IAED,OAAA;AAAA,iBAqSmB,aAAA,CACpB,WAAA,UACA,OAAA;EAAY,OAAA,GAAU,GAAA;AAAA,IACrB,OAAA;AAAA,iBAUmB,uBAAA,CACpB,WAAA,UACA,OAAA;EAAY,OAAA,GAAU,GAAA;AAAA,IACrB,OAAA;AAAA,iBAUmB,WAAA,CACpB,WAAA,UACA,OAAA;EAAY,OAAA,GAAU,GAAA;AAAA,IACrB,OAAA;AAAA,iBA4BmB,kBAAA,CAAmB,WAAA,WAAsB,OAAA;AAAA,iBA8B/C,mCAAA,CACd,YAAA,UACA,iBAAA;AAAA,iBAgCc,kBAAA,CAAmB,YAAA;AAAA,iBA+Eb,sBAAA,CACpB,WAAA,UACA,YAAA,EAAc,cAAA,EACd,IAAA;EACE,cAAA;EACA,cAAA;EACA,OAAA;EACA,MAAA;EACA,OAAA;EACA,SAAA,EAAW,eAAA;EACX,UAAA;EACA,KAAA;EACA,WAAA;AAAA,IAED,OAAA;AAAA,iBA4JmB,iBAAA,CACpB,WAAA,UACA,cAAA,UACA,cAAA,UACA,SAAA,UACA,QAAA,YACA,QAAA;EACE,SAAA,EAAW,eAAA;EACX,OAAA;AAAA,IAED,OAAA;AAAA,iBAuCmB,0BAAA,CAA2B,WAAA,WAAsB,OAAA;AAAA,iBA8BjD,WAAA,CACpB,OAAA,UACA,IAAA,YACA,GAAA,WACA,OAAA;EAAY,KAAA;AAAA,IACX,OAAA"}
|
package/dist/cli/init.d.mts
CHANGED
|
@@ -2,6 +2,7 @@ import { OverrideSection } from "../contract.mjs";
|
|
|
2
2
|
import { BosConfig, BosConfigInput } from "../types.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/cli/init.d.ts
|
|
5
|
+
declare const INIT_ROOT_PATTERNS: readonly ["bos.config.json", "package.json", ".env.example", ".gitignore", "biome.json", "bunfig.toml", "Dockerfile", "docker-compose.yml", "railway.json", ".agent/**", "AGENTS.md", ".opencode/skills/everything-dev/**", ".changeset/config.json", ".changeset/README.md", "README.md", "CONTRIBUTING.md", ".github/templates/**"];
|
|
5
6
|
interface SourceResult {
|
|
6
7
|
sourceDir: string;
|
|
7
8
|
parentConfig: BosConfig;
|
|
@@ -12,7 +13,8 @@ declare function resolveSourceDir(opts: {
|
|
|
12
13
|
extendsGateway: string;
|
|
13
14
|
source?: string;
|
|
14
15
|
}): Promise<SourceResult>;
|
|
15
|
-
declare function
|
|
16
|
+
declare function buildInitPatterns(overrides: OverrideSection[], plugins?: string[]): string[];
|
|
17
|
+
declare function sourcePathToDestinationPath(filePath: string): string;
|
|
16
18
|
declare function fetchParentConfig(extendsAccount: string, extendsGateway: string): Promise<BosConfig>;
|
|
17
19
|
declare function resolveRepositoryViaExtendsChain(extendsAccount: string, extendsGateway: string, visited?: Set<string>): Promise<{
|
|
18
20
|
repository: string;
|
|
@@ -23,10 +25,9 @@ declare function downloadTarball(repoUrl: string): Promise<{
|
|
|
23
25
|
dir: string;
|
|
24
26
|
cleanup: () => Promise<void>;
|
|
25
27
|
}>;
|
|
26
|
-
declare function copyFilteredFiles(sourceDir: string, destination: string, patterns: string[],
|
|
28
|
+
declare function copyFilteredFiles(sourceDir: string, destination: string, patterns: string[], _options: {
|
|
27
29
|
overrides: OverrideSection[];
|
|
28
30
|
plugins?: string[];
|
|
29
|
-
pluginRoutes?: Record<string, string[]>;
|
|
30
31
|
}): Promise<number>;
|
|
31
32
|
declare function personalizeConfig(destination: string, opts: {
|
|
32
33
|
extendsAccount: string;
|
|
@@ -70,15 +71,14 @@ declare function scaffoldMinimalProject(destination: string, parentConfig: BosCo
|
|
|
70
71
|
title?: string;
|
|
71
72
|
description?: string;
|
|
72
73
|
}): Promise<number>;
|
|
73
|
-
declare function writeInitSnapshot(destination: string, extendsAccount: string, extendsGateway: string, sourceDir: string, patterns: string[],
|
|
74
|
+
declare function writeInitSnapshot(destination: string, extendsAccount: string, extendsGateway: string, sourceDir: string, patterns: string[], _options: {
|
|
74
75
|
overrides: OverrideSection[];
|
|
75
76
|
plugins?: string[];
|
|
76
|
-
pluginRoutes?: Record<string, string[]>;
|
|
77
77
|
}): Promise<void>;
|
|
78
78
|
declare function generateDatabaseMigrations(destination: string): Promise<void>;
|
|
79
79
|
declare function execCommand(command: string, args: string[], cwd?: string, options?: {
|
|
80
80
|
stdio?: "pipe" | "inherit";
|
|
81
81
|
}): Promise<void>;
|
|
82
82
|
//#endregion
|
|
83
|
-
export { copyFilteredFiles, detectGitRemoteUrl, downloadTarball, execCommand, fetchParentConfig, generateDatabaseMigrations, personalizeConfig,
|
|
83
|
+
export { INIT_ROOT_PATTERNS, buildInitPatterns, copyFilteredFiles, detectGitRemoteUrl, downloadTarball, execCommand, fetchParentConfig, generateDatabaseMigrations, personalizeConfig, removeInitLockfile, resolveRepositoryViaExtendsChain, resolveSourceDir, runBunInstall, runBunInstallForUpgrade, runDockerComposeUp, runTypesGen, scaffoldMinimalProject, sourcePathToDestinationPath, stripOrphanedWorkspacesFromLockfile, writeInitSnapshot };
|
|
84
84
|
//# sourceMappingURL=init.d.mts.map
|
package/dist/cli/init.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.mts","names":[],"sources":["../../src/cli/init.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"init.d.mts","names":[],"sources":["../../src/cli/init.ts"],"mappings":";;;;cA6Ba,kBAAA;AAAA,UA6BH,YAAA;EACR,SAAA;EACA,YAAA,EAAc,SAAA;EACd,OAAA,QAAe,OAAA;AAAA;AAAA,iBAGK,gBAAA,CAAiB,IAAA;EACrC,cAAA;EACA,cAAA;EACA,MAAA;AAAA,IACE,OAAA,CAAQ,YAAA;AAAA,iBAmCI,iBAAA,CAAkB,SAAA,EAAW,eAAA,IAAmB,OAAA;AAAA,iBAgBhD,2BAAA,CAA4B,QAAA;AAAA,iBAMtB,iBAAA,CACpB,cAAA,UACA,cAAA,WACC,OAAA,CAAQ,SAAA;AAAA,iBAKW,gCAAA,CACpB,cAAA,UACA,cAAA,UACA,OAAA,GAAO,GAAA,WACN,OAAA;EAAU,UAAA;EAAoB,MAAA,EAAQ,SAAA;AAAA;AAAA,iBA2BnB,kBAAA,CAAmB,SAAA,WAAoB,OAAA;AAAA,iBA0BvC,eAAA,CACpB,OAAA,WACC,OAAA;EAAU,GAAA;EAAa,OAAA,QAAe,OAAA;AAAA;AAAA,iBAiEnB,iBAAA,CACpB,SAAA,UACA,WAAA,UACA,QAAA,YACA,QAAA;EACE,SAAA,EAAW,eAAA;EACX,OAAA;AAAA,IAED,OAAA;AAAA,iBA6CmB,iBAAA,CACpB,WAAA,UACA,IAAA;EACE,cAAA;EACA,cAAA;EACA,OAAA;EACA,MAAA;EACA,OAAA;EACA,SAAA,EAAW,eAAA;EACX,YAAA,GAAe,MAAA;EACf,aAAA;IAAkB,cAAA;IAA0B,SAAA;EAAA;EAC5C,IAAA;EACA,UAAA;EACA,KAAA;EACA,WAAA;EACA,OAAA;EACA,OAAA;AAAA,IAED,OAAA;AAAA,iBAqSmB,aAAA,CACpB,WAAA,UACA,OAAA;EAAY,OAAA,GAAU,GAAA;AAAA,IACrB,OAAA;AAAA,iBAUmB,uBAAA,CACpB,WAAA,UACA,OAAA;EAAY,OAAA,GAAU,GAAA;AAAA,IACrB,OAAA;AAAA,iBAUmB,WAAA,CACpB,WAAA,UACA,OAAA;EAAY,OAAA,GAAU,GAAA;AAAA,IACrB,OAAA;AAAA,iBA4BmB,kBAAA,CAAmB,WAAA,WAAsB,OAAA;AAAA,iBA8B/C,mCAAA,CACd,YAAA,UACA,iBAAA;AAAA,iBAgCc,kBAAA,CAAmB,YAAA;AAAA,iBA+Eb,sBAAA,CACpB,WAAA,UACA,YAAA,EAAc,cAAA,EACd,IAAA;EACE,cAAA;EACA,cAAA;EACA,OAAA;EACA,MAAA;EACA,OAAA;EACA,SAAA,EAAW,eAAA;EACX,UAAA;EACA,KAAA;EACA,WAAA;AAAA,IAED,OAAA;AAAA,iBA4JmB,iBAAA,CACpB,WAAA,UACA,cAAA,UACA,cAAA,UACA,SAAA,UACA,QAAA,YACA,QAAA;EACE,SAAA,EAAW,eAAA;EACX,OAAA;AAAA,IAED,OAAA;AAAA,iBAuCmB,0BAAA,CAA2B,WAAA,WAAsB,OAAA;AAAA,iBA8BjD,WAAA,CACpB,OAAA,UACA,IAAA,YACA,GAAA,WACA,OAAA;EAAY,KAAA;AAAA,IACX,OAAA"}
|
package/dist/cli/init.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { fetchBosConfigFromFastKv } from "../fastkv.mjs";
|
|
2
2
|
import { loadManifestNormalizationSpec, normalizePackageManifestsInTree } from "../internal/manifest-normalizer.mjs";
|
|
3
|
-
import { isPathExcluded } from "../utils/path-match.mjs";
|
|
4
3
|
import { saveBosConfig } from "../utils/save-config.mjs";
|
|
5
4
|
import { writeSnapshot } from "./snapshot.mjs";
|
|
6
5
|
import { createRequire } from "node:module";
|
|
@@ -14,6 +13,25 @@ import { glob } from "glob";
|
|
|
14
13
|
|
|
15
14
|
//#region src/cli/init.ts
|
|
16
15
|
const require = createRequire(import.meta.url);
|
|
16
|
+
const INIT_ROOT_PATTERNS = [
|
|
17
|
+
"bos.config.json",
|
|
18
|
+
"package.json",
|
|
19
|
+
".env.example",
|
|
20
|
+
".gitignore",
|
|
21
|
+
"biome.json",
|
|
22
|
+
"bunfig.toml",
|
|
23
|
+
"Dockerfile",
|
|
24
|
+
"docker-compose.yml",
|
|
25
|
+
"railway.json",
|
|
26
|
+
".agent/**",
|
|
27
|
+
"AGENTS.md",
|
|
28
|
+
".opencode/skills/everything-dev/**",
|
|
29
|
+
".changeset/config.json",
|
|
30
|
+
".changeset/README.md",
|
|
31
|
+
"README.md",
|
|
32
|
+
"CONTRIBUTING.md",
|
|
33
|
+
".github/templates/**"
|
|
34
|
+
];
|
|
17
35
|
const FRAMEWORK_PACKAGES = ["every-plugin", "everything-dev"];
|
|
18
36
|
const OVERRIDE_WORKSPACE_MAP = {
|
|
19
37
|
ui: ["ui"],
|
|
@@ -55,13 +73,18 @@ async function resolveSourceDir(opts) {
|
|
|
55
73
|
cleanup: async () => {}
|
|
56
74
|
};
|
|
57
75
|
}
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (
|
|
76
|
+
function buildInitPatterns(overrides, plugins) {
|
|
77
|
+
const has = (section) => overrides.includes(section);
|
|
78
|
+
const patterns = [...INIT_ROOT_PATTERNS];
|
|
79
|
+
if (has("ui")) patterns.push("ui/**");
|
|
80
|
+
if (has("api")) patterns.push("api/**");
|
|
81
|
+
if (has("host")) patterns.push("host/**");
|
|
82
|
+
if (has("plugins")) for (const plugin of plugins ?? []) patterns.push(`plugins/${plugin}/**`);
|
|
63
83
|
return patterns;
|
|
64
84
|
}
|
|
85
|
+
function sourcePathToDestinationPath(filePath) {
|
|
86
|
+
return filePath.startsWith(".github/templates/") ? filePath.replace(/^\.github\/templates\//, ".github/") : filePath;
|
|
87
|
+
}
|
|
65
88
|
async function fetchParentConfig(extendsAccount, extendsGateway) {
|
|
66
89
|
return fetchBosConfigFromFastKv(`bos://${extendsAccount}/${extendsGateway}`);
|
|
67
90
|
}
|
|
@@ -185,62 +208,30 @@ function parseGitHubUrl(url) {
|
|
|
185
208
|
};
|
|
186
209
|
return null;
|
|
187
210
|
}
|
|
188
|
-
function
|
|
189
|
-
const has = (section) => overrides.includes(section);
|
|
190
|
-
let filtered = [...patterns];
|
|
191
|
-
if (!has("host")) filtered = filtered.filter((p) => !p.startsWith("host/") && p !== "host/**");
|
|
192
|
-
if (!has("ui")) filtered = filtered.filter((p) => !p.startsWith("ui/") && p !== "ui/**");
|
|
193
|
-
if (!has("api")) filtered = filtered.filter((p) => !p.startsWith("api/") && p !== "api/**");
|
|
194
|
-
if (!has("plugins")) filtered = filtered.filter((p) => !p.startsWith("plugins/") && p !== "plugins/**");
|
|
195
|
-
return filtered;
|
|
196
|
-
}
|
|
197
|
-
async function copyFilteredFiles(sourceDir, destination, patterns, options) {
|
|
211
|
+
async function copyFilteredFiles(sourceDir, destination, patterns, _options) {
|
|
198
212
|
if (patterns.length === 0) return 0;
|
|
199
|
-
const has = (section) => options.overrides.includes(section);
|
|
200
|
-
const effectivePatterns = filterPatternsByOverrides(patterns, options.overrides, options.plugins);
|
|
201
|
-
if (has("host") && !effectivePatterns.some((p) => p.startsWith("host/") || p === "host/**")) effectivePatterns.push("host/**");
|
|
202
|
-
const excludedRoutePatterns = [];
|
|
203
|
-
if (options.pluginRoutes) {
|
|
204
|
-
for (const [pluginKey, routePatterns] of Object.entries(options.pluginRoutes)) if (!(options.plugins?.includes(pluginKey) ?? true)) excludedRoutePatterns.push(...routePatterns);
|
|
205
|
-
}
|
|
206
213
|
const allFiles = /* @__PURE__ */ new Set();
|
|
207
|
-
for (const pattern of
|
|
214
|
+
for (const pattern of patterns) {
|
|
208
215
|
const matches = await glob(pattern, {
|
|
209
216
|
cwd: sourceDir,
|
|
210
217
|
nodir: true,
|
|
211
218
|
dot: true,
|
|
212
|
-
absolute: false
|
|
219
|
+
absolute: false,
|
|
220
|
+
ignore: [
|
|
221
|
+
"**/node_modules/**",
|
|
222
|
+
"**/.git/**",
|
|
223
|
+
"**/dist/**",
|
|
224
|
+
"**/.bos/**"
|
|
225
|
+
]
|
|
213
226
|
});
|
|
214
|
-
for (const match of matches)
|
|
215
|
-
const pluginMatch = match.match(/^plugins\/([^/]+)/);
|
|
216
|
-
if (pluginMatch) {
|
|
217
|
-
const pluginName = pluginMatch[1];
|
|
218
|
-
if (!(options.plugins?.includes(pluginName) ?? true)) continue;
|
|
219
|
-
}
|
|
220
|
-
if (isPathExcluded(match, excludedRoutePatterns)) continue;
|
|
221
|
-
allFiles.add(match);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
const routeFiles = /* @__PURE__ */ new Set();
|
|
225
|
-
if (options.pluginRoutes) for (const [pluginKey, routePatterns] of Object.entries(options.pluginRoutes)) {
|
|
226
|
-
if (!(options.plugins?.includes(pluginKey) ?? true)) continue;
|
|
227
|
-
for (const rp of routePatterns) {
|
|
228
|
-
const matches = await glob(rp, {
|
|
229
|
-
cwd: sourceDir,
|
|
230
|
-
nodir: true,
|
|
231
|
-
dot: true,
|
|
232
|
-
absolute: false
|
|
233
|
-
});
|
|
234
|
-
for (const match of matches) if (!isPathExcluded(match, excludedRoutePatterns)) routeFiles.add(match);
|
|
235
|
-
}
|
|
227
|
+
for (const match of matches) allFiles.add(match);
|
|
236
228
|
}
|
|
237
|
-
for (const f of routeFiles) allFiles.add(f);
|
|
238
229
|
mkdirSync(destination, { recursive: true });
|
|
239
230
|
let count = 0;
|
|
240
231
|
for (const filePath of allFiles) {
|
|
241
232
|
const src = join(sourceDir, filePath);
|
|
242
233
|
if (!lstatSync(src).isFile()) continue;
|
|
243
|
-
const dest = join(destination,
|
|
234
|
+
const dest = join(destination, sourcePathToDestinationPath(filePath));
|
|
244
235
|
mkdirSync(dirname(dest), { recursive: true });
|
|
245
236
|
writeFileSync(dest, readFileSync(src));
|
|
246
237
|
count++;
|
|
@@ -325,24 +316,28 @@ async function personalizeConfig(destination, opts) {
|
|
|
325
316
|
}
|
|
326
317
|
if (pkg.scripts && typeof pkg.scripts === "object") {
|
|
327
318
|
const scripts = pkg.scripts;
|
|
328
|
-
const
|
|
329
|
-
|
|
319
|
+
const FROM = "bun packages/everything-dev/src/cli.ts";
|
|
320
|
+
const TO = "node_modules/.bin/bos";
|
|
321
|
+
const rewrite = (key) => {
|
|
322
|
+
if (scripts[key]?.includes(FROM)) scripts[key] = scripts[key].replaceAll(FROM, TO);
|
|
330
323
|
};
|
|
331
|
-
rewrite("dev"
|
|
332
|
-
rewrite("dev:ui"
|
|
333
|
-
rewrite("dev:api"
|
|
334
|
-
rewrite("dev:proxy"
|
|
335
|
-
rewrite("build"
|
|
336
|
-
rewrite("deploy"
|
|
337
|
-
rewrite("publish"
|
|
338
|
-
rewrite("start"
|
|
324
|
+
rewrite("dev");
|
|
325
|
+
rewrite("dev:ui");
|
|
326
|
+
rewrite("dev:api");
|
|
327
|
+
rewrite("dev:proxy");
|
|
328
|
+
rewrite("build");
|
|
329
|
+
rewrite("deploy");
|
|
330
|
+
rewrite("publish");
|
|
331
|
+
rewrite("start");
|
|
332
|
+
rewrite("bos");
|
|
339
333
|
scripts.postinstall = "node_modules/.bin/bos types gen || true";
|
|
340
334
|
scripts["types:gen"] = "node_modules/.bin/bos types gen";
|
|
341
335
|
if (scripts.typecheck) {
|
|
342
336
|
scripts.typecheck = scripts.typecheck.replace("bun run types:gen && ", "").replace(/bun run --cwd packages\/everything-dev typecheck & ?/, "");
|
|
337
|
+
if (!has("ui")) scripts.typecheck = scripts.typecheck.replace(/bun run --cwd ui tsc --noEmit & ?/, "");
|
|
338
|
+
if (!has("api")) scripts.typecheck = scripts.typecheck.replace(/bun run --cwd api tsc --noEmit & ?/, "");
|
|
343
339
|
if (!has("host")) scripts.typecheck = scripts.typecheck.replace(/bun run --cwd host tsc --noEmit & ?/, "");
|
|
344
340
|
}
|
|
345
|
-
if (!scripts.bos) scripts.bos = "node_modules/.bin/bos";
|
|
346
341
|
}
|
|
347
342
|
if (pkg.devDependencies && typeof pkg.devDependencies === "object") {
|
|
348
343
|
const deps = pkg.devDependencies;
|
|
@@ -462,7 +457,22 @@ async function runBunInstallForUpgrade(destination, spinner) {
|
|
|
462
457
|
await runWithProgress("bun", ["install", "--force"], destination, spinner, "Installing dependencies");
|
|
463
458
|
}
|
|
464
459
|
async function runTypesGen(destination, spinner) {
|
|
465
|
-
|
|
460
|
+
if (existsSync(join(destination, "node_modules", ".bin", "bos"))) {
|
|
461
|
+
await runWithProgress("node_modules/.bin/bos", ["types", "gen"], destination, spinner, "Generating types");
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
if (existsSync(join(destination, "packages", "everything-dev", "src", "cli.ts"))) {
|
|
465
|
+
await runWithProgress("bun", [
|
|
466
|
+
"run",
|
|
467
|
+
"--cwd",
|
|
468
|
+
"packages/everything-dev",
|
|
469
|
+
"src/cli.ts",
|
|
470
|
+
"types",
|
|
471
|
+
"gen"
|
|
472
|
+
], destination, spinner, "Generating types");
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
throw new Error("Unable to locate bos CLI for types generation");
|
|
466
476
|
}
|
|
467
477
|
async function runDockerComposeUp(destination) {
|
|
468
478
|
await execCommand("docker", [
|
|
@@ -520,32 +530,46 @@ const WORKSPACE_LOCAL_PATHS = {
|
|
|
520
530
|
"everything-dev": "packages/everything-dev",
|
|
521
531
|
"every-plugin": "packages/every-plugin"
|
|
522
532
|
};
|
|
533
|
+
function readJsonFile(filePath) {
|
|
534
|
+
return JSON.parse(readFileSync(filePath, "utf-8"));
|
|
535
|
+
}
|
|
536
|
+
function tryResolvePackageJson(packageName) {
|
|
537
|
+
try {
|
|
538
|
+
return require.resolve(`${packageName}/package.json`);
|
|
539
|
+
} catch {
|
|
540
|
+
return null;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
523
543
|
function resolveFrameworkCatalog() {
|
|
524
544
|
const catalog = {};
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
const
|
|
545
|
+
const everythingDevPackageJson = tryResolvePackageJson("everything-dev");
|
|
546
|
+
if (everythingDevPackageJson) {
|
|
547
|
+
try {
|
|
548
|
+
const monorepoPkgPath = join(dirname(everythingDevPackageJson), "..", "..", "package.json");
|
|
549
|
+
if (existsSync(monorepoPkgPath)) {
|
|
550
|
+
const sourceCatalog = readJsonFile(monorepoPkgPath).workspaces?.catalog;
|
|
551
|
+
if (sourceCatalog && typeof sourceCatalog === "object") {
|
|
552
|
+
for (const [name, version] of Object.entries(sourceCatalog)) if (typeof version === "string") catalog[name] = version;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
} catch {}
|
|
556
|
+
try {
|
|
557
|
+
const selfPkg = readJsonFile(everythingDevPackageJson);
|
|
558
|
+
if (selfPkg.version && !catalog["everything-dev"]) catalog["everything-dev"] = `^${selfPkg.version}`;
|
|
559
|
+
const sourceCatalog = selfPkg.workspaces?.catalog;
|
|
529
560
|
if (sourceCatalog && typeof sourceCatalog === "object") {
|
|
530
|
-
for (const [name, version] of Object.entries(sourceCatalog)) if (typeof version === "string") catalog[name] = version;
|
|
561
|
+
for (const [name, version] of Object.entries(sourceCatalog)) if (typeof version === "string" && !catalog[name]) catalog[name] = version;
|
|
531
562
|
}
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
const
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
} catch {}
|
|
543
|
-
if (Object.keys(catalog).length > 0) return catalog;
|
|
544
|
-
for (const packageName of FRAMEWORK_PACKAGES) try {
|
|
545
|
-
const resolved = require.resolve(`${packageName}/package.json`);
|
|
546
|
-
const pkg = JSON.parse(readFileSync(resolved, "utf-8"));
|
|
547
|
-
if (pkg.version) catalog[packageName] = `^${pkg.version}`;
|
|
548
|
-
} catch {}
|
|
563
|
+
} catch {}
|
|
564
|
+
}
|
|
565
|
+
for (const packageName of FRAMEWORK_PACKAGES) {
|
|
566
|
+
const resolved = tryResolvePackageJson(packageName);
|
|
567
|
+
if (!resolved) continue;
|
|
568
|
+
try {
|
|
569
|
+
const pkg = readJsonFile(resolved);
|
|
570
|
+
if (pkg.version) catalog[packageName] = `^${pkg.version}`;
|
|
571
|
+
} catch {}
|
|
572
|
+
}
|
|
549
573
|
return catalog;
|
|
550
574
|
}
|
|
551
575
|
async function scaffoldMinimalProject(destination, parentConfig, opts) {
|
|
@@ -660,47 +684,29 @@ async function resolveWorkspaceRefs(destination, options) {
|
|
|
660
684
|
}
|
|
661
685
|
}
|
|
662
686
|
}
|
|
663
|
-
async function writeInitSnapshot(destination, extendsAccount, extendsGateway, sourceDir, patterns,
|
|
664
|
-
const effectivePatterns = filterPatternsByOverrides(patterns, options.overrides, options.plugins);
|
|
665
|
-
const has = (section) => options.overrides.includes(section);
|
|
666
|
-
if (has("host") && !effectivePatterns.some((p) => p.startsWith("host/") || p === "host/**")) effectivePatterns.push("host/**");
|
|
667
|
-
const excludedRoutePatterns = [];
|
|
668
|
-
if (options.pluginRoutes) {
|
|
669
|
-
for (const [pluginKey, routePatterns] of Object.entries(options.pluginRoutes)) if (!(options.plugins?.includes(pluginKey) ?? true)) excludedRoutePatterns.push(...routePatterns);
|
|
670
|
-
}
|
|
687
|
+
async function writeInitSnapshot(destination, extendsAccount, extendsGateway, sourceDir, patterns, _options) {
|
|
671
688
|
const allFiles = /* @__PURE__ */ new Set();
|
|
672
|
-
for (const pattern of
|
|
689
|
+
for (const pattern of patterns) {
|
|
673
690
|
const matches = await glob(pattern, {
|
|
674
691
|
cwd: sourceDir,
|
|
675
692
|
nodir: true,
|
|
676
693
|
dot: true,
|
|
677
|
-
absolute: false
|
|
694
|
+
absolute: false,
|
|
695
|
+
ignore: [
|
|
696
|
+
"**/node_modules/**",
|
|
697
|
+
"**/.git/**",
|
|
698
|
+
"**/dist/**",
|
|
699
|
+
"**/.bos/**"
|
|
700
|
+
]
|
|
678
701
|
});
|
|
679
|
-
for (const match of matches)
|
|
680
|
-
const pluginMatch = match.match(/^plugins\/([^/]+)/);
|
|
681
|
-
if (pluginMatch && !(options.plugins?.includes(pluginMatch[1]) ?? true)) continue;
|
|
682
|
-
if (isPathExcluded(match, excludedRoutePatterns)) continue;
|
|
683
|
-
allFiles.add(match);
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
if (options.pluginRoutes) for (const [pluginKey, routePatterns] of Object.entries(options.pluginRoutes)) {
|
|
687
|
-
if (!(options.plugins?.includes(pluginKey) ?? true)) continue;
|
|
688
|
-
for (const rp of routePatterns) {
|
|
689
|
-
const matches = await glob(rp, {
|
|
690
|
-
cwd: sourceDir,
|
|
691
|
-
nodir: true,
|
|
692
|
-
dot: true,
|
|
693
|
-
absolute: false
|
|
694
|
-
});
|
|
695
|
-
for (const match of matches) if (!isPathExcluded(match, excludedRoutePatterns)) allFiles.add(match);
|
|
696
|
-
}
|
|
702
|
+
for (const match of matches) allFiles.add(match);
|
|
697
703
|
}
|
|
698
704
|
const fileHashes = {};
|
|
699
705
|
for (const filePath of allFiles) {
|
|
700
706
|
const src = join(sourceDir, filePath);
|
|
701
707
|
if (!lstatSync(src).isFile()) continue;
|
|
702
708
|
const content = readFileSync(src);
|
|
703
|
-
const destPath =
|
|
709
|
+
const destPath = sourcePathToDestinationPath(filePath);
|
|
704
710
|
fileHashes[destPath] = computeHash(content);
|
|
705
711
|
}
|
|
706
712
|
await writeSnapshot(destination, {
|
|
@@ -785,5 +791,5 @@ dist/
|
|
|
785
791
|
}
|
|
786
792
|
|
|
787
793
|
//#endregion
|
|
788
|
-
export { copyFilteredFiles, detectGitRemoteUrl, downloadTarball, execCommand, fetchParentConfig, generateDatabaseMigrations, personalizeConfig,
|
|
794
|
+
export { INIT_ROOT_PATTERNS, buildInitPatterns, copyFilteredFiles, detectGitRemoteUrl, downloadTarball, execCommand, fetchParentConfig, generateDatabaseMigrations, personalizeConfig, removeInitLockfile, resolveRepositoryViaExtendsChain, resolveSourceDir, runBunInstall, runBunInstallForUpgrade, runDockerComposeUp, runTypesGen, scaffoldMinimalProject, sourcePathToDestinationPath, stripOrphanedWorkspacesFromLockfile, writeInitSnapshot };
|
|
789
795
|
//# sourceMappingURL=init.mjs.map
|