code-foundry 0.25.0 → 0.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.
Files changed (47) hide show
  1. package/.githooks/pre-commit +3 -4
  2. package/.github/CONTRIBUTING.md +10 -13
  3. package/.github/actions/setup/action.yml +50 -3
  4. package/.github/code-foundry.yml +6 -1
  5. package/.github/licenses/AGPL-3.0-or-later.txt +661 -0
  6. package/.github/licenses/GPL-3.0-or-later.txt +674 -0
  7. package/.github/licenses/MIT.txt +4 -16
  8. package/.github/workflows/ci.yml +20 -23
  9. package/.github/workflows/ci_self-ci.yml +1 -1
  10. package/.github/workflows/codeql.yml +23 -29
  11. package/.github/workflows/codeql_self-ci.yml +1 -1
  12. package/.github/workflows/draft-pr.yml +2 -2
  13. package/.github/workflows/release-pr.yml +4 -4
  14. package/.github/workflows/release.yml +17 -29
  15. package/.github/workflows/security.yml +24 -19
  16. package/.github/workflows/security_self-ci.yml +1 -1
  17. package/.github/workflows/test.yml +20 -20
  18. package/.github/workflows/test_self-ci.yml +1 -1
  19. package/AGENTS.md +13 -10
  20. package/CHANGELOG.md +28 -0
  21. package/README.md +19 -8
  22. package/docs/CONFIGURATION.md +11 -2
  23. package/docs/INITIALIZATION.md +9 -5
  24. package/docs/RELEASES.md +5 -0
  25. package/docs/WORKFLOWS.md +12 -5
  26. package/package.json +7 -3
  27. package/src/cli.mjs +29 -25
  28. package/src/commands/doctor.mjs +70 -0
  29. package/src/commands/sync.mjs +224 -0
  30. package/src/lib/config.mjs +38 -0
  31. package/src/lib/profile.mjs +114 -0
  32. package/src/runtime.mjs +316 -0
  33. package/.github/scripts/bootstrap.sh +0 -21
  34. package/.github/scripts/changed-files.sh +0 -96
  35. package/.github/scripts/ci.sh +0 -641
  36. package/.github/scripts/codeql-languages.sh +0 -91
  37. package/.github/scripts/doctor.sh +0 -98
  38. package/.github/scripts/format-fast-path.sh +0 -80
  39. package/.github/scripts/init-repo.sh +0 -264
  40. package/.github/scripts/pre-commit.sh +0 -67
  41. package/.github/scripts/profile.sh +0 -186
  42. package/.github/scripts/security.sh +0 -214
  43. package/.github/scripts/sitecustomize.py +0 -17
  44. package/.github/scripts/sync-codeowners.sh +0 -76
  45. package/.github/scripts/sync-protection.sh +0 -138
  46. package/.github/scripts/sync-template.sh +0 -744
  47. package/.github/scripts/turbo-cache-probe.sh +0 -102
@@ -1,102 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- # A Turbo remote-cache hit can be resolved from package manifests alone. This
5
- # probe lets CI skip the full dependency install when every executable task is
6
- # already cached. It is deliberately conservative: only Bun projects with a
7
- # pinned Turbo version are eligible, and synthetic dependency-only tasks are
8
- # excluded from the hit decision.
9
-
10
- task="${1:?task name required}"
11
-
12
- set_output() {
13
- printf '%s=%s\n' "$1" "$2" >> "${GITHUB_OUTPUT:-/dev/null}"
14
- }
15
-
16
- set_output hit false
17
-
18
- [ -n "${TURBO_TOKEN:-}" ] || exit 0
19
- [ -n "${TURBO_TEAM:-}" ] || exit 0
20
- [ -f package.json ] || exit 0
21
- [ -f bun.lock ] || [ -f bun.lockb ] || exit 0
22
-
23
- turbo_version="$(node <<'NODE'
24
- const fs = require('node:fs');
25
- const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8'));
26
- const groups = [
27
- packageJson.devDependencies,
28
- packageJson.dependencies,
29
- packageJson.optionalDependencies,
30
- packageJson.pnpm?.overrides,
31
- ];
32
- for (const group of groups) {
33
- const value = group?.turbo;
34
- const match = typeof value === 'string' && value.match(/(\d+\.\d+\.\d+)/);
35
- if (match) {
36
- console.log(match[1]);
37
- break;
38
- }
39
- }
40
- NODE
41
- )"
42
- [ -n "$turbo_version" ] || exit 0
43
-
44
- turbo_home="${RUNNER_TEMP:-/tmp}/repo-foundry-turbo"
45
- probe_file="$(mktemp)"
46
- install_file="$(mktemp)"
47
- result_file="$(mktemp)"
48
- cleanup() { rm -f "$probe_file" "$install_file" "$result_file"; }
49
- trap cleanup EXIT
50
-
51
- if ! npm install --prefix "$turbo_home" --no-save --ignore-scripts --no-audit --no-fund \
52
- "turbo@${turbo_version}" >"$install_file" 2>&1; then
53
- echo "Turbo Probe: CLI unavailable; using full install"
54
- exit 0
55
- fi
56
-
57
- turbo_bin="$turbo_home/node_modules/.bin/turbo"
58
- if [ ! -x "$turbo_bin" ]; then
59
- echo "Turbo Probe: CLI unavailable; using full install"
60
- exit 0
61
- fi
62
-
63
- if ! "$turbo_bin" run "$task" \
64
- --dry=json --cache=remote:r --output-logs=none >"$probe_file" 2>&1; then
65
- echo "Turbo Probe: CLI unavailable; using full install"
66
- exit 0
67
- fi
68
-
69
- node - "$probe_file" >"$result_file" <<'NODE'
70
- const fs = require('node:fs');
71
- const file = process.argv[2];
72
- const text = fs.readFileSync(file, 'utf8');
73
- const start = text.indexOf('{');
74
- if (start < 0) {
75
- console.log('invalid-json');
76
- process.exit(0);
77
- }
78
- let report;
79
- try {
80
- report = JSON.parse(text.slice(start));
81
- } catch {
82
- console.log('invalid-json');
83
- process.exit(0);
84
- }
85
- const runnable = (report.tasks || []).filter((entry) =>
86
- entry.command !== '<NONEXISTENT>' && entry.resolvedTaskDefinition?.cache !== false,
87
- );
88
- const hits = runnable.filter((entry) => entry.cache?.status === 'HIT').length;
89
- const hit = runnable.length > 0 && hits === runnable.length;
90
- console.log(`tasks=${report.tasks?.length || 0} runnable=${runnable.length} hits=${hits} hit=${hit}`);
91
- NODE
92
- probe_result="$(cat "$result_file")"
93
- echo "Turbo Probe: $probe_result"
94
- if ! grep -q 'hit=true' <<<"$probe_result"; then
95
- echo "Turbo Probe: remote cache incomplete; using full install"
96
- exit 0
97
- fi
98
-
99
- turbo_bin_dir="${turbo_bin%/*}"
100
- echo "$turbo_bin_dir" >> "${GITHUB_PATH:-/dev/null}"
101
- printf 'REPO_FOUNDRY_TURBO_REMOTE_ONLY=true\n' >> "${GITHUB_ENV:-/dev/null}"
102
- set_output hit true