code-foundry 0.26.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.
- package/.githooks/pre-commit +3 -4
- package/.github/CONTRIBUTING.md +10 -13
- package/.github/actions/setup/action.yml +50 -3
- package/.github/code-foundry.yml +6 -1
- package/.github/workflows/ci.yml +20 -23
- package/.github/workflows/ci_self-ci.yml +1 -1
- package/.github/workflows/codeql.yml +23 -29
- package/.github/workflows/codeql_self-ci.yml +1 -1
- package/.github/workflows/draft-pr.yml +2 -2
- package/.github/workflows/release-pr.yml +4 -4
- package/.github/workflows/release.yml +17 -29
- package/.github/workflows/security.yml +24 -19
- package/.github/workflows/security_self-ci.yml +1 -1
- package/.github/workflows/test.yml +20 -20
- package/.github/workflows/test_self-ci.yml +1 -1
- package/AGENTS.md +13 -10
- package/CHANGELOG.md +21 -0
- package/README.md +16 -6
- package/docs/CONFIGURATION.md +10 -1
- package/docs/INITIALIZATION.md +6 -5
- package/docs/RELEASES.md +5 -0
- package/docs/WORKFLOWS.md +12 -5
- package/package.json +7 -3
- package/src/cli.mjs +29 -25
- package/src/commands/doctor.mjs +70 -0
- package/src/commands/sync.mjs +224 -0
- package/src/lib/config.mjs +38 -0
- package/src/lib/profile.mjs +114 -0
- package/src/runtime.mjs +316 -0
- package/.github/scripts/bootstrap.sh +0 -21
- package/.github/scripts/changed-files.sh +0 -96
- package/.github/scripts/ci.sh +0 -641
- package/.github/scripts/codeql-languages.sh +0 -91
- package/.github/scripts/doctor.sh +0 -98
- package/.github/scripts/format-fast-path.sh +0 -80
- package/.github/scripts/init-repo.sh +0 -268
- package/.github/scripts/pre-commit.sh +0 -67
- package/.github/scripts/profile.sh +0 -186
- package/.github/scripts/security.sh +0 -214
- package/.github/scripts/sitecustomize.py +0 -17
- package/.github/scripts/sync-codeowners.sh +0 -76
- package/.github/scripts/sync-protection.sh +0 -138
- package/.github/scripts/sync-template.sh +0 -748
- 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
|