everything-dev 1.26.1 → 1.28.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.
Files changed (166) hide show
  1. package/dist/api-contract.cjs.map +1 -1
  2. package/dist/api-contract.mjs.map +1 -1
  3. package/dist/cli/catalog.cjs.map +1 -1
  4. package/dist/cli/catalog.mjs.map +1 -1
  5. package/dist/cli/framework-version.cjs.map +1 -1
  6. package/dist/cli/framework-version.mjs.map +1 -1
  7. package/dist/cli/infra.cjs +1 -1
  8. package/dist/cli/infra.cjs.map +1 -1
  9. package/dist/cli/infra.mjs +1 -1
  10. package/dist/cli/infra.mjs.map +1 -1
  11. package/dist/cli/init.cjs +127 -121
  12. package/dist/cli/init.cjs.map +1 -1
  13. package/dist/cli/init.d.cts +6 -6
  14. package/dist/cli/init.d.cts.map +1 -1
  15. package/dist/cli/init.d.mts +6 -6
  16. package/dist/cli/init.d.mts.map +1 -1
  17. package/dist/cli/init.mjs +125 -121
  18. package/dist/cli/init.mjs.map +1 -1
  19. package/dist/cli/parse.cjs.map +1 -1
  20. package/dist/cli/parse.mjs.map +1 -1
  21. package/dist/cli/prompts.cjs +29 -25
  22. package/dist/cli/prompts.cjs.map +1 -1
  23. package/dist/cli/prompts.mjs +28 -25
  24. package/dist/cli/prompts.mjs.map +1 -1
  25. package/dist/cli/status.cjs.map +1 -1
  26. package/dist/cli/status.mjs.map +1 -1
  27. package/dist/cli/sync.cjs +46 -93
  28. package/dist/cli/sync.cjs.map +1 -1
  29. package/dist/cli/sync.mjs +49 -96
  30. package/dist/cli/sync.mjs.map +1 -1
  31. package/dist/cli/timing.cjs.map +1 -1
  32. package/dist/cli/timing.mjs.map +1 -1
  33. package/dist/cli/upgrade.cjs +41 -20
  34. package/dist/cli/upgrade.cjs.map +1 -1
  35. package/dist/cli/upgrade.mjs +43 -22
  36. package/dist/cli/upgrade.mjs.map +1 -1
  37. package/dist/cli.cjs +187 -12
  38. package/dist/cli.cjs.map +1 -1
  39. package/dist/cli.mjs +187 -12
  40. package/dist/cli.mjs.map +1 -1
  41. package/dist/components/dev-view.cjs.map +1 -1
  42. package/dist/components/dev-view.mjs.map +1 -1
  43. package/dist/components/streaming-view.cjs.map +1 -1
  44. package/dist/components/streaming-view.mjs.map +1 -1
  45. package/dist/config.cjs.map +1 -1
  46. package/dist/config.mjs.map +1 -1
  47. package/dist/contract.cjs +174 -173
  48. package/dist/contract.cjs.map +1 -1
  49. package/dist/contract.d.cts +48 -44
  50. package/dist/contract.d.cts.map +1 -1
  51. package/dist/contract.d.mts +48 -44
  52. package/dist/contract.d.mts.map +1 -1
  53. package/dist/contract.mjs +3 -1
  54. package/dist/contract.mjs.map +1 -1
  55. package/dist/dev-logs.cjs.map +1 -1
  56. package/dist/dev-logs.mjs.map +1 -1
  57. package/dist/dev-session.cjs +0 -1
  58. package/dist/dev-session.mjs +1 -1
  59. package/dist/fastkv.cjs.map +1 -1
  60. package/dist/fastkv.mjs.map +1 -1
  61. package/dist/index.cjs +2 -4
  62. package/dist/index.d.cts +3 -3
  63. package/dist/index.d.mts +3 -3
  64. package/dist/index.mjs +1 -2
  65. package/dist/integrity.cjs.map +1 -1
  66. package/dist/integrity.mjs.map +1 -1
  67. package/dist/internal/manifest-normalizer.cjs.map +1 -1
  68. package/dist/internal/manifest-normalizer.mjs.map +1 -1
  69. package/dist/merge.cjs.map +1 -1
  70. package/dist/merge.mjs.map +1 -1
  71. package/dist/near-cli.cjs +1 -1
  72. package/dist/near-cli.cjs.map +1 -1
  73. package/dist/near-cli.mjs +1 -1
  74. package/dist/near-cli.mjs.map +1 -1
  75. package/dist/orchestrator.cjs +1 -1
  76. package/dist/orchestrator.cjs.map +1 -1
  77. package/dist/orchestrator.mjs +1 -1
  78. package/dist/orchestrator.mjs.map +1 -1
  79. package/dist/plugin.cjs +182 -171
  80. package/dist/plugin.cjs.map +1 -1
  81. package/dist/plugin.d.cts +72 -39
  82. package/dist/plugin.d.cts.map +1 -1
  83. package/dist/plugin.d.mts +71 -39
  84. package/dist/plugin.d.mts.map +1 -1
  85. package/dist/plugin.mjs +170 -160
  86. package/dist/plugin.mjs.map +1 -1
  87. package/dist/sdk.cjs +2 -2
  88. package/dist/sdk.d.cts +1 -1
  89. package/dist/sdk.d.mts +1 -1
  90. package/dist/sdk.mjs +1 -1
  91. package/dist/service-descriptor.d.cts +34 -0
  92. package/dist/service-descriptor.d.cts.map +1 -0
  93. package/dist/service-descriptor.d.mts +36 -0
  94. package/dist/service-descriptor.d.mts.map +1 -0
  95. package/dist/shared.cjs.map +1 -1
  96. package/dist/shared.mjs.map +1 -1
  97. package/dist/types.cjs +184 -184
  98. package/dist/types.cjs.map +1 -1
  99. package/dist/types.d.cts +5 -5
  100. package/dist/types.d.mts +5 -5
  101. package/dist/types.mjs +1 -1
  102. package/dist/types.mjs.map +1 -1
  103. package/dist/ui/types.d.cts +1 -0
  104. package/dist/ui/types.d.cts.map +1 -1
  105. package/dist/ui/types.d.mts +1 -0
  106. package/dist/ui/types.d.mts.map +1 -1
  107. package/dist/utils/banner.cjs.map +1 -1
  108. package/dist/utils/banner.mjs.map +1 -1
  109. package/dist/utils/run.cjs.map +1 -1
  110. package/dist/utils/run.mjs.map +1 -1
  111. package/package.json +3 -3
  112. package/skills/init-upgrade/SKILL.md +22 -16
  113. package/skills/publish-sync/SKILL.md +7 -18
  114. package/dist/utils/path-match.cjs +0 -18
  115. package/dist/utils/path-match.cjs.map +0 -1
  116. package/dist/utils/path-match.mjs +0 -17
  117. package/dist/utils/path-match.mjs.map +0 -1
  118. package/src/api-contract.ts +0 -623
  119. package/src/app.ts +0 -193
  120. package/src/cli/catalog.ts +0 -49
  121. package/src/cli/framework-version.ts +0 -61
  122. package/src/cli/help.ts +0 -13
  123. package/src/cli/infra.ts +0 -190
  124. package/src/cli/init.ts +0 -1202
  125. package/src/cli/parse.ts +0 -147
  126. package/src/cli/prompts.ts +0 -135
  127. package/src/cli/snapshot.ts +0 -46
  128. package/src/cli/status.ts +0 -99
  129. package/src/cli/sync.ts +0 -518
  130. package/src/cli/timing.ts +0 -63
  131. package/src/cli/upgrade.ts +0 -828
  132. package/src/cli.ts +0 -516
  133. package/src/components/dev-view.tsx +0 -352
  134. package/src/components/streaming-view.ts +0 -177
  135. package/src/config.ts +0 -893
  136. package/src/contract.meta.ts +0 -140
  137. package/src/contract.ts +0 -325
  138. package/src/dev-logs.ts +0 -92
  139. package/src/dev-session.ts +0 -283
  140. package/src/fastkv.ts +0 -181
  141. package/src/index.ts +0 -8
  142. package/src/integrity.ts +0 -138
  143. package/src/internal/manifest-normalizer.ts +0 -290
  144. package/src/merge.ts +0 -187
  145. package/src/mf.ts +0 -147
  146. package/src/near-cli.ts +0 -259
  147. package/src/network.ts +0 -3
  148. package/src/orchestrator.ts +0 -493
  149. package/src/plugin.ts +0 -1821
  150. package/src/sdk.ts +0 -14
  151. package/src/service-descriptor.ts +0 -281
  152. package/src/shared.ts +0 -249
  153. package/src/sidebar.ts +0 -140
  154. package/src/types.ts +0 -330
  155. package/src/ui/head.ts +0 -83
  156. package/src/ui/index.ts +0 -5
  157. package/src/ui/metadata.ts +0 -95
  158. package/src/ui/router.ts +0 -88
  159. package/src/ui/runtime.ts +0 -42
  160. package/src/ui/types.ts +0 -64
  161. package/src/utils/banner.ts +0 -21
  162. package/src/utils/linkify.ts +0 -11
  163. package/src/utils/path-match.ts +0 -16
  164. package/src/utils/run.ts +0 -31
  165. package/src/utils/save-config.ts +0 -20
  166. package/src/utils/theme.ts +0 -39
package/src/cli/parse.ts DELETED
@@ -1,147 +0,0 @@
1
- import type { CommandDescriptor } from "./catalog";
2
-
3
- type SchemaLike = {
4
- _def?: {
5
- type?: string;
6
- innerType?: SchemaLike;
7
- shape?: Record<string, SchemaLike>;
8
- values?: Record<string, string> | string[];
9
- };
10
- parse: (value: unknown) => unknown;
11
- };
12
-
13
- function unwrap(schema: SchemaLike): SchemaLike {
14
- let current = schema;
15
- while (true) {
16
- const type = current._def?.type;
17
- if (type === "default" || type === "optional" || type === "nullable" || type === "nullish") {
18
- const inner = current._def?.innerType;
19
- if (!inner) break;
20
- current = inner;
21
- continue;
22
- }
23
- return current;
24
- }
25
- return current;
26
- }
27
-
28
- function isBooleanSchema(schema: SchemaLike): boolean {
29
- return unwrap(schema)._def?.type === "boolean";
30
- }
31
-
32
- function isArraySchema(schema: SchemaLike): boolean {
33
- return unwrap(schema)._def?.type === "array";
34
- }
35
-
36
- function coerceValue(raw: string, schema: SchemaLike): unknown {
37
- const inner = unwrap(schema);
38
- switch (inner._def?.type) {
39
- case "boolean":
40
- return raw === "true" || raw === "1" || raw === "yes";
41
- case "number": {
42
- const value = Number(raw);
43
- if (Number.isNaN(value)) throw new Error(`Invalid number: ${raw}`);
44
- return value;
45
- }
46
- case "enum":
47
- return raw;
48
- default:
49
- return raw;
50
- }
51
- }
52
-
53
- function toFlagName(field: string): string {
54
- return `--${field.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase()}`;
55
- }
56
-
57
- function getShape(schema: SchemaLike): Record<string, SchemaLike> {
58
- const inner = unwrap(schema);
59
- const shape = inner._def?.shape;
60
- if (!shape) return {};
61
- return shape;
62
- }
63
-
64
- export function parseCommandInput(descriptor: CommandDescriptor, argv: string[]): unknown {
65
- const schema = (descriptor.procedure as any)["~orpc"]?.inputSchema as SchemaLike | undefined;
66
- if (!schema) return {};
67
-
68
- const shape = getShape(schema);
69
- const fields = Object.entries(shape);
70
- const fieldByFlag = new Map<string, string>();
71
- const positionalFields: string[] = [];
72
-
73
- for (const [fieldName] of fields) {
74
- fieldByFlag.set(toFlagName(fieldName), fieldName);
75
- if (descriptor.meta.fields?.[fieldName]?.positional) {
76
- positionalFields.push(fieldName);
77
- }
78
- }
79
-
80
- const input: Record<string, unknown> = {};
81
- const positionals: string[] = [];
82
-
83
- for (let i = 0; i < argv.length; i += 1) {
84
- const token = argv[i];
85
- if (!token) continue;
86
-
87
- if (token.startsWith("--no-")) {
88
- const flagName = `--${token.slice(5)}`;
89
- const fieldName = fieldByFlag.get(flagName);
90
- if (!fieldName) throw new Error(`Unknown flag: ${token}`);
91
- input[fieldName] = false;
92
- continue;
93
- }
94
-
95
- if (token.startsWith("--")) {
96
- const [flag, inline] = token.split("=", 2);
97
- const fieldName = fieldByFlag.get(flag);
98
- if (!fieldName) throw new Error(`Unknown flag: ${token}`);
99
-
100
- const fieldSchema = shape[fieldName];
101
- if (isBooleanSchema(fieldSchema)) {
102
- input[fieldName] = inline ? coerceValue(inline, fieldSchema) : true;
103
- continue;
104
- }
105
-
106
- const next = inline ?? argv[i + 1];
107
-
108
- if (isArraySchema(fieldSchema)) {
109
- if (next === undefined || next.startsWith("--")) {
110
- throw new Error(`Missing value for ${flag}`);
111
- }
112
- input[fieldName] = next
113
- .split(",")
114
- .map((s: string) => s.trim())
115
- .filter(Boolean);
116
- if (!inline) i += 1;
117
- continue;
118
- }
119
-
120
- if (next === undefined || next.startsWith("--")) {
121
- throw new Error(`Missing value for ${flag}`);
122
- }
123
- input[fieldName] = coerceValue(next, fieldSchema);
124
- if (!inline) i += 1;
125
- continue;
126
- }
127
-
128
- positionals.push(token);
129
- }
130
-
131
- if (positionalFields.length > 0) {
132
- positionalFields.forEach((fieldName, index) => {
133
- const raw = positionals[index];
134
- if (raw !== undefined) {
135
- input[fieldName] = coerceValue(raw, shape[fieldName]);
136
- }
137
- });
138
- } else if (positionals.length > 0) {
139
- const candidate = fields.find(([, fieldSchema]) => !isBooleanSchema(fieldSchema));
140
- if (candidate) {
141
- const [fieldName, fieldSchema] = candidate;
142
- input[fieldName] = coerceValue(positionals[0], fieldSchema);
143
- }
144
- }
145
-
146
- return schema.parse(input);
147
- }
@@ -1,135 +0,0 @@
1
- import process from "node:process";
2
- import * as p from "@clack/prompts";
3
- import type { OverrideSection } from "../contract";
4
-
5
- function parseExtendsRef(ref: string): { account: string; gateway: string } | null {
6
- const normalized = ref.startsWith("bos://") ? ref : `bos://${ref}`;
7
- const match = normalized.match(/^bos:\/\/([^/]+)\/(.+)$/);
8
- if (!match) return null;
9
- return { account: match[1], gateway: match[2] };
10
- }
11
-
12
- function deriveAccountFromExtends(domain: string, extendsAccount: string): string {
13
- const firstSegment = domain.split(".")[0];
14
- if (!firstSegment) return "";
15
- const suffix = extendsAccount.includes(".")
16
- ? extendsAccount.substring(extendsAccount.indexOf(".") + 1)
17
- : extendsAccount;
18
- return `${firstSegment}.${suffix}`;
19
- }
20
-
21
- const OVERRIDE_OPTIONS: { value: OverrideSection; label: string; hint: string }[] = [
22
- { value: "ui", label: "ui", hint: "Override UI with local source" },
23
- { value: "api", label: "api", hint: "Override API with local source" },
24
- { value: "host", label: "host", hint: "Override host with local source" },
25
- { value: "plugins", label: "plugins", hint: "Override selected plugins with local source" },
26
- ];
27
-
28
- export async function promptInitOptions(input: {
29
- extends?: string;
30
- directory?: string;
31
- account?: string;
32
- domain?: string;
33
- plugins?: string[];
34
- overrides?: OverrideSection[];
35
- parentPluginKeys?: string[];
36
- }): Promise<{
37
- extendsAccount: string;
38
- extendsGateway: string;
39
- directory: string;
40
- account?: string;
41
- domain?: string;
42
- plugins: string[];
43
- overrides: OverrideSection[];
44
- }> {
45
- p.intro("Let's build an app...");
46
-
47
- const extendsInput =
48
- input.extends ??
49
- ((await p.text({
50
- message: "Extending an existing app?",
51
- placeholder: "bos://dev.everything.near/everything.dev",
52
- })) as string);
53
-
54
- if (p.isCancel(extendsInput)) process.exit(0);
55
-
56
- let extendsAccount = "dev.everything.near";
57
- let extendsGateway = "everything.dev";
58
-
59
- if (extendsInput) {
60
- const parsed = parseExtendsRef(extendsInput);
61
- if (parsed) {
62
- extendsAccount = parsed.account;
63
- extendsGateway = parsed.gateway;
64
- }
65
- }
66
-
67
- const domain =
68
- input.domain ??
69
- ((await p.text({
70
- message: "Starting with a domain?",
71
- placeholder: "no",
72
- })) as string);
73
-
74
- if (p.isCancel(domain)) process.exit(0);
75
-
76
- const accountDefault = domain ? deriveAccountFromExtends(domain, extendsAccount) : "";
77
- const account =
78
- input.account ??
79
- ((await p.text({
80
- message: "What NEAR account will you publish from?",
81
- placeholder: accountDefault || "skip",
82
- defaultValue: accountDefault,
83
- })) as string);
84
-
85
- if (p.isCancel(account)) process.exit(0);
86
-
87
- const directory = input.directory || domain || extendsGateway;
88
-
89
- const overrides =
90
- input.overrides ??
91
- ((await p.multiselect({
92
- message: "Which sections would you like to customize",
93
- options: OVERRIDE_OPTIONS,
94
- initialValues: ["ui", "api"] as OverrideSection[],
95
- required: false,
96
- })) as OverrideSection[]);
97
-
98
- if (p.isCancel(overrides)) process.exit(0);
99
-
100
- let plugins: string[] = [];
101
- if (overrides.includes("plugins")) {
102
- const parentPlugins = input.parentPluginKeys ?? [];
103
- const pluginOptions =
104
- parentPlugins.length > 0 ? parentPlugins.map((key) => ({ value: key, label: key })) : [];
105
-
106
- plugins =
107
- input.plugins ??
108
- (pluginOptions.length > 0
109
- ? ((await p.multiselect({
110
- message: "Select plugins to include:",
111
- options: pluginOptions,
112
- required: false,
113
- })) as string[])
114
- : []);
115
-
116
- if (p.isCancel(plugins)) process.exit(0);
117
- }
118
-
119
- const go = await p.confirm({
120
- message: "GO!",
121
- initialValue: true,
122
- });
123
-
124
- if (p.isCancel(go) || !go) process.exit(0);
125
-
126
- return {
127
- extendsAccount,
128
- extendsGateway,
129
- directory,
130
- account: account || undefined,
131
- domain: domain || undefined,
132
- plugins,
133
- overrides,
134
- };
135
- }
@@ -1,46 +0,0 @@
1
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
2
- import { join } from "node:path";
3
-
4
- export interface SyncSnapshot {
5
- parentRef: string;
6
- timestamp: string;
7
- files: Record<string, string>;
8
- }
9
-
10
- const SNAPSHOT_DIR = ".bos";
11
- const SNAPSHOT_FILE = "sync-snapshot.json";
12
-
13
- function snapshotPath(projectDir: string): string {
14
- return join(projectDir, SNAPSHOT_DIR, SNAPSHOT_FILE);
15
- }
16
-
17
- export async function readSnapshot(projectDir: string): Promise<SyncSnapshot | null> {
18
- const path = snapshotPath(projectDir);
19
- if (!existsSync(path)) {
20
- return null;
21
- }
22
- try {
23
- const content = readFileSync(path, "utf-8");
24
- return JSON.parse(content) as SyncSnapshot;
25
- } catch {
26
- return null;
27
- }
28
- }
29
-
30
- export async function writeSnapshot(
31
- projectDir: string,
32
- data: { parentRef: string; files: Record<string, string> },
33
- ): Promise<void> {
34
- const dir = join(projectDir, SNAPSHOT_DIR);
35
- if (!existsSync(dir)) {
36
- mkdirSync(dir, { recursive: true });
37
- }
38
-
39
- const snapshot: SyncSnapshot = {
40
- parentRef: data.parentRef,
41
- timestamp: new Date().toISOString(),
42
- files: data.files,
43
- };
44
-
45
- writeFileSync(snapshotPath(projectDir), `${JSON.stringify(snapshot, null, 2)}\n`);
46
- }
package/src/cli/status.ts DELETED
@@ -1,99 +0,0 @@
1
- import { existsSync, readFileSync } from "node:fs";
2
- import { join } from "node:path";
3
- import type { StatusResult } from "../contract";
4
- import { fetchBosConfigFromFastKv } from "../fastkv";
5
- import { readInstalledFrameworkVersion } from "./framework-version";
6
- import { readSnapshot } from "./snapshot";
7
-
8
- const FRAMEWORK_PACKAGES = ["everything-dev", "every-plugin"];
9
-
10
- const CATALOG_TOOL_PACKAGES = [
11
- "@rspack/core",
12
- "@rspack/cli",
13
- "@rsbuild/core",
14
- "@rsbuild/plugin-react",
15
- "@module-federation/enhanced",
16
- "@module-federation/node",
17
- "@module-federation/rsbuild-plugin",
18
- "@module-federation/runtime-core",
19
- "@module-federation/sdk",
20
- "@module-federation/dts-plugin",
21
- ] as const;
22
-
23
- async function fetchLatestNpmVersion(packageName: string): Promise<string | null> {
24
- try {
25
- const response = await fetch(`https://registry.npmjs.org/${packageName}/latest`, {
26
- headers: { Accept: "application/json" },
27
- signal: AbortSignal.timeout(10_000),
28
- });
29
- if (!response.ok) return null;
30
- const data = (await response.json()) as { version: string };
31
- return data.version;
32
- } catch {
33
- return null;
34
- }
35
- }
36
-
37
- function readInstalledVersion(projectDir: string, packageName: string): string | undefined {
38
- return readInstalledFrameworkVersion(projectDir, packageName);
39
- }
40
-
41
- function checkEnvFile(projectDir: string): "found" | "missing" | "example-only" {
42
- if (existsSync(join(projectDir, ".env"))) return "found";
43
- if (existsSync(join(projectDir, ".env.example"))) return "example-only";
44
- return "missing";
45
- }
46
-
47
- async function checkParentReachable(extendsRef: string | undefined): Promise<boolean | undefined> {
48
- if (!extendsRef?.startsWith("bos://")) return undefined;
49
- try {
50
- const config = await fetchBosConfigFromFastKv(extendsRef);
51
- return config !== null;
52
- } catch {
53
- return false;
54
- }
55
- }
56
-
57
- export async function getStatus(projectDir: string): Promise<StatusResult> {
58
- const configPath = join(projectDir, "bos.config.json");
59
- if (!existsSync(configPath)) {
60
- return {
61
- status: "error",
62
- error: "No bos.config.json found in current directory",
63
- packages: [],
64
- envFile: "missing",
65
- };
66
- }
67
-
68
- const config = JSON.parse(readFileSync(configPath, "utf-8")) as Record<string, unknown>;
69
-
70
- const packages = [];
71
- for (const name of FRAMEWORK_PACKAGES) {
72
- const installed = readInstalledVersion(projectDir, name);
73
- const latest = await fetchLatestNpmVersion(name);
74
- packages.push({ name, installed, latest: latest ?? undefined });
75
- }
76
-
77
- for (const name of CATALOG_TOOL_PACKAGES) {
78
- const installed = readInstalledVersion(projectDir, name);
79
- if (!installed) continue;
80
- const latest = await fetchLatestNpmVersion(name);
81
- packages.push({ name, installed, latest: latest ?? undefined });
82
- }
83
-
84
- const snapshot = await readSnapshot(projectDir);
85
-
86
- const extendsRef = config.extends as string | undefined;
87
- const parentReachable = await checkParentReachable(extendsRef);
88
-
89
- return {
90
- status: "ok",
91
- extends: extendsRef,
92
- account: config.account as string | undefined,
93
- domain: config.domain as string | undefined,
94
- packages,
95
- lastSync: snapshot?.timestamp,
96
- envFile: checkEnvFile(projectDir),
97
- parentReachable,
98
- };
99
- }