@react-consulting/rc-kit 0.13.2 → 0.13.4

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.
@@ -181,9 +181,11 @@ describe("migrateToKitPackage", () => {
181
181
  ".github/actions/setup/action.yml": " path: .rc-kit\n",
182
182
  ".env.example": "# secrets lus par rc op:sync\n",
183
183
  "scripts/dev/boot.ts":
184
- 'spawnSync(rc, ["op:sync"])\nconsole.warn("rc op:sync a échoué")\n',
184
+ 'spawnSync(rc, ["op:sync"])\nconsole.warn("rc op:sync a échoué")\nthrow new Error("lance `bun run op:sync`")\n',
185
185
  "vendor/other/.git": "gitdir: elsewhere\n",
186
186
  "vendor/other/b.ts": 'import "@rc/kit"\n',
187
+ "CLAUDE.md": "bun dev # rc op:sync puis turbo\n",
188
+ "apps/api/wrangler.jsonc": "// secrets lus par `rc op:sync`\n{}\n",
187
189
  "rc.config.json":
188
190
  '{\n "project": "contoso-stay",\n "apps": { "api": { "path": "apps/api" } }\n}\n',
189
191
  })
@@ -217,8 +219,14 @@ describe("migrateToKitPackage", () => {
217
219
  expect(result.manual.some((line) => line.includes(".env.example"))).toBe(
218
220
  true
219
221
  )
222
+ expect(readFileSync(join(root, "CLAUDE.md"), "utf8")).toContain(
223
+ "rc secrets:pull puis turbo"
224
+ )
225
+ expect(
226
+ readFileSync(join(root, "apps/api/wrangler.jsonc"), "utf8")
227
+ ).toContain("`rc secrets:pull`")
220
228
  expect(readFileSync(join(root, "scripts/dev/boot.ts"), "utf8")).toBe(
221
- 'spawnSync(rc, ["secrets:pull"])\nconsole.warn("rc secrets:pull a échoué")\n'
229
+ 'spawnSync(rc, ["secrets:pull"])\nconsole.warn("rc secrets:pull a échoué")\nthrow new Error("lance `bun run secrets:pull`")\n'
222
230
  )
223
231
  expect(result.changes.map((change) => change.file)).not.toContain(
224
232
  ".worktrees/kit/src/a.ts"
@@ -53,7 +53,7 @@ const SCRIPT_REWRITES: [RegExp, string][] = [
53
53
  ]
54
54
  const BUILD_IMPORT_RE =
55
55
  /(["'])(?:\.\.?\/)+scripts\/(?:build-commit-sha|deployed-public-env)(?:\.ts)?\1/g
56
- const SOURCE_EXTENSIONS = /\.(?:[cm]?[jt]sx?|astro|vue|svelte)$/
56
+ const SOURCE_EXTENSIONS = /\.(?:[cm]?[jt]sx?|astro|vue|svelte|jsonc)$/
57
57
  const DOC_EXTENSIONS = /\.mdx?$|\.example$/
58
58
  const STALE_DOC_RE =
59
59
  /_rc-kit|@rc\/kit(?![\w-])|ensure-rc-kit|\bop:sync\b|upload-sourcemaps|on-workers-ci/
@@ -78,7 +78,7 @@ const DEPENDENCY_FIELDS = [
78
78
  const LEGACY_SECRETS_SCRIPT = "op:sync"
79
79
  const SECRETS_SCRIPT = "secrets:pull"
80
80
  const LEGACY_SECRETS_LITERAL_RE = /(["'`])op:sync\1/g
81
- const LEGACY_SECRETS_COMMAND_RE = /\brc op:sync\b/g
81
+ const LEGACY_SECRETS_COMMAND_RE = /\b(rc|run) op:sync\b/g
82
82
  const SOURCEMAPS_PROJECT_RE = /rc sentry:sourcemaps --project (\S+)/g
83
83
  const LEGACY_SENTRY_ORG_RE = /SENTRY_ORG\s*\?\?\s*["']([^"']+)["']/
84
84
 
@@ -354,7 +354,7 @@ function migrateSources(migration: Migration): void {
354
354
  .replace(LEGACY_IMPORT_RE, KIT_PACKAGE)
355
355
  .replace(BUILD_IMPORT_RE, `$1${KIT_PACKAGE}/build$1`)
356
356
  .replace(LEGACY_SECRETS_LITERAL_RE, `$1${SECRETS_SCRIPT}$1`)
357
- .replace(LEGACY_SECRETS_COMMAND_RE, `rc ${SECRETS_SCRIPT}`)
357
+ .replace(LEGACY_SECRETS_COMMAND_RE, `$1 ${SECRETS_SCRIPT}`)
358
358
 
359
359
  if (next !== text) {
360
360
  migration.write(file, next, `imports et appels vers ${KIT_PACKAGE}`)
@@ -382,7 +382,9 @@ function migrateAgentFiles(migration: Migration): void {
382
382
  next = next.replaceAll(`@${spec}`, RULES_IMPORT)
383
383
  }
384
384
 
385
- next = next.replace(LEGACY_IMPORT_RE, KIT_PACKAGE)
385
+ next = next
386
+ .replace(LEGACY_IMPORT_RE, KIT_PACKAGE)
387
+ .replace(LEGACY_SECRETS_COMMAND_RE, `$1 ${SECRETS_SCRIPT}`)
386
388
 
387
389
  if (next !== text) {
388
390
  migration.write(file, next, `règles importées par ${RULES_IMPORT}`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-consulting/rc-kit",
3
- "version": "0.13.2",
3
+ "version": "0.13.4",
4
4
  "description": "Règles, composants, CLI rc et modèle de départ pour des projets Cloudflare Workers en Bun",
5
5
  "license": "MIT",
6
6
  "repository": {