@draig/lexis-two 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/.agents/plugins/marketplace.json +21 -0
- package/.claude-plugin/marketplace.json +29 -0
- package/.claude-plugin/plugin.json +9 -0
- package/.clinerules/lexis-two.md +163 -0
- package/.codex-plugin/plugin.json +31 -0
- package/.cursor/rules/lexis-two.mdc +169 -0
- package/.env.example +8 -0
- package/.github/FUNDING.yml +1 -0
- package/.github/copilot-instructions.md +47 -0
- package/.github/plugin/marketplace.json +20 -0
- package/.github/plugin/plugin.json +16 -0
- package/.github/workflows/deploy-site.yml +53 -0
- package/.github/workflows/test.yml +29 -0
- package/.kiro/steering/lexis-two.md +167 -0
- package/.nojekyll +0 -0
- package/.opencode/command/lexis-two-audit.md +5 -0
- package/.opencode/command/lexis-two-debt.md +5 -0
- package/.opencode/command/lexis-two-help.md +5 -0
- package/.opencode/command/lexis-two-plan.md +5 -0
- package/.opencode/command/lexis-two-review.md +5 -0
- package/.opencode/command/lexis-two-security.md +5 -0
- package/.opencode/command/lexis-two.md +5 -0
- package/.opencode/plugins/lexis-two.mjs +74 -0
- package/.windsurf/rules/lexis-two.md +163 -0
- package/AGENTS.md +163 -0
- package/AUDIT.md +74 -0
- package/CNAME +1 -0
- package/LICENSE +23 -0
- package/README.md +301 -0
- package/SPECXIS.md +576 -0
- package/assets/benchmark-3model.svg +21 -0
- package/assets/lexis-two-complete.webp +0 -0
- package/assets/lexis-two-nobg.png +0 -0
- package/assets/logo.png +0 -0
- package/assets/social-preview.png +0 -0
- package/benchmarks/README.md +114 -0
- package/benchmarks/arms/baseline.js +2 -0
- package/benchmarks/arms/caveman-SKILL.md +67 -0
- package/benchmarks/arms/caveman.js +8 -0
- package/benchmarks/arms/lexis-two.js +10 -0
- package/benchmarks/arms/ponytail.js +6 -0
- package/benchmarks/behavior.js +58 -0
- package/benchmarks/behavior.yaml +40 -0
- package/benchmarks/benchmark-local.py +156 -0
- package/benchmarks/benchmark-opencode-go.js +294 -0
- package/benchmarks/correctness.js +294 -0
- package/benchmarks/lib/aggregate-opencode-go.js +103 -0
- package/benchmarks/lib/load-env.js +31 -0
- package/benchmarks/lib/opencode-go-client.js +151 -0
- package/benchmarks/loc.js +13 -0
- package/benchmarks/opencode-go-models.json +31 -0
- package/benchmarks/promptfooconfig.yaml +41 -0
- package/benchmarks/prompts.json +15 -0
- package/benchmarks/render-opencode-go-report.js +28 -0
- package/benchmarks/results/2026-06-15-llama3.2-local.md +76 -0
- package/benchmarks/results/2026-06-16-opencode-go.md +56 -0
- package/benchmarks/results/opencode-go-2026-06-16-report.html +226 -0
- package/benchmarks/results/opencode-go-2026-06-16.json +1339 -0
- package/commands/lexis-two-audit.toml +3 -0
- package/commands/lexis-two-debt.toml +3 -0
- package/commands/lexis-two-help.toml +3 -0
- package/commands/lexis-two-plan.toml +3 -0
- package/commands/lexis-two-review.toml +3 -0
- package/commands/lexis-two-security.toml +3 -0
- package/commands/lexis-two.toml +3 -0
- package/docs/assets/lexis-two-nobg.png +0 -0
- package/docs/assets/logo.png +0 -0
- package/docs/assets/logo.svg +4 -0
- package/docs/portability.md +147 -0
- package/docs/site.md +52 -0
- package/examples/api-endpoint.md +68 -0
- package/examples/caching.md +74 -0
- package/examples/date-picker.md +48 -0
- package/examples/email-validation.md +51 -0
- package/examples/sorting.md +42 -0
- package/gemini-extension.json +7 -0
- package/hooks/copilot-hooks.json +21 -0
- package/hooks/hooks.json +31 -0
- package/hooks/lexis-two-activate.js +72 -0
- package/hooks/lexis-two-config.js +101 -0
- package/hooks/lexis-two-instructions.js +126 -0
- package/hooks/lexis-two-mode-tracker.js +55 -0
- package/hooks/lexis-two-runtime.js +50 -0
- package/hooks/lexis-two-statusline.ps1 +19 -0
- package/hooks/lexis-two-statusline.sh +11 -0
- package/opencode.json +4 -0
- package/package.json +31 -0
- package/pi-extension/index.js +161 -0
- package/pi-extension/package.json +8 -0
- package/pi-extension/test/extension.test.js +89 -0
- package/pi-extension/test/helpers.test.js +35 -0
- package/scripts/check-rule-copies.js +82 -0
- package/site/astro.config.mjs +18 -0
- package/site/package-lock.json +4913 -0
- package/site/package.json +14 -0
- package/site/public/CNAME +1 -0
- package/site/public/assets/lexis-two-nobg.png +0 -0
- package/site/public/assets/logo.png +0 -0
- package/site/public/assets/logo.svg +4 -0
- package/site/public/robots.txt +4 -0
- package/site/src/components/Adapt.astro +33 -0
- package/site/src/components/Benchmarks.astro +232 -0
- package/site/src/components/Commands.astro +33 -0
- package/site/src/components/Ecosystem.astro +30 -0
- package/site/src/components/Example.astro +77 -0
- package/site/src/components/Footer.astro +28 -0
- package/site/src/components/Header.astro +87 -0
- package/site/src/components/Hero.astro +58 -0
- package/site/src/components/Home.astro +46 -0
- package/site/src/components/Hosts.astro +62 -0
- package/site/src/components/Install.astro +143 -0
- package/site/src/components/LanguageSwitcher.astro +82 -0
- package/site/src/components/Philosophy.astro +23 -0
- package/site/src/components/Stacks.astro +33 -0
- package/site/src/components/Suggested.astro +39 -0
- package/site/src/data/opencode-go-benchmark.json +230 -0
- package/site/src/i18n/en.ts +155 -0
- package/site/src/i18n/es.ts +158 -0
- package/site/src/i18n/index.ts +14 -0
- package/site/src/layouts/Layout.astro +114 -0
- package/site/src/pages/benchmarks.astro +4 -0
- package/site/src/pages/es/benchmarks.astro +4 -0
- package/site/src/pages/es/index.astro +10 -0
- package/site/src/pages/index.astro +10 -0
- package/site/src/styles/global.css +780 -0
- package/site/tsconfig.json +3 -0
- package/skills/lexis-two/SKILL.md +109 -0
- package/skills/lexis-two-audit/SKILL.md +21 -0
- package/skills/lexis-two-debt/SKILL.md +22 -0
- package/skills/lexis-two-plan/SKILL.md +25 -0
- package/skills/lexis-two-review/SKILL.md +24 -0
- package/skills/lexis-two-security/SKILL.md +24 -0
- package/tests/behavior.test.js +80 -0
- package/tests/commands.test.js +40 -0
- package/tests/copilot-plugin.test.js +33 -0
- package/tests/correctness.test.js +191 -0
- package/tests/gemini-extension.test.js +78 -0
- package/tests/hooks-windows.test.js +48 -0
- package/tests/hooks.test.js +177 -0
- package/tests/opencode-plugin.test.js +64 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Regression test for issue #19: on Windows the lifecycle hooks run via
|
|
3
|
+
// PowerShell, which does NOT expand cmd.exe-style %VAR% — it needs $env:VAR.
|
|
4
|
+
// The hook also has to point at a script that actually ships in hooks/.
|
|
5
|
+
// This guards both failure modes: the original %CLAUDE_PLUGIN_ROOT% bug, and
|
|
6
|
+
// the "switch to a .ps1 that doesn't exist" mistake.
|
|
7
|
+
|
|
8
|
+
const test = require('node:test');
|
|
9
|
+
const assert = require('node:assert/strict');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
const path = require('path');
|
|
12
|
+
|
|
13
|
+
const root = path.join(__dirname, '..');
|
|
14
|
+
const HOOKS_JSON = 'hooks/hooks.json';
|
|
15
|
+
// cmd.exe variable syntax (%FOO%); PowerShell leaves it literal, breaking the path.
|
|
16
|
+
const CMD_VAR_SYNTAX = /%[A-Za-z_][A-Za-z0-9_]*%/;
|
|
17
|
+
// Pull the hooks/<script> a command launches, so we can check it exists.
|
|
18
|
+
const HOOK_SCRIPT = /hooks[\\/]([\w.-]+\.(?:js|mjs|cjs|ps1|sh))/;
|
|
19
|
+
|
|
20
|
+
// Read inside each case so a missing/malformed file fails as a clean assertion,
|
|
21
|
+
// not a load-time crash.
|
|
22
|
+
function commandHooks() {
|
|
23
|
+
const config = JSON.parse(fs.readFileSync(path.join(root, HOOKS_JSON), 'utf8'));
|
|
24
|
+
return Object.values(config.hooks)
|
|
25
|
+
.flat()
|
|
26
|
+
.flatMap((entry) => entry.hooks);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
test('every commandWindows uses PowerShell $env: syntax, not cmd.exe %VAR%', () => {
|
|
30
|
+
const windowsCommands = commandHooks()
|
|
31
|
+
.map((h) => h.commandWindows)
|
|
32
|
+
.filter(Boolean);
|
|
33
|
+
assert.ok(windowsCommands.length > 0, 'expected at least one commandWindows entry');
|
|
34
|
+
for (const cmd of windowsCommands) {
|
|
35
|
+
assert.doesNotMatch(cmd, CMD_VAR_SYNTAX, `commandWindows uses cmd.exe %VAR% (breaks under PowerShell): ${cmd}`);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('every hook command points at a script that ships in hooks/', () => {
|
|
40
|
+
for (const hook of commandHooks()) {
|
|
41
|
+
for (const cmd of [hook.command, hook.commandWindows].filter(Boolean)) {
|
|
42
|
+
const match = cmd.match(HOOK_SCRIPT);
|
|
43
|
+
assert.ok(match, `cannot find a hooks/ script in command: ${cmd}`);
|
|
44
|
+
const script = path.join(root, 'hooks', match[1]);
|
|
45
|
+
assert.ok(fs.existsSync(script), `command references a missing hook script: ${match[1]}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const test = require('node:test');
|
|
4
|
+
const assert = require('node:assert/strict');
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
const os = require('os');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const { spawnSync } = require('child_process');
|
|
9
|
+
|
|
10
|
+
const root = path.join(__dirname, '..');
|
|
11
|
+
|
|
12
|
+
function run(script, env, input = '') {
|
|
13
|
+
return spawnSync(process.execPath, [path.join(root, 'hooks', script)], {
|
|
14
|
+
env: { ...process.env, ...env },
|
|
15
|
+
input,
|
|
16
|
+
encoding: 'utf8',
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
test('hooks integration tests', async (t) => {
|
|
21
|
+
let originalEnv;
|
|
22
|
+
let temp;
|
|
23
|
+
let home;
|
|
24
|
+
let pluginData;
|
|
25
|
+
let codexEnv;
|
|
26
|
+
let codexState;
|
|
27
|
+
|
|
28
|
+
t.beforeEach(() => {
|
|
29
|
+
// Save original env and clean it
|
|
30
|
+
originalEnv = { ...process.env };
|
|
31
|
+
delete process.env.CLAUDE_CONFIG_DIR;
|
|
32
|
+
delete process.env.LEXIS_TWO_DEFAULT_MODE;
|
|
33
|
+
|
|
34
|
+
temp = fs.mkdtempSync(path.join(os.tmpdir(), 'lexis-two-hooks-'));
|
|
35
|
+
home = path.join(temp, 'home');
|
|
36
|
+
pluginData = path.join(temp, 'plugin-data');
|
|
37
|
+
fs.mkdirSync(home, { recursive: true });
|
|
38
|
+
|
|
39
|
+
codexEnv = {
|
|
40
|
+
HOME: home,
|
|
41
|
+
USERPROFILE: home,
|
|
42
|
+
PLUGIN_DATA: pluginData,
|
|
43
|
+
LEXIS_TWO_DEFAULT_MODE: 'ultra',
|
|
44
|
+
};
|
|
45
|
+
codexState = path.join(pluginData, '.lexis-two-active');
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
t.afterEach(() => {
|
|
49
|
+
// Restore original env and clean temp folder
|
|
50
|
+
process.env = originalEnv;
|
|
51
|
+
try {
|
|
52
|
+
fs.rmSync(temp, { recursive: true, force: true });
|
|
53
|
+
} catch (e) {}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
await t.test('lexis-two-activate.js activates ultra mode for Codex', () => {
|
|
57
|
+
const result = run('lexis-two-activate.js', codexEnv);
|
|
58
|
+
assert.equal(result.status, 0, result.stderr);
|
|
59
|
+
assert.equal(fs.readFileSync(codexState, 'utf8'), 'ultra');
|
|
60
|
+
const output = JSON.parse(result.stdout);
|
|
61
|
+
assert.equal(output.systemMessage, 'LEXIS-TWO:ULTRA');
|
|
62
|
+
assert.match(
|
|
63
|
+
output.hookSpecificOutput.additionalContext,
|
|
64
|
+
/LEXIS-TWO MODE ACTIVE — level: ultra/,
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
await t.test('lexis-two-mode-tracker.js switches mode to lite', () => {
|
|
69
|
+
// First activate
|
|
70
|
+
run('lexis-two-activate.js', codexEnv);
|
|
71
|
+
|
|
72
|
+
const result = run(
|
|
73
|
+
'lexis-two-mode-tracker.js',
|
|
74
|
+
codexEnv,
|
|
75
|
+
JSON.stringify({ prompt: '@lexis-two lite' }),
|
|
76
|
+
);
|
|
77
|
+
assert.equal(result.status, 0, result.stderr);
|
|
78
|
+
assert.equal(fs.readFileSync(codexState, 'utf8'), 'lite');
|
|
79
|
+
const output = JSON.parse(result.stdout);
|
|
80
|
+
assert.equal(output.systemMessage, 'LEXIS-TWO:LITE');
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
await t.test('lexis-two-mode-tracker.js deactivates mode with normal prompt', () => {
|
|
84
|
+
// First activate
|
|
85
|
+
run('lexis-two-activate.js', codexEnv);
|
|
86
|
+
|
|
87
|
+
const result = run(
|
|
88
|
+
'lexis-two-mode-tracker.js',
|
|
89
|
+
codexEnv,
|
|
90
|
+
JSON.stringify({ prompt: 'normal mode' }),
|
|
91
|
+
);
|
|
92
|
+
assert.equal(result.status, 0, result.stderr);
|
|
93
|
+
assert.equal(fs.existsSync(codexState), false);
|
|
94
|
+
const output = JSON.parse(result.stdout);
|
|
95
|
+
assert.equal(output.systemMessage, 'LEXIS-TWO:OFF');
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
await t.test('lexis-two-activate.js activates full mode for Claude', () => {
|
|
99
|
+
const claudeEnv = {
|
|
100
|
+
HOME: home,
|
|
101
|
+
USERPROFILE: home,
|
|
102
|
+
LEXIS_TWO_DEFAULT_MODE: 'full',
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const result = run('lexis-two-activate.js', claudeEnv);
|
|
106
|
+
assert.equal(result.status, 0, result.stderr);
|
|
107
|
+
assert.equal(
|
|
108
|
+
fs.readFileSync(path.join(home, '.claude', '.lexis-two-active'), 'utf8'),
|
|
109
|
+
'full',
|
|
110
|
+
);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
await t.test('CLAUDE_CONFIG_DIR overrides ~/.claude for Claude flag file', () => {
|
|
114
|
+
const home2 = path.join(temp, 'home2');
|
|
115
|
+
fs.mkdirSync(home2, { recursive: true });
|
|
116
|
+
const customConfigDir = path.join(temp, 'custom-claude');
|
|
117
|
+
|
|
118
|
+
const result = run('lexis-two-activate.js', {
|
|
119
|
+
HOME: home2,
|
|
120
|
+
USERPROFILE: home2,
|
|
121
|
+
CLAUDE_CONFIG_DIR: customConfigDir,
|
|
122
|
+
LEXIS_TWO_DEFAULT_MODE: 'lite',
|
|
123
|
+
});
|
|
124
|
+
assert.equal(result.status, 0, result.stderr);
|
|
125
|
+
assert.equal(
|
|
126
|
+
fs.readFileSync(path.join(customConfigDir, '.lexis-two-active'), 'utf8'),
|
|
127
|
+
'lite',
|
|
128
|
+
);
|
|
129
|
+
assert.equal(
|
|
130
|
+
fs.existsSync(path.join(home2, '.claude', '.lexis-two-active')),
|
|
131
|
+
false,
|
|
132
|
+
'flag must not land in ~/.claude when CLAUDE_CONFIG_DIR is set',
|
|
133
|
+
);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
await t.test('copilot hooks isolate state from Codex', () => {
|
|
137
|
+
const copilotData = path.join(temp, 'copilot-data');
|
|
138
|
+
const codexData = path.join(temp, 'codex-data-shadow');
|
|
139
|
+
|
|
140
|
+
let result = run('lexis-two-activate.js', {
|
|
141
|
+
HOME: home,
|
|
142
|
+
USERPROFILE: home,
|
|
143
|
+
COPILOT_PLUGIN_DATA: copilotData,
|
|
144
|
+
PLUGIN_DATA: codexData,
|
|
145
|
+
LEXIS_TWO_DEFAULT_MODE: 'full',
|
|
146
|
+
});
|
|
147
|
+
assert.equal(result.status, 0, result.stderr);
|
|
148
|
+
assert.equal(fs.readFileSync(path.join(copilotData, '.lexis-two-active'), 'utf8'), 'full');
|
|
149
|
+
assert.equal(
|
|
150
|
+
fs.existsSync(path.join(codexData, '.lexis-two-active')),
|
|
151
|
+
false,
|
|
152
|
+
'copilot hooks must not write mode state to codex PLUGIN_DATA',
|
|
153
|
+
);
|
|
154
|
+
let output = JSON.parse(result.stdout);
|
|
155
|
+
assert.match(output.additionalContext, /LEXIS-TWO MODE ACTIVE — level: full/);
|
|
156
|
+
|
|
157
|
+
result = run(
|
|
158
|
+
'lexis-two-mode-tracker.js',
|
|
159
|
+
{
|
|
160
|
+
HOME: home,
|
|
161
|
+
USERPROFILE: home,
|
|
162
|
+
COPILOT_PLUGIN_DATA: copilotData,
|
|
163
|
+
PLUGIN_DATA: codexData,
|
|
164
|
+
},
|
|
165
|
+
JSON.stringify({ prompt: '/lexis-two ultra' }),
|
|
166
|
+
);
|
|
167
|
+
assert.equal(result.status, 0, result.stderr);
|
|
168
|
+
assert.equal(fs.readFileSync(path.join(copilotData, '.lexis-two-active'), 'utf8'), 'ultra');
|
|
169
|
+
assert.equal(
|
|
170
|
+
fs.existsSync(path.join(codexData, '.lexis-two-active')),
|
|
171
|
+
false,
|
|
172
|
+
'copilot mode tracker must keep codex PLUGIN_DATA untouched',
|
|
173
|
+
);
|
|
174
|
+
output = JSON.parse(result.stdout);
|
|
175
|
+
assert.deepEqual(output, {});
|
|
176
|
+
});
|
|
177
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Smoke test for the OpenCode adapter: the plugin's hooks behave against the
|
|
3
|
+
// real (structural) OpenCode hook shapes. No live OpenCode needed.
|
|
4
|
+
|
|
5
|
+
const test = require('node:test');
|
|
6
|
+
const assert = require('node:assert/strict');
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
const os = require('os');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const { pathToFileURL } = require('url');
|
|
11
|
+
|
|
12
|
+
// Point the plugin's mode-flag at a temp config home BEFORE it loads — the
|
|
13
|
+
// plugin resolves its state path once at load (as it does under a real OpenCode
|
|
14
|
+
// process, where XDG_CONFIG_HOME is already set). The dynamic import below runs
|
|
15
|
+
// after this assignment, so the ordering holds.
|
|
16
|
+
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'lexis-two-opencode-'));
|
|
17
|
+
process.env.XDG_CONFIG_HOME = tmp;
|
|
18
|
+
delete process.env.LEXIS_TWO_DEFAULT_MODE;
|
|
19
|
+
const statePath = path.join(tmp, 'opencode', '.lexis-two-active');
|
|
20
|
+
|
|
21
|
+
let loadPlugin;
|
|
22
|
+
test.before(async () => {
|
|
23
|
+
const url = pathToFileURL(path.join(__dirname, '..', '.opencode', 'plugins', 'lexis-two.mjs'));
|
|
24
|
+
loadPlugin = (await import(url)).default;
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
function transform(hooks) {
|
|
28
|
+
const output = { system: [] };
|
|
29
|
+
return hooks['experimental.chat.system.transform']({ model: {} }, output).then(() => output.system);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
test('system.transform injects the ruleset at the default mode (full)', async () => {
|
|
33
|
+
try { fs.unlinkSync(statePath); } catch (e) {}
|
|
34
|
+
const hooks = await loadPlugin({});
|
|
35
|
+
const system = await transform(hooks);
|
|
36
|
+
assert.equal(system.length, 1);
|
|
37
|
+
assert.match(system[0], /LEXIS-TWO MODE ACTIVE — level: full/);
|
|
38
|
+
assert.match(system[0], /lazy senior developer/);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test('command.execute.before persists /lexis-two ultra, transform follows it', async () => {
|
|
42
|
+
const hooks = await loadPlugin({});
|
|
43
|
+
await hooks['command.execute.before']({ command: 'lexis-two', arguments: 'ultra', sessionID: 's' });
|
|
44
|
+
assert.equal(fs.readFileSync(statePath, 'utf8'), 'ultra');
|
|
45
|
+
const system = await transform(hooks);
|
|
46
|
+
assert.match(system[0], /LEXIS-TWO MODE ACTIVE — level: ultra/);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('/lexis-two off persists off and transform injects nothing', async () => {
|
|
50
|
+
const hooks = await loadPlugin({});
|
|
51
|
+
await hooks['command.execute.before']({ command: 'lexis-two', arguments: 'off', sessionID: 's' });
|
|
52
|
+
assert.equal(fs.readFileSync(statePath, 'utf8'), 'off');
|
|
53
|
+
const system = await transform(hooks);
|
|
54
|
+
assert.deepEqual(system, []);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test('unrelated commands do not touch the flag', async () => {
|
|
58
|
+
try { fs.unlinkSync(statePath); } catch (e) {}
|
|
59
|
+
const hooks = await loadPlugin({});
|
|
60
|
+
await hooks['command.execute.before']({ command: 'commit', arguments: 'x', sessionID: 's' });
|
|
61
|
+
assert.equal(fs.existsSync(statePath), false);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
test.after(() => fs.rmSync(tmp, { recursive: true, force: true }));
|