@1aboveio/app-dev-skills 0.1.7 → 0.1.9
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/package.json +2 -2
- package/skills/airflow/SKILL.md +1 -1
- package/skills/airflow/release-check.mjs +3 -1
- package/skills/android-foundation/SKILL.md +92 -34
- package/skills/android-foundation/assets/android-ci-job.yml +13 -7
- package/skills/android-foundation/references/ci.md +23 -13
- package/skills/android-foundation/references/delivery-focus.md +29 -0
- package/skills/android-foundation/references/diagnosis.md +136 -0
- package/skills/android-foundation/references/gotchas.md +20 -11
- package/skills/android-foundation/references/setup.md +15 -6
- package/skills/android-foundation/release-check.mjs +3 -1
- package/skills/android-foundation/scripts/device-run.sh +148 -42
- package/skills/app-debug/SKILL.md +1 -1
- package/skills/app-debug/release-check.mjs +3 -1
- package/skills/better-auth/SKILL.md +1 -1
- package/skills/better-auth/release-check.mjs +3 -1
- package/skills/data-catalog/SKILL.md +1 -1
- package/skills/data-catalog/release-check.mjs +3 -1
- package/skills/data-quality/SKILL.md +1 -1
- package/skills/data-quality/release-check.mjs +3 -1
- package/skills/ios-foundation/SKILL.md +1 -1
- package/skills/ios-foundation/release-check.mjs +3 -1
- package/skills/monorepo/SKILL.md +1 -1
- package/skills/monorepo/release-check.mjs +3 -1
- package/skills/nextjs-fullstack/SKILL.md +1 -1
- package/skills/nextjs-fullstack/release-check.mjs +3 -1
- package/skills/prisma-setup/SKILL.md +1 -1
- package/skills/prisma-setup/release-check.mjs +3 -1
- package/skills/pyspark/SKILL.md +1 -1
- package/skills/pyspark/release-check.mjs +3 -1
- package/skills/python-backend/SKILL.md +1 -1
- package/skills/python-backend/release-check.mjs +3 -1
- package/skills/shadcn/SKILL.md +1 -1
- package/skills/shadcn/release-check.mjs +3 -1
- package/skills/zod-v4/SKILL.md +1 -1
- package/skills/zod-v4/release-check.mjs +3 -1
- package/skills/android-foundation/scripts/device-run.test.mjs +0 -172
- package/skills/data-catalog/scripts/data-catalog.test.mjs +0 -36
- package/skills/data-quality/scripts/data-quality.test.mjs +0 -12
package/skills/zod-v4/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: zod-v4
|
|
3
3
|
description: Zod v4 schema conventions and v3 migration for errors, validators, objects, enums, records, and async parsing.
|
|
4
|
-
release-version: 0.
|
|
4
|
+
release-version: 0.44.0
|
|
5
5
|
---
|
|
6
6
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
7
7
|
# Zod v3 to v4 Migration
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { spawnSync } from 'node:child_process';
|
|
3
3
|
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
4
4
|
import { homedir } from 'node:os';
|
|
5
|
-
import { dirname, join } from 'node:path';
|
|
5
|
+
import { dirname, join, resolve } from 'node:path';
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
7
|
|
|
8
8
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
@@ -46,6 +46,8 @@ function writeCache(path, value) {
|
|
|
46
46
|
|
|
47
47
|
function main(now = Date.now()) {
|
|
48
48
|
if (process.env.ONEABOVEIO_NO_UPDATE_CHECK) return;
|
|
49
|
+
const bundle = readJson(join(resolve(here, '../../..'), 'package.json'));
|
|
50
|
+
if (bundle.name === '@1aboveio/skills' && bundle.nativeCodex?.schemaVersion === 1) return;
|
|
49
51
|
const skill = readFileSync(join(here, 'SKILL.md'), 'utf8');
|
|
50
52
|
const name = frontmatterValue(skill, 'name');
|
|
51
53
|
const localVersion = stableVersion(frontmatterValue(skill, 'release-version'));
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
// device-run.sh against stand-in emulator, adb and docker binaries: the cleanup
|
|
2
|
-
// owns exactly what the run started, keeps the stage's status, and treats a
|
|
3
|
-
// stalled command as terminal.
|
|
4
|
-
import { test } from 'node:test';
|
|
5
|
-
import assert from 'node:assert/strict';
|
|
6
|
-
import { spawnSync } from 'node:child_process';
|
|
7
|
-
import { chmodSync, mkdirSync, mkdtempSync, readFileSync, writeFileSync, existsSync } from 'node:fs';
|
|
8
|
-
import { createServer } from 'node:net';
|
|
9
|
-
import { tmpdir } from 'node:os';
|
|
10
|
-
import { dirname, join } from 'node:path';
|
|
11
|
-
import { fileURLToPath } from 'node:url';
|
|
12
|
-
|
|
13
|
-
const SCRIPT = join(dirname(fileURLToPath(import.meta.url)), 'device-run.sh');
|
|
14
|
-
|
|
15
|
-
async function fakeHost() {
|
|
16
|
-
const root = mkdtempSync(join(tmpdir(), 'device-run-'));
|
|
17
|
-
const bin = join(root, 'bin');
|
|
18
|
-
const sdk = join(root, 'sdk');
|
|
19
|
-
mkdirSync(bin);
|
|
20
|
-
mkdirSync(join(sdk, 'emulator'), { recursive: true });
|
|
21
|
-
const log = join(root, 'calls.log');
|
|
22
|
-
writeFileSync(log, '');
|
|
23
|
-
const tool = (path, body) => {
|
|
24
|
-
writeFileSync(path, `#!/usr/bin/env bash\necho "$(basename "$0") $*" >> "$FAKE_LOG"\n${body}\n`);
|
|
25
|
-
chmodSync(path, 0o755);
|
|
26
|
-
};
|
|
27
|
-
tool(join(sdk, 'emulator', 'emulator'), `
|
|
28
|
-
if test -n "\${FAKE_EMULATOR_IGNORES_TERM:-}"; then trap '' TERM; fi
|
|
29
|
-
while :; do sleep 0.1; done`);
|
|
30
|
-
tool(join(bin, 'adb'), `
|
|
31
|
-
case "$*" in
|
|
32
|
-
start-server) exit 0 ;;
|
|
33
|
-
*getprop*) if test -n "\${FAKE_ADB_HANG:-}"; then sleep 30; fi; echo 1 ;;
|
|
34
|
-
esac`);
|
|
35
|
-
tool(join(bin, 'docker'), `
|
|
36
|
-
case "$1" in
|
|
37
|
-
run) while test $# -gt 0; do if test "$1" = --cidfile; then echo fakecid42 > "$2"; fi; shift; done; echo fakecid42 ;;
|
|
38
|
-
port) echo 127.0.0.1:55432 ;;
|
|
39
|
-
exec) exit 0 ;;
|
|
40
|
-
rm) exit 0 ;;
|
|
41
|
-
ps) exit 0 ;;
|
|
42
|
-
esac`);
|
|
43
|
-
return { root, bin, sdk, log, ports: await hostPorts() };
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Runners share the host network, so every port this suite hands the script is one the
|
|
47
|
-
// OS reports free right now, never a fixed number another job may already hold.
|
|
48
|
-
function listen(port) {
|
|
49
|
-
return new Promise((resolve, reject) => {
|
|
50
|
-
const server = createServer();
|
|
51
|
-
server.once('error', reject);
|
|
52
|
-
server.listen(port, '127.0.0.1', () => resolve(server));
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
async function freePort() {
|
|
57
|
-
const server = await listen(0);
|
|
58
|
-
const { port } = server.address();
|
|
59
|
-
await new Promise((resolve) => server.close(resolve));
|
|
60
|
-
return port;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
async function freeEmulatorPort() {
|
|
64
|
-
for (let port = 5554; port <= 5584; port += 2) {
|
|
65
|
-
const held = [];
|
|
66
|
-
try {
|
|
67
|
-
held.push(await listen(port), await listen(port + 1));
|
|
68
|
-
return port;
|
|
69
|
-
} catch {
|
|
70
|
-
// taken; try the next pair
|
|
71
|
-
} finally {
|
|
72
|
-
await Promise.all(held.map((server) => new Promise((resolve) => server.close(resolve))));
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
throw new Error('no free emulator port pair in 5554-5584');
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
async function hostPorts() {
|
|
79
|
-
return {
|
|
80
|
-
EMULATOR_PORT: String(await freeEmulatorPort()),
|
|
81
|
-
ANDROID_BACKEND_PORT: String(await freePort()),
|
|
82
|
-
ANDROID_METRO_PORT: String(await freePort()),
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function run(host, { journey = ['bash', '-c', 'exit 0'], env = {} } = {}) {
|
|
87
|
-
const drop = ['bash', '-c', 'echo "drop $SHARD_DB_NAME $SHARD_ADMIN_URL" >> "$FAKE_LOG"'];
|
|
88
|
-
const result = spawnSync('bash', [SCRIPT, '--drop', ...drop, '--', ...journey], {
|
|
89
|
-
cwd: host.root,
|
|
90
|
-
encoding: 'utf8',
|
|
91
|
-
timeout: 60_000,
|
|
92
|
-
env: {
|
|
93
|
-
PATH: `${host.bin}:${process.env.PATH}`,
|
|
94
|
-
TMPDIR: host.root,
|
|
95
|
-
FAKE_LOG: host.log,
|
|
96
|
-
ANDROID_HOME: host.sdk,
|
|
97
|
-
SETUP_AVD: 'Test_Phone',
|
|
98
|
-
...host.ports,
|
|
99
|
-
DB_NAME_PREFIX: 'app_e2e_',
|
|
100
|
-
KILL_GRACE_SECONDS: '2',
|
|
101
|
-
BOUNDED_SECONDS: '5',
|
|
102
|
-
...env,
|
|
103
|
-
},
|
|
104
|
-
});
|
|
105
|
-
return { ...result, calls: readFileSync(host.log, 'utf8') };
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
test('a passing journey cleans up everything it started and exits 0', async () => {
|
|
109
|
-
const host = await fakeHost();
|
|
110
|
-
const marker = join(host.root, 'journey ran.txt');
|
|
111
|
-
const r = run(host, { journey: ['bash', '-c', 'echo "$ANDROID_EMULATOR_SERIAL $SHARD_DB_NAME" > "$1"', 'journey', marker] });
|
|
112
|
-
assert.equal(r.status, 0, r.stderr);
|
|
113
|
-
assert.match(r.stdout, /original_stage_exit=0 cleanup_exit=0\n$/);
|
|
114
|
-
const port = host.ports.EMULATOR_PORT;
|
|
115
|
-
assert.match(readFileSync(marker, 'utf8'), new RegExp(`^emulator-${port} app_e2e_\\d+_\\d+\\n$`));
|
|
116
|
-
assert.match(r.calls, /^adb start-server$/m);
|
|
117
|
-
assert.ok(r.calls.indexOf('adb start-server') < r.calls.indexOf(`emulator -avd Test_Phone -port ${port}`));
|
|
118
|
-
assert.match(r.calls, new RegExp(`^emulator -avd Test_Phone -port ${port} -memory 4096 `, 'm'));
|
|
119
|
-
assert.match(r.calls, /^drop app_e2e_\d+_\d+ postgresql:\/\/postgres:postgres@127\.0\.0\.1:55432\/postgres$/m);
|
|
120
|
-
assert.match(r.calls, /^docker rm --force fakecid42$/m);
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
test('a failing journey keeps its status and still cleans up', async () => {
|
|
124
|
-
const host = await fakeHost();
|
|
125
|
-
const r = run(host, { journey: ['bash', '-c', 'exit 42'] });
|
|
126
|
-
assert.equal(r.status, 42);
|
|
127
|
-
assert.match(r.stdout, /original_stage_exit=42 cleanup_exit=0/);
|
|
128
|
-
assert.match(r.calls, /^drop app_e2e_/m);
|
|
129
|
-
assert.match(r.calls, /^docker rm --force fakecid42$/m);
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
test('an emulator that ignores TERM is killed and reported as a cleanup failure', async () => {
|
|
133
|
-
const host = await fakeHost();
|
|
134
|
-
const r = run(host, { env: { FAKE_EMULATOR_IGNORES_TERM: '1' } });
|
|
135
|
-
assert.equal(r.status, 1);
|
|
136
|
-
assert.match(r.stdout, /original_stage_exit=0 cleanup_exit=1/);
|
|
137
|
-
assert.match(r.calls, /^docker rm --force fakecid42$/m);
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
test('a stalled readiness probe ends the run with 124 and no journey', async () => {
|
|
141
|
-
const host = await fakeHost();
|
|
142
|
-
const marker = join(host.root, 'journey-ran');
|
|
143
|
-
const started = Date.now();
|
|
144
|
-
const r = run(host, { journey: ['touch', marker], env: { FAKE_ADB_HANG: '1', BOUNDED_SECONDS: '1' } });
|
|
145
|
-
assert.equal(r.status, 124);
|
|
146
|
-
assert.ok(Date.now() - started < 15_000, 'the deadline must not wait for the stalled command\'s children');
|
|
147
|
-
assert.match(r.stdout, /original_stage_exit=124 cleanup_exit=0/);
|
|
148
|
-
assert.equal(existsSync(marker), false);
|
|
149
|
-
assert.doesNotMatch(r.calls, /^drop /m, 'no database was handed to the harness, so none is dropped');
|
|
150
|
-
assert.match(r.calls, /^docker rm --force fakecid42$/m);
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
test('a busy port stops the run before anything starts', async () => {
|
|
154
|
-
const host = await fakeHost();
|
|
155
|
-
const server = await listen(Number(host.ports.ANDROID_BACKEND_PORT));
|
|
156
|
-
try {
|
|
157
|
-
const r = run(host);
|
|
158
|
-
assert.notEqual(r.status, 0);
|
|
159
|
-
assert.match(r.stdout, /cleanup_exit=0/);
|
|
160
|
-
assert.doesNotMatch(r.calls, /emulator -avd|docker run/);
|
|
161
|
-
} finally {
|
|
162
|
-
server.close();
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
test('an emulator port outside the range adb scans is refused', async () => {
|
|
167
|
-
const host = await fakeHost();
|
|
168
|
-
const r = run(host, { env: { EMULATOR_PORT: '5588' } });
|
|
169
|
-
assert.equal(r.status, 2);
|
|
170
|
-
assert.match(r.stderr, /even port in 5554-5584/);
|
|
171
|
-
assert.equal(r.calls, '');
|
|
172
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import { spawnSync } from 'node:child_process';
|
|
3
|
-
import { mkdtempSync, readFileSync, rmSync } from 'node:fs';
|
|
4
|
-
import { tmpdir } from 'node:os';
|
|
5
|
-
import { dirname, join } from 'node:path';
|
|
6
|
-
import { fileURLToPath } from 'node:url';
|
|
7
|
-
import test from 'node:test';
|
|
8
|
-
|
|
9
|
-
const scriptsDir = dirname(fileURLToPath(import.meta.url));
|
|
10
|
-
const conventions = readFileSync(join(scriptsDir, '../references/data-catalog-conventions.md'), 'utf8');
|
|
11
|
-
|
|
12
|
-
test('data-catalog test_data_catalog.py', () => {
|
|
13
|
-
const result = spawnSync('python3', [join(scriptsDir, 'test_data_catalog.py')], { encoding: 'utf8' });
|
|
14
|
-
assert.equal(result.status, 0, `${result.stdout}\n${result.stderr}`);
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
test('persist-conventions writes the Data catalog section only with --write', () => {
|
|
18
|
-
const dir = mkdtempSync(join(tmpdir(), 'data-catalog-conventions-'));
|
|
19
|
-
try {
|
|
20
|
-
const cli = join(scriptsDir, 'persist-conventions.mjs');
|
|
21
|
-
const preview = spawnSync(process.execPath, [cli, '--repo-root', dir], { encoding: 'utf8' });
|
|
22
|
-
assert.match(preview.stdout, /preview only, 3 file\(s\) would change/);
|
|
23
|
-
assert.equal(spawnSync(process.execPath, [cli, '--repo-root', dir, '--write'], { encoding: 'utf8' }).status, 0);
|
|
24
|
-
const text = readFileSync(join(dir, 'CONTRIBUTING.md'), 'utf8');
|
|
25
|
-
assert.match(text, /<!-- conventions:data-catalog:start -->[\s\S]*## Data catalog conventions[\s\S]*<!-- conventions:data-catalog:end -->/);
|
|
26
|
-
} finally {
|
|
27
|
-
rmSync(dir, { recursive: true, force: true });
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
test('every engine command the conventions tell people to run exists', () => {
|
|
32
|
-
const cited = [...conventions.matchAll(/data_catalog\.py (\w+)/g)].map((m) => m[1]);
|
|
33
|
-
assert.deepEqual([...new Set(cited)].sort(), ['audit', 'drift', 'generate']);
|
|
34
|
-
const help = spawnSync('python3', [join(scriptsDir, 'data_catalog.py'), '--help'], { encoding: 'utf8' }).stdout;
|
|
35
|
-
for (const command of cited) assert.match(help, new RegExp(`\\b${command}\\b`), `${command} missing from the engine`);
|
|
36
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import { spawnSync } from 'node:child_process';
|
|
3
|
-
import { dirname, join } from 'node:path';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
|
-
import test from 'node:test';
|
|
6
|
-
|
|
7
|
-
const scriptsDir = dirname(fileURLToPath(import.meta.url));
|
|
8
|
-
|
|
9
|
-
test('data-quality test_data_quality.py', () => {
|
|
10
|
-
const result = spawnSync('python3', [join(scriptsDir, 'test_data_quality.py')], { encoding: 'utf8' });
|
|
11
|
-
assert.equal(result.status, 0, `${result.stdout}\n${result.stderr}`);
|
|
12
|
-
});
|