@akjamie/agentic-sdlc 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +219 -2
- package/assets/ci/Jenkinsfile +80 -0
- package/assets/ci/asdlc-ai-review.yml +65 -0
- package/assets/config/config.yaml +76 -0
- package/assets/githooks/post-merge +22 -0
- package/assets/githooks/pre-push +17 -0
- package/assets/policy/policy.yaml +46 -0
- package/assets/schema/schema.yaml +162 -0
- package/assets/schema/templates/design.md +16 -0
- package/assets/schema/templates/proposal.md +25 -0
- package/assets/schema/templates/review.md +24 -0
- package/assets/schema/templates/spec.md +37 -0
- package/assets/schema/templates/tasks.md +10 -0
- package/assets/skills/asdlc-apply/SKILL.md +128 -0
- package/assets/skills/asdlc-approve/SKILL.md +107 -0
- package/assets/skills/asdlc-archive/SKILL.md +48 -0
- package/assets/skills/asdlc-doctor/SKILL.md +82 -0
- package/assets/skills/asdlc-impl-review/SKILL.md +214 -0
- package/assets/skills/asdlc-init/SKILL.md +68 -0
- package/assets/skills/asdlc-lint/SKILL.md +56 -0
- package/assets/skills/asdlc-new/SKILL.md +74 -0
- package/assets/skills/asdlc-pr/SKILL.md +59 -0
- package/assets/skills/asdlc-review/SKILL.md +80 -0
- package/assets/skills/asdlc-spec-review/SKILL.md +194 -0
- package/assets/skills/asdlc-status/SKILL.md +49 -0
- package/assets/skills/asdlc-upgrade/SKILL.md +34 -0
- package/assets/skills/asdlc-verify/SKILL.md +55 -0
- package/assets/skills/batch-grill-me/SKILL.md +136 -0
- package/assets/skills/grilling/SKILL.md +136 -0
- package/bin/asdlc.js +6 -0
- package/package.json +43 -4
- package/src/cli.js +86 -0
- package/src/commands/apply.js +114 -0
- package/src/commands/approve.js +166 -0
- package/src/commands/archive.js +115 -0
- package/src/commands/doctor.js +163 -0
- package/src/commands/init.js +201 -0
- package/src/commands/lint.js +103 -0
- package/src/commands/new.js +142 -0
- package/src/commands/pr.js +495 -0
- package/src/commands/skills.js +184 -0
- package/src/commands/status.js +65 -0
- package/src/commands/update.js +103 -0
- package/src/commands/upgrade.js +175 -0
- package/src/commands/verify.js +229 -0
- package/src/index.js +3 -0
- package/src/lib/agents.js +73 -0
- package/src/lib/cliutil.js +99 -0
- package/src/lib/errors.js +18 -0
- package/src/lib/exec.js +19 -0
- package/src/lib/fs.js +83 -0
- package/src/lib/git.js +76 -0
- package/src/lib/graphify.js +106 -0
- package/src/lib/log.js +15 -0
- package/src/lib/openspec.js +91 -0
- package/src/lib/paths.js +43 -0
- package/src/lib/policy.js +54 -0
- package/src/lib/prtype.js +41 -0
- package/src/lib/schema.js +86 -0
- package/src/lib/speclint.js +168 -0
- package/src/lib/tdd.js +71 -0
- package/src/lib/yaml.js +18 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import { exists, ensureDir, copyTree, removeDir, readText } from './fs.js';
|
|
4
|
+
import { parseYaml } from './yaml.js';
|
|
5
|
+
import { schemaAssetDir, SCHEMA_NAME } from './paths.js';
|
|
6
|
+
import { isPathTracked } from './git.js';
|
|
7
|
+
|
|
8
|
+
// Mirror OpenSpec's getGlobalDataDir() exactly (dist/core/global-config.js) so
|
|
9
|
+
// we install into the directory OpenSpec resolves "user override" schemas from.
|
|
10
|
+
export function globalDataDir(env = process.env, platform = os.platform(), homedir = os.homedir()) {
|
|
11
|
+
const join = platform === 'win32' ? path.win32.join : path.posix.join;
|
|
12
|
+
if (env.XDG_DATA_HOME) return join(env.XDG_DATA_HOME, 'openspec');
|
|
13
|
+
if (platform === 'win32') {
|
|
14
|
+
if (env.LOCALAPPDATA) return join(env.LOCALAPPDATA, 'openspec');
|
|
15
|
+
return join(homedir, 'AppData', 'Local', 'openspec');
|
|
16
|
+
}
|
|
17
|
+
return join(homedir, '.local', 'share', 'openspec');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function globalSchemasDir(opts = {}) {
|
|
21
|
+
const env = opts.env ?? process.env;
|
|
22
|
+
const platform = opts.platform ?? os.platform();
|
|
23
|
+
const homedir = opts.homedir ?? os.homedir();
|
|
24
|
+
return path.join(globalDataDir(env, platform, homedir), 'schemas');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function installedSchemaDir(opts = {}) {
|
|
28
|
+
return path.join(globalSchemasDir(opts), SCHEMA_NAME);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Install the BU-managed schema ONCE per machine (not per repo).
|
|
32
|
+
export function installSchema(opts = {}) {
|
|
33
|
+
const dest = installedSchemaDir(opts);
|
|
34
|
+
removeDir(dest); // always replace -> no stale half-copies
|
|
35
|
+
ensureDir(globalSchemasDir(opts));
|
|
36
|
+
copyTree(schemaAssetDir, dest);
|
|
37
|
+
return dest;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function readInstalledVersion(opts = {}) {
|
|
41
|
+
const p = path.join(installedSchemaDir(opts), 'schema.yaml');
|
|
42
|
+
if (!exists(p)) return null;
|
|
43
|
+
const parsed = parseYaml(readText(p)) ?? {};
|
|
44
|
+
return parsed.version != null ? String(parsed.version) : null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// The version bundled with THIS asdlc package (the source of truth to install).
|
|
48
|
+
export function builtinSchemaVersion() {
|
|
49
|
+
const p = path.join(schemaAssetDir, 'schema.yaml');
|
|
50
|
+
if (!exists(p)) return null;
|
|
51
|
+
const parsed = parseYaml(readText(p)) ?? {};
|
|
52
|
+
return parsed.version != null ? String(parsed.version) : null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// A project-local copy of the managed schema SHADOWS the central one, because
|
|
56
|
+
// OpenSpec resolves project > user > package. The BU forbids local overrides.
|
|
57
|
+
export function localOverride(repoRoot) {
|
|
58
|
+
const rel = `openspec/schemas/${SCHEMA_NAME}`;
|
|
59
|
+
const present = exists(path.join(repoRoot, rel));
|
|
60
|
+
return { present, tracked: present ? isPathTracked(repoRoot, rel) : false, path: rel };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// The gate check: schema installed centrally, version matches the repo pin,
|
|
64
|
+
// and NOT overridden by a committed local copy.
|
|
65
|
+
export function checkSchema(repoRoot, { expectedVersion = null, ...opts } = {}) {
|
|
66
|
+
const override = localOverride(repoRoot);
|
|
67
|
+
if (override.tracked) {
|
|
68
|
+
return {
|
|
69
|
+
ok: false,
|
|
70
|
+
reason: `local schema override detected: ${override.path} is committed and shadows the BU-managed schema`,
|
|
71
|
+
hint: 'remove openspec/schemas/' + SCHEMA_NAME + ' and run `asdlc init`',
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const installed = readInstalledVersion(opts);
|
|
75
|
+
if (!installed) {
|
|
76
|
+
return { ok: false, reason: 'BU-managed schema not installed on this machine', hint: 'run `asdlc init`' };
|
|
77
|
+
}
|
|
78
|
+
if (expectedVersion && installed !== String(expectedVersion)) {
|
|
79
|
+
return {
|
|
80
|
+
ok: false,
|
|
81
|
+
reason: `schema version mismatch: machine has v${installed}, repo pins v${expectedVersion}`,
|
|
82
|
+
hint: 'run `asdlc init`',
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
return { ok: true, installed, builtin: builtinSchemaVersion(), override };
|
|
86
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
// Deterministic spec lint harness: enforces BDD + Acceptance Criteria.
|
|
2
|
+
// Pure functions (text -> findings). No LLM => stable, reproducible.
|
|
3
|
+
// The ONLY filesystem access is the optional (test: <path>) existence check,
|
|
4
|
+
// which is enabled by passing `repoRoot`.
|
|
5
|
+
import { exists } from './fs.js';
|
|
6
|
+
import { resolve } from 'node:path';
|
|
7
|
+
//
|
|
8
|
+
// Rules:
|
|
9
|
+
// R0 no-requirements blocker
|
|
10
|
+
// R1 purpose blocker (new capability: ## Purpose >= 50 chars)
|
|
11
|
+
// R2 normative blocker (each Requirement needs SHALL/MUST)
|
|
12
|
+
// R3 scenario blocker (each Requirement needs >= 1 scenario)
|
|
13
|
+
// R4 when/then/given blocker/major (BDD shape)
|
|
14
|
+
// R5 ac blocker (each Requirement needs >= 1 AC<n>)
|
|
15
|
+
// R6 ac-test blocker (each AC needs a (test: <path>) mapping)
|
|
16
|
+
// R7 test-strategy blocker (## Test Strategy present)
|
|
17
|
+
// R8 removed-reason major (REMOVED requires **Reason**)
|
|
18
|
+
|
|
19
|
+
const REQ_HEAD = /^###\s+Requirement:\s*(.+?)\s*$/;
|
|
20
|
+
const SCEN_HEAD = /^####\s+Scenario:\s*(.+?)\s*$/;
|
|
21
|
+
const SEC_HEAD = /^##\s+(.+?)\s*$/;
|
|
22
|
+
const OPERATIONS = /^##\s+(ADDED|MODIFIED|REMOVED|RENAMED)\s+Requirements\s*$/;
|
|
23
|
+
|
|
24
|
+
function topSection(text, name) {
|
|
25
|
+
const lines = text.split('\n');
|
|
26
|
+
const re = new RegExp(`^##\\s+${name}\\s*$`, 'i');
|
|
27
|
+
const start = lines.findIndex((l) => re.test(l));
|
|
28
|
+
if (start < 0) return null;
|
|
29
|
+
const out = [];
|
|
30
|
+
for (let i = start + 1; i < lines.length; i += 1) {
|
|
31
|
+
if (SEC_HEAD.test(lines[i])) break;
|
|
32
|
+
out.push(lines[i]);
|
|
33
|
+
}
|
|
34
|
+
return out.join('\n');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function requirements(text) {
|
|
38
|
+
const out = [];
|
|
39
|
+
let section = null;
|
|
40
|
+
let cur = null;
|
|
41
|
+
for (const line of text.split('\n')) {
|
|
42
|
+
if (SEC_HEAD.test(line)) {
|
|
43
|
+
if (cur) { out.push(cur); cur = null; }
|
|
44
|
+
const op = line.match(OPERATIONS);
|
|
45
|
+
if (op) section = op[1];
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const r = line.match(REQ_HEAD);
|
|
49
|
+
if (r) {
|
|
50
|
+
if (cur) out.push(cur);
|
|
51
|
+
cur = { name: r[1], section, text: [] };
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
if (cur) cur.text.push(line);
|
|
55
|
+
}
|
|
56
|
+
if (cur) out.push(cur);
|
|
57
|
+
return out.map((r) => ({ ...r, body: r.text.join('\n') }));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function scenarios(body) {
|
|
61
|
+
const out = [];
|
|
62
|
+
let cur = null;
|
|
63
|
+
for (const line of body.split('\n')) {
|
|
64
|
+
const s = line.match(SCEN_HEAD);
|
|
65
|
+
if (s) {
|
|
66
|
+
if (cur) out.push(cur);
|
|
67
|
+
cur = { name: s[1], text: [] };
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (cur) cur.text.push(line);
|
|
71
|
+
}
|
|
72
|
+
if (cur) out.push(cur);
|
|
73
|
+
return out.map((s) => ({ name: s.name, text: s.text.join('\n') }));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function acceptanceCriteria(body) {
|
|
77
|
+
const out = [];
|
|
78
|
+
for (const line of body.split('\n')) {
|
|
79
|
+
const m = line.match(/^\s*-\s*\[[ xX]\]\s*(AC\d+)\s*:\s*(.+)$/);
|
|
80
|
+
if (!m) continue;
|
|
81
|
+
const t = line.match(/\(test:\s*([^)]+?)\s*\)/i);
|
|
82
|
+
out.push({ id: m[1], text: m[2].replace(/\(test:.*$/i, '').trim(), test: t ? t[1].trim() : null });
|
|
83
|
+
}
|
|
84
|
+
return out;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function sortFindings(a, b) {
|
|
88
|
+
const key = (x) => `${x.location}||${x.code}||${x.message}`;
|
|
89
|
+
return key(a) < key(b) ? -1 : key(a) > key(b) ? 1 : 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Policy-as-code: severities are configurable per repo (openspec/config.yaml
|
|
93
|
+
// -> lint.rules), and the ruleset is versioned so historic changes can be
|
|
94
|
+
// grandfathered instead of silently invalidated by future rule changes.
|
|
95
|
+
export const LINT_VERSION = 2;
|
|
96
|
+
|
|
97
|
+
const DEFAULT_SEVERITY = {
|
|
98
|
+
'R0-no-requirements': 'blocker',
|
|
99
|
+
'R1-purpose': 'blocker',
|
|
100
|
+
'R2-normative': 'blocker',
|
|
101
|
+
'R3-scenario': 'blocker',
|
|
102
|
+
'R4-when': 'blocker',
|
|
103
|
+
'R4-then': 'blocker',
|
|
104
|
+
'R4-given': 'major',
|
|
105
|
+
'R5-ac': 'blocker',
|
|
106
|
+
'R6-ac-test': 'blocker',
|
|
107
|
+
'R7-test-strategy': 'blocker',
|
|
108
|
+
'R8-removed-reason': 'major',
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export function lintSpecText(text, { requireGiven = true, repoRoot = null, rules = {} } = {}) {
|
|
112
|
+
const findings = [];
|
|
113
|
+
const add = (code, rawSeverity, message, location = '') => {
|
|
114
|
+
const configured = rules[code] ?? DEFAULT_SEVERITY[code] ?? rawSeverity;
|
|
115
|
+
if (configured === 'off') return;
|
|
116
|
+
findings.push({ code, severity: configured, location, message });
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const hasAdded = /^##\s+ADDED\s+Requirements\s*$/m.test(text);
|
|
120
|
+
const purpose = topSection(text, 'Purpose') ?? '';
|
|
121
|
+
if (hasAdded && purpose.trim().length < 50) {
|
|
122
|
+
add('R1-purpose', 'blocker', 'Purpose missing or shorter than 50 characters', '## Purpose');
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if ((topSection(text, 'Test Strategy') ?? '').trim().length === 0) {
|
|
126
|
+
add('R7-test-strategy', 'blocker', 'Missing or empty ## Test Strategy', '## Test Strategy');
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const reqs = requirements(text);
|
|
130
|
+
if (reqs.length === 0) add('R0-no-requirements', 'blocker', 'No "### Requirement:" found', '');
|
|
131
|
+
|
|
132
|
+
for (const r of reqs) {
|
|
133
|
+
if (r.section === 'REMOVED') {
|
|
134
|
+
if (!/\*\*Reason\*\*/.test(r.body)) add('R8-removed-reason', 'major', `REMOVED "${r.name}" lacks **Reason**`, r.name);
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
if (r.section === 'RENAMED') continue;
|
|
138
|
+
if (!/\b(SHALL|MUST)\b/.test(r.body)) add('R2-normative', 'blocker', `"${r.name}" has no SHALL/MUST statement`, r.name);
|
|
139
|
+
|
|
140
|
+
const scens = scenarios(r.body);
|
|
141
|
+
if (scens.length === 0) add('R3-scenario', 'blocker', `"${r.name}" has no Scenario`, r.name);
|
|
142
|
+
for (const s of scens) {
|
|
143
|
+
if (!/\*\*WHEN\*\*/.test(s.text)) add('R4-when', 'blocker', `Scenario "${s.name}" missing WHEN`, `${r.name} / ${s.name}`);
|
|
144
|
+
if (!/\*\*THEN\*\*/.test(s.text)) add('R4-then', 'blocker', `Scenario "${s.name}" missing THEN`, `${r.name} / ${s.name}`);
|
|
145
|
+
if (requireGiven && !/\*\*GIVEN\*\*/.test(s.text)) add('R4-given', 'major', `Scenario "${s.name}" missing GIVEN`, `${r.name} / ${s.name}`);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const acs = acceptanceCriteria(r.body);
|
|
149
|
+
if (acs.length === 0) add('R5-ac', 'blocker', `"${r.name}" has no Acceptance criteria (AC<n>)`, r.name);
|
|
150
|
+
for (const ac of acs) {
|
|
151
|
+
if (!ac.test) {
|
|
152
|
+
add('R6-ac-test', 'blocker', `"${ac.id}" has no (test: <path>) mapping`, `${r.name} / ${ac.id}`);
|
|
153
|
+
} else if (repoRoot) {
|
|
154
|
+
// "Does the mapping exist" is not enough: the referenced test file must
|
|
155
|
+
// actually exist, otherwise the AC is unverifiable decoration.
|
|
156
|
+
if (!exists(resolve(repoRoot, ac.test))) {
|
|
157
|
+
add('R6-ac-missing-test', 'blocker', `"${ac.id}" maps to a test that does not exist: ${ac.test}`, `${r.name} / ${ac.id}`);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return findings.sort(sortFindings);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export function countBlockers(findings) {
|
|
167
|
+
return findings.filter((f) => f.severity === 'blocker').length;
|
|
168
|
+
}
|
package/src/lib/tdd.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Pure TDD analysis functions (deterministic, no side effects)
|
|
2
|
+
|
|
3
|
+
export function isTestFile(file) {
|
|
4
|
+
const normalized = String(file).replace(/\\/g, '/');
|
|
5
|
+
return (
|
|
6
|
+
/(?:^|\/)(?:tests?|__tests__|spec)\//i.test(normalized) ||
|
|
7
|
+
/\.(?:test|spec)\.[a-zA-Z0-9]+$/i.test(normalized)
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function isSourceFile(file) {
|
|
12
|
+
const normalized = String(file).replace(/\\/g, '/');
|
|
13
|
+
if (isTestFile(normalized)) return false;
|
|
14
|
+
// Ignore governance, docs, config, openspec change specs
|
|
15
|
+
if (/^(?:openspec|\.sdlc|docs|\.githooks|jenkins)\//i.test(normalized)) return false;
|
|
16
|
+
if (/\.(?:md|markdown|json|ya?ml|toml|lock|gitignore|editorconfig|png|jpg|svg|ico)$/i.test(normalized)) return false;
|
|
17
|
+
// Source code files
|
|
18
|
+
return (
|
|
19
|
+
/\.(?:js|mjs|cjs|ts|tsx|jsx|py|go|java|rs|rb|c|cpp|cs|php|swift|kt)$/i.test(normalized) ||
|
|
20
|
+
/^(?:src|lib|app|bin)\//i.test(normalized)
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function checkTestPresence(changedFiles = []) {
|
|
25
|
+
const sources = changedFiles.filter(isSourceFile);
|
|
26
|
+
const tests = changedFiles.filter(isTestFile);
|
|
27
|
+
|
|
28
|
+
if (sources.length > 0 && tests.length === 0) {
|
|
29
|
+
return {
|
|
30
|
+
ok: false,
|
|
31
|
+
sources,
|
|
32
|
+
tests,
|
|
33
|
+
detail: `${sources.length} source file(s) modified (${sources.slice(0, 3).join(', ')}${sources.length > 3 ? '...' : ''}) without corresponding test files in diff`,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
ok: true,
|
|
39
|
+
sources,
|
|
40
|
+
tests,
|
|
41
|
+
detail: sources.length === 0
|
|
42
|
+
? 'no source files modified'
|
|
43
|
+
: `${sources.length} source file(s), ${tests.length} test file(s) in diff`,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function checkTaskEvidence(tasksText) {
|
|
48
|
+
if (!tasksText || !tasksText.trim()) {
|
|
49
|
+
return { ok: false, detail: 'tasks.md is empty' };
|
|
50
|
+
}
|
|
51
|
+
const lines = tasksText.split('\n');
|
|
52
|
+
const checked = lines.filter((l) => /^\s*-\s*\[[xX]\]/.test(l));
|
|
53
|
+
if (checked.length === 0) {
|
|
54
|
+
return { ok: false, detail: 'no completed tasks found' };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Each completed task should indicate verification:
|
|
58
|
+
// e.g. verify:, test:, (test: ...), (AC...), evidence:, or [TEST]
|
|
59
|
+
const missingVerification = checked.filter((l) => {
|
|
60
|
+
return !/(?:verify:|test:|\(test:|\(AC\d+\)|evidence:|\[TEST\]|\[IMPL\])/i.test(l);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
if (missingVerification.length > 0) {
|
|
64
|
+
return {
|
|
65
|
+
ok: false,
|
|
66
|
+
detail: `${missingVerification.length} completed task(s) lack verification statement or test mapping`,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return { ok: true, detail: `${checked.length} completed task(s) verified` };
|
|
71
|
+
}
|
package/src/lib/yaml.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import YAML from 'yaml';
|
|
2
|
+
import { readText, writeText } from './fs.js';
|
|
3
|
+
|
|
4
|
+
export function parseYaml(text) {
|
|
5
|
+
return YAML.parse(text);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function stringifyYaml(value) {
|
|
9
|
+
return YAML.stringify(value, { lineWidth: 0 });
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function readYaml(p) {
|
|
13
|
+
return parseYaml(readText(p));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function writeYaml(p, value) {
|
|
17
|
+
return writeText(p, stringifyYaml(value));
|
|
18
|
+
}
|