fimo 0.3.3-experimental.1783347971089 → 0.3.3-staging.23

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.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "bundled": true,
3
3
  "bundler": "esbuild",
4
- "bundledAt": "2026-07-06T14:26:15.938Z",
5
- "cliVersion": "0.3.3-experimental.1783347971089",
4
+ "bundledAt": "2026-07-06T17:55:19.533Z",
5
+ "cliVersion": "0.3.3",
6
6
  "external": [
7
7
  "oxc-parser",
8
8
  "fsevents"
package/dist/cli/index.js CHANGED
@@ -42329,6 +42329,70 @@ var init_project_env_dto = __esm({
42329
42329
  }
42330
42330
  });
42331
42331
 
42332
+ // ../../packages/api-contracts/dist/esm/dtos/project-import-export.dto.js
42333
+ var ExportProjectResponseDTOSchema, ExportProjectResponseDTO, ImportProjectResultDTOSchema, ImportProjectResultDTO, ImportPreviewCountsDTOSchema, ImportPreviewSurfaceDTOSchema, ImportPreviewDTOSchema, ImportPreviewDTO, ImportPreviewResponseDTOSchema, ImportPreviewResponseDTO;
42334
+ var init_project_import_export_dto = __esm({
42335
+ "../../packages/api-contracts/dist/esm/dtos/project-import-export.dto.js"() {
42336
+ "use strict";
42337
+ init_zod();
42338
+ init_create_dto();
42339
+ ExportProjectResponseDTOSchema = external_exports.object({
42340
+ success: external_exports.literal(true),
42341
+ downloadUrl: external_exports.string(),
42342
+ expiresAt: external_exports.string(),
42343
+ fileSize: external_exports.number(),
42344
+ duration: external_exports.number()
42345
+ });
42346
+ ExportProjectResponseDTO = createDTO(ExportProjectResponseDTOSchema);
42347
+ ImportProjectResultDTOSchema = external_exports.object({
42348
+ success: external_exports.literal(true),
42349
+ projectId: external_exports.string(),
42350
+ projectName: external_exports.string(),
42351
+ displayName: external_exports.string(),
42352
+ projectUrl: external_exports.string(),
42353
+ duration: external_exports.number()
42354
+ });
42355
+ ImportProjectResultDTO = createDTO(ImportProjectResultDTOSchema);
42356
+ ImportPreviewCountsDTOSchema = external_exports.object({
42357
+ contentTypes: external_exports.number(),
42358
+ entries: external_exports.number(),
42359
+ assets: external_exports.number(),
42360
+ translations: external_exports.number(),
42361
+ forms: external_exports.number(),
42362
+ codeFiles: external_exports.number(),
42363
+ assetFiles: external_exports.number()
42364
+ });
42365
+ ImportPreviewSurfaceDTOSchema = external_exports.object({
42366
+ name: external_exports.string(),
42367
+ included: external_exports.boolean(),
42368
+ count: external_exports.number().optional(),
42369
+ note: external_exports.string().optional()
42370
+ });
42371
+ ImportPreviewDTOSchema = external_exports.object({
42372
+ projectName: external_exports.string(),
42373
+ displayName: external_exports.string().nullable(),
42374
+ visibility: external_exports.string().nullable(),
42375
+ category: external_exports.string().nullable(),
42376
+ exportedAt: external_exports.string(),
42377
+ version: external_exports.string(),
42378
+ envScope: external_exports.enum([
42379
+ "main",
42380
+ "tree"
42381
+ ]),
42382
+ counts: ImportPreviewCountsDTOSchema,
42383
+ surfaces: external_exports.array(ImportPreviewSurfaceDTOSchema),
42384
+ fileSize: external_exports.number(),
42385
+ fileName: external_exports.string()
42386
+ });
42387
+ ImportPreviewDTO = createDTO(ImportPreviewDTOSchema);
42388
+ ImportPreviewResponseDTOSchema = external_exports.object({
42389
+ success: external_exports.literal(true),
42390
+ preview: ImportPreviewDTOSchema
42391
+ });
42392
+ ImportPreviewResponseDTO = createDTO(ImportPreviewResponseDTOSchema);
42393
+ }
42394
+ });
42395
+
42332
42396
  // ../../packages/api-contracts/dist/esm/dtos/agent-trigger.dto.js
42333
42397
  var TriggerKindSchema, ManualTriggerSchema2, ScheduleTriggerSchema, WebhookTriggerSchema2, TriggerSchema2;
42334
42398
  var init_agent_trigger_dto = __esm({
@@ -45378,6 +45442,7 @@ var init_esm = __esm({
45378
45442
  init_audit_log();
45379
45443
  init_project_dto();
45380
45444
  init_project_env_dto();
45445
+ init_project_import_export_dto();
45381
45446
  init_agent_trigger_dto();
45382
45447
  init_agent_activation_dto();
45383
45448
  init_agent_list_item_dto();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fimo",
3
- "version": "0.3.3-experimental.1783347971089",
3
+ "version": "0.3.3-staging.23",
4
4
  "description": "Fimo CLI - create, deploy, and manage Fimo projects",
5
5
  "bin": {
6
6
  "fimo": "dist/cli/index.js"
@@ -10,20 +10,25 @@
10
10
  // What it does:
11
11
  // 1. Resolves the channel from the shared table (lib/channels.mjs).
12
12
  // 2. Guards: @latest refuses to publish outside CI unless --bootstrap.
13
- // 3. Bakes a channel-appropriate release.json (lib/release-core.mjs) —
14
- // staging URLs for experimental/staging, prod for latest. Never a tunnel.
15
- // 4. For prerelease channels, synthesizes a disposable X.Y.Z-<tag>.<n> version.
16
- // 5. Runs `npm publish --tag <distTag>` (no --provenance — strapi/fimo is private).
13
+ // 3. Builds in place (clean → build → build:bundle) with the workspace
14
+ // manifest UNTOUCHED, then `npm pack`s straight into a temp stage dir.
15
+ // 4. Mutates ONLY the extracted stage copy: synthesized X.Y.Z-<tag>.<n>
16
+ // version, template fimo pin, channel release.json (allowlist-enforced —
17
+ // staging URLs for experimental/staging, prod for latest, never a tunnel).
18
+ // 5. Runs `npm publish --tag <distTag>` from the stage (no --provenance —
19
+ // strapi/fimo is private).
17
20
  // 6. On real experimental publishes, records the exact version in repo-root
18
21
  // .fimo/dev.json for local source-checkout deploys.
19
- // 7. Restores package.json + removes the transient release.json.
20
22
  //
21
- // `npm publish` triggers prepublishOnly (clean → build → build:bundle), so the
22
- // bundled tarball is always fresh.
23
+ // The workspace is never mutated: no transient package.json version, no
24
+ // release.json, no template rewrites — a crash or a long OTP prompt can't
25
+ // leave the repo dirty (it used to sit mutated for the whole multi-minute
26
+ // build + 2FA window).
23
27
 
24
28
  import { spawnSync } from 'node:child_process';
25
- import { existsSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
26
- import { dirname, resolve } from 'node:path';
29
+ import { mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
30
+ import { tmpdir } from 'node:os';
31
+ import { dirname, join, resolve } from 'node:path';
27
32
  import { fileURLToPath } from 'node:url';
28
33
 
29
34
  import { resolveChannel } from './lib/channels.mjs';
@@ -38,7 +43,6 @@ import {
38
43
  const HERE = dirname(fileURLToPath(import.meta.url));
39
44
  const CLI_ROOT = resolve(HERE, '..');
40
45
  const PKG_PATH = resolve(CLI_ROOT, 'package.json');
41
- const RELEASE_PATH = resolve(CLI_ROOT, 'release.json');
42
46
 
43
47
  function parseArgs(argv) {
44
48
  const args = { channel: null, dryRun: false, bootstrap: false, plan: false };
@@ -57,6 +61,15 @@ function parseArgs(argv) {
57
61
  return args;
58
62
  }
59
63
 
64
+ function run(cmd, args, cwd) {
65
+ console.log(`[publish-npm] $ ${cmd} ${args.join(' ')}`);
66
+ const result = spawnSync(cmd, args, { cwd, stdio: 'inherit' });
67
+ if (result.status !== 0) {
68
+ console.error(`[publish-npm] ${cmd} ${args[0]} failed (exit ${result.status}).`);
69
+ process.exit(result.status ?? 1);
70
+ }
71
+ }
72
+
60
73
  const { channel: channelName, dryRun, bootstrap, plan } = parseArgs(process.argv.slice(2));
61
74
 
62
75
  if (!channelName) {
@@ -93,38 +106,40 @@ if (plan) {
93
106
  process.exit(0);
94
107
  }
95
108
 
96
- let versionMutated = false;
97
- let restoreTemplate = () => {};
98
- let restoreLockfile = () => {};
109
+ const stageRoot = mkdtempSync(join(tmpdir(), 'fimo-publish-'));
99
110
  try {
100
- // 1. Set the synthesized version for prerelease channels.
101
- if (publishVersion !== baseVersion) {
102
- writeFileSync(PKG_PATH, JSON.stringify({ ...pkg, version: publishVersion }, null, 2) + '\n');
103
- versionMutated = true;
111
+ // 1. Build in place — the build output doesn't depend on the version, so
112
+ // the workspace manifest stays untouched.
113
+ run('pnpm', ['run', 'prepublishOnly'], CLI_ROOT);
114
+
115
+ // 2. Pack the workspace tarball (honors the `files` whitelist) directly
116
+ // into the stage dir; --ignore-scripts because we just built.
117
+ run('npm', ['pack', '--ignore-scripts', '--pack-destination', stageRoot], CLI_ROOT);
118
+ const tarball = readdirSync(stageRoot).find((name) => name.endsWith('.tgz'));
119
+ if (!tarball) {
120
+ console.error(`[publish-npm] npm pack produced no tarball in ${stageRoot}.`);
121
+ process.exit(1);
104
122
  }
105
-
106
- // 2. Pin the bundled template's fimo dep to the exact version, and drop its
107
- // lockfile (can't pin an unpublished version; create regenerates it).
108
- restoreTemplate = pinTemplateFimo(CLI_ROOT, publishVersion);
109
- restoreLockfile = stripTemplateLockfile(CLI_ROOT);
110
-
111
- // 3. Bake release.json (allowlist-enforced).
112
- writeReleaseJson(CLI_ROOT, channel);
113
-
114
- // 4. Publish. No --provenance: sigstore provenance requires a PUBLIC source
115
- // repo, and strapi/fimo is private (npm returns 422 otherwise). Trusted
116
- // Publishing (OIDC auth) works regardless of repo visibility — it's only
117
- // the attestation that's public-repo-only.
118
- const publishArgs = ['publish', '--access', 'public', '--tag', channel.distTag];
123
+ run('tar', ['-xzf', join(stageRoot, tarball), '-C', stageRoot], stageRoot);
124
+ const stage = join(stageRoot, 'package');
125
+
126
+ // 3. Mutate ONLY the stage copy: synthesized version, template pin,
127
+ // channel release.json.
128
+ const stagePkg = JSON.parse(readFileSync(join(stage, 'package.json'), 'utf8'));
129
+ writeFileSync(join(stage, 'package.json'), JSON.stringify({ ...stagePkg, version: publishVersion }, null, 2) + '\n');
130
+ pinTemplateFimo(stage, publishVersion);
131
+ stripTemplateLockfile(stage);
132
+ writeReleaseJson(stage, channel);
133
+
134
+ // 4. Publish from the stage. No --provenance: sigstore provenance requires
135
+ // a PUBLIC source repo, and strapi/fimo is private (npm returns 422
136
+ // otherwise). Trusted Publishing (OIDC auth) works regardless of repo
137
+ // visibility — it's only the attestation that's public-only.
138
+ const publishArgs = ['publish', '--access', 'public', '--tag', channel.distTag, '--ignore-scripts'];
119
139
  if (dryRun) {
120
140
  publishArgs.push('--dry-run');
121
141
  }
122
- console.log(`[publish-npm] $ npm ${publishArgs.join(' ')}`);
123
- const result = spawnSync('npm', publishArgs, { cwd: CLI_ROOT, stdio: 'inherit' });
124
- if (result.status !== 0) {
125
- console.error(`[publish-npm] npm publish failed (exit ${result.status}).`);
126
- process.exit(result.status ?? 1);
127
- }
142
+ run('npm', publishArgs, stage);
128
143
 
129
144
  if (!dryRun && channel.distTag === 'experimental') {
130
145
  const devStatePath = writeDevReleaseState(CLI_ROOT, {
@@ -134,16 +149,7 @@ try {
134
149
  console.log(`[publish-npm] wrote ${devStatePath}`);
135
150
  }
136
151
  } finally {
137
- // Restore the workspace: package.json version, template fimo pin, and remove
138
- // the transient release.json so local `fimo` runs fall back to localhost.
139
- if (versionMutated) {
140
- writeFileSync(PKG_PATH, JSON.stringify(pkg, null, 2) + '\n');
141
- }
142
- restoreTemplate();
143
- restoreLockfile();
144
- if (existsSync(RELEASE_PATH)) {
145
- rmSync(RELEASE_PATH, { force: true });
146
- }
152
+ rmSync(stageRoot, { recursive: true, force: true });
147
153
  }
148
154
 
149
155
  console.log(`[publish-npm] done${dryRun ? ' (dry-run — nothing published)' : ''}.`);
@@ -21,7 +21,7 @@
21
21
  "cmdk": "^1.1.1",
22
22
  "date-fns": "^4.1.0",
23
23
  "embla-carousel-react": "^8.6.0",
24
- "fimo": "0.3.3-experimental.1783347971089",
24
+ "fimo": "0.3.3-staging.23",
25
25
  "input-otp": "^1.4.2",
26
26
  "isbot": "^5",
27
27
  "lucide-react": "^0.577.0",