code-foundry 0.17.0 → 0.18.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.
@@ -11,7 +11,7 @@ force=false
11
11
  languages="${REPO_FOUNDRY_LANGUAGES:-auto}"
12
12
  features="${REPO_FOUNDRY_FEATURES:-all}"
13
13
  package_manager="${REPO_FOUNDRY_PACKAGE_MANAGER:-auto}"
14
- runtime_repository="${REPO_FOUNDRY_RUNTIME_REPOSITORY:-0xPlayerOne/code-foundry}"
14
+ runtime_repository="${REPO_FOUNDRY_RUNTIME_REPOSITORY:-}"
15
15
  bootstrap=true
16
16
  release_type="${REPO_FOUNDRY_RELEASE_TYPE:-auto}"
17
17
  npm_publish="${REPO_FOUNDRY_NPM_PUBLISH:-false}"
@@ -38,7 +38,7 @@ Options:
38
38
  --features LIST all or comma-separated optional features:
39
39
  ci,codeql,security,test,draft-pr,release-pr,release,dependabot
40
40
  --package-manager NAME auto, bun, pnpm, yarn, or npm
41
- --runtime-repository OWNER/REPO Reusable workflow runtime repository
41
+ --runtime-repository OWNER/REPO Reusable workflow runtime repository (auto from source)
42
42
  --release-type NAME auto, node, python, rust, or simple
43
43
  --license NAME agpl-3.0-or-later, mit, preserve, or none
44
44
  --license-file PATH Use an exact custom license file
@@ -111,9 +111,9 @@ sync_args=(
111
111
  --languages "$languages"
112
112
  --features "$features"
113
113
  --package-manager "$package_manager"
114
- --runtime-repository "$runtime_repository"
115
114
  --license "$license"
116
115
  )
116
+ if [ -n "$runtime_repository" ]; then sync_args+=(--runtime-repository "$runtime_repository"); fi
117
117
  if [ -n "$license_file" ]; then sync_args+=(--license-file "$license_file"); fi
118
118
  if [ "$dry_run" = true ]; then sync_args+=(--check); else sync_args+=(--apply); fi
119
119
  if [ "$prune" = true ]; then sync_args+=(--prune); fi
@@ -370,16 +370,22 @@ for file in "${files[@]}"; do
370
370
  done
371
371
 
372
372
  # Reusable workflow callers must use a literal repository/ref. Render the
373
- # selected runtime repository while leaving custom workflows untouched.
373
+ # selected runtime repository while leaving custom workflows untouched. Read
374
+ # the source's configured runtime first so forks remain self-contained.
375
+ source_runtime_repository=""
376
+ if [ -f "$template_root/.github/template.yml" ]; then
377
+ source_runtime_repository="$(awk -F': ' '/^runtime_repository:/ {print $2; exit}' "$template_root/.github/template.yml")"
378
+ fi
379
+ [ -n "$source_runtime_repository" ] || source_runtime_repository="0xPlayerOne/code-foundry"
374
380
  for file in .github/workflows/ci.yml .github/workflows/test.yml .github/workflows/security.yml .github/workflows/codeql.yml; do
375
381
  [ -f "$file" ] || continue
376
- if grep -q '0xPlayerOne/code-foundry' "$file"; then
382
+ if grep -qF "$source_runtime_repository" "$file" && [ "$source_runtime_repository" != "$runtime_repository" ]; then
377
383
  changed=$((changed + 1))
378
384
  if [ "$mode" = "check" ]; then
379
385
  printf 'Would render runtime repository in %s\n' "$file"
380
386
  else
381
387
  rendered_workflow="$(mktemp)"
382
- sed "s#0xPlayerOne/code-foundry#$runtime_repository#g" "$file" > "$rendered_workflow"
388
+ sed "s#${source_runtime_repository}#${runtime_repository}#g" "$file" > "$rendered_workflow"
383
389
  mv "$rendered_workflow" "$file"
384
390
  printf 'Rendered runtime repository in %s\n' "$file"
385
391
  fi
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.18.0](https://github.com/0xPlayerOne/code-foundry/compare/v0.17.0...v0.18.0) (2026-07-28)
4
+
5
+
6
+ ### Features
7
+
8
+ * **init:** infer runtime from source template ([81a545b](https://github.com/0xPlayerOne/code-foundry/commit/81a545bc6a2d89c31be51a711e477c4e4ceca7dd))
9
+
3
10
  ## [0.17.0](https://github.com/0xPlayerOne/code-foundry/compare/v0.16.0...v0.17.0) (2026-07-28)
4
11
 
5
12
 
package/README.md CHANGED
@@ -36,11 +36,12 @@ npx code-foundry init --license agpl-3.0-or-later
36
36
  npx code-foundry init --license-file ./legal/LICENSE.txt
37
37
  ```
38
38
 
39
- Reusable workflow callers default to this package's public runtime. Use
40
- `--runtime-repository OWNER/REPO` when initializing from an organization fork;
41
- the selected repository is saved in `.github/template.yml` and rendered into
42
- the small `ci.yml` and `test.yml` wrappers automatically. The equivalent
43
- environment variable is `REPO_FOUNDRY_RUNTIME_REPOSITORY`.
39
+ Reusable workflow callers use the source template's runtime automatically. For
40
+ example, initializing from `NiftyLeague/template-repo` selects that fork's
41
+ runtime without extra flags. Use `--runtime-repository OWNER/REPO` (or
42
+ `REPO_FOUNDRY_RUNTIME_REPOSITORY`) only when you want to override it. The
43
+ selected repository is saved in `.github/template.yml` and rendered into the
44
+ small CI, Test, Security, and CodeQL wrappers automatically.
44
45
 
45
46
  Normal synchronization imports only the local hook, agent-facing command,
46
47
  profile/release, initializer, doctor, ownership, and protection entrypoints.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-foundry",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "A fast, language-aware repository factory for agent-ready workflows, testing, security, and release automation.",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-or-later",
package/src/cli.mjs CHANGED
@@ -50,7 +50,10 @@ function parseArgs(argv) {
50
50
  languages: process.env.REPO_FOUNDRY_LANGUAGES || 'auto',
51
51
  features: process.env.REPO_FOUNDRY_FEATURES || 'all',
52
52
  packageManager: process.env.REPO_FOUNDRY_PACKAGE_MANAGER || 'auto',
53
- runtimeRepository: process.env.REPO_FOUNDRY_RUNTIME_REPOSITORY || '0xPlayerOne/code-foundry',
53
+ // Leave this empty unless the caller explicitly selects a runtime. The
54
+ // initializer can then derive the runtime from --source, which keeps
55
+ // organization forks plug-and-play.
56
+ runtimeRepository: process.env.REPO_FOUNDRY_RUNTIME_REPOSITORY || '',
54
57
  releaseType: process.env.REPO_FOUNDRY_RELEASE_TYPE || 'auto',
55
58
  license: process.env.REPO_FOUNDRY_LICENSE || (command === 'init' ? 'agpl-3.0-or-later' : 'preserve'),
56
59
  licenseFile: process.env.REPO_FOUNDRY_LICENSE_FILE || '',
@@ -123,7 +126,7 @@ function main() {
123
126
  if (options.licenseFile) common.push('--license-file', options.licenseFile)
124
127
  if (options.languagesSet) common.push('--languages', options.languages)
125
128
  if (options.featuresSet) common.push('--features', options.features)
126
- common.push('--runtime-repository', options.runtimeRepository)
129
+ if (options.runtimeRepository) common.push('--runtime-repository', options.runtimeRepository)
127
130
  if (options.prune) common.push('--prune')
128
131
  if (options.force) common.push('--force')
129
132
  if (options.dryRun) common.push('--check')
@@ -137,10 +140,10 @@ function main() {
137
140
  '--languages', options.languages,
138
141
  '--features', options.features,
139
142
  '--package-manager', options.packageManager,
140
- '--runtime-repository', options.runtimeRepository,
141
143
  '--release-type', options.releaseType,
142
144
  '--license', options.license,
143
145
  ]
146
+ if (options.runtimeRepository) initArgs.push('--runtime-repository', options.runtimeRepository)
144
147
  if (options.licenseFile) initArgs.push('--license-file', options.licenseFile)
145
148
  if (options.protection) initArgs.push('--protection')
146
149
  if (options.dryRun) initArgs.push('--dry-run')