@codecademy/gamut 68.6.1-alpha.c211a2.0 → 68.6.1-alpha.df4bce.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/agent-tools/.claude-plugin/marketplace.json +16 -0
- package/agent-tools/.claude-plugin/plugin.json +7 -0
- package/agent-tools/.cursor-plugin/plugin.json +7 -0
- package/agent-tools/DESIGN.Codecademy.md +643 -0
- package/agent-tools/DESIGN.LXStudio.md +444 -0
- package/agent-tools/DESIGN.Percipio.md +435 -0
- package/agent-tools/DESIGN.md +1 -0
- package/agent-tools/agents/.gitkeep +0 -0
- package/agent-tools/commands/gamut-review.md +231 -0
- package/agent-tools/guidelines/components/buttons.md +91 -0
- package/agent-tools/guidelines/components/overview.md +52 -0
- package/agent-tools/guidelines/foundations/color.md +172 -0
- package/agent-tools/guidelines/foundations/modes.md +47 -0
- package/agent-tools/guidelines/foundations/spacing.md +107 -0
- package/agent-tools/guidelines/foundations/typography.md +83 -0
- package/agent-tools/guidelines/overview.md +40 -0
- package/agent-tools/guidelines/setup.md +81 -0
- package/agent-tools/rules/accessibility.mdc +78 -0
- package/agent-tools/skills/gamut-accessibility/SKILL.md +214 -0
- package/agent-tools/skills/gamut-color-mode/SKILL.md +138 -0
- package/agent-tools/skills/gamut-forms/SKILL.md +84 -0
- package/agent-tools/skills/gamut-system-props/SKILL.md +203 -0
- package/agent-tools/skills/gamut-testing/SKILL.md +221 -0
- package/agent-tools/skills/gamut-theming/SKILL.md +113 -0
- package/agent-tools/skills/gamut-typography/SKILL.md +75 -0
- package/bin/commands/plugin/install.mjs +173 -0
- package/bin/commands/plugin/list.mjs +105 -0
- package/bin/commands/plugin/remove.mjs +116 -0
- package/bin/commands/plugin/update.mjs +49 -0
- package/bin/gamut.mjs +92 -0
- package/bin/lib/claude.mjs +52 -0
- package/bin/lib/cursor.mjs +40 -0
- package/bin/lib/figma.mjs +49 -0
- package/bin/lib/resolve-plugin-dir.mjs +38 -0
- package/bin/lib/run-command.mjs +22 -0
- package/package.json +11 -8
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { stat } from 'node:fs/promises';
|
|
2
|
+
import { dirname, resolve } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
|
|
5
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Returns the absolute path to the bundled agent-tools directory, or the
|
|
9
|
+
* value of --plugin-dir if provided.
|
|
10
|
+
*
|
|
11
|
+
* @param {string[]} args
|
|
12
|
+
* @returns {Promise<string>}
|
|
13
|
+
*/
|
|
14
|
+
export async function resolvePluginDir(args) {
|
|
15
|
+
const override = getFlag(args, '--plugin-dir');
|
|
16
|
+
if (override) {
|
|
17
|
+
const abs = resolve(override);
|
|
18
|
+
const st = await stat(abs).catch(() => null);
|
|
19
|
+
if (!st?.isDirectory()) {
|
|
20
|
+
throw new Error(`--plugin-dir path not found: ${abs}`);
|
|
21
|
+
}
|
|
22
|
+
return abs;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// agent-tools/ is bundled at <package-root>/agent-tools/ relative to bin/lib/
|
|
26
|
+
return resolve(__dirname, '..', '..', 'agent-tools');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @param {string[]} argv
|
|
31
|
+
* @param {string} flag
|
|
32
|
+
* @param {string} [fallback]
|
|
33
|
+
* @returns {string | undefined}
|
|
34
|
+
*/
|
|
35
|
+
export function getFlag(argv, flag, fallback) {
|
|
36
|
+
const idx = argv.indexOf(flag);
|
|
37
|
+
return idx !== -1 ? argv[idx + 1] : fallback;
|
|
38
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Spawns an external command and returns its exit code.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} command
|
|
7
|
+
* @param {string[]} args
|
|
8
|
+
* @returns {Promise<number>}
|
|
9
|
+
*/
|
|
10
|
+
export function runCommand(command, args) {
|
|
11
|
+
return new Promise((resolve, reject) => {
|
|
12
|
+
const child = spawn(command, args, { stdio: 'inherit', shell: false });
|
|
13
|
+
child.on('error', (/** @type {NodeJS.ErrnoException} */ err) => {
|
|
14
|
+
if (err.code === 'ENOENT') {
|
|
15
|
+
reject(new Error(`"${command}" not found on PATH. Is it installed?`));
|
|
16
|
+
} else {
|
|
17
|
+
reject(err);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
child.on('close', (code) => resolve(code ?? 1));
|
|
21
|
+
});
|
|
22
|
+
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecademy/gamut",
|
|
3
3
|
"description": "Styleguide & Component library for Codecademy",
|
|
4
|
-
"version": "68.6.1-alpha.
|
|
4
|
+
"version": "68.6.1-alpha.df4bce.0",
|
|
5
5
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
6
|
+
"bin": "./bin/gamut.mjs",
|
|
6
7
|
"dependencies": {
|
|
7
|
-
"@codecademy/gamut-icons": "9.57.6-alpha.
|
|
8
|
-
"@codecademy/gamut-illustrations": "0.58.12-alpha.
|
|
9
|
-
"@codecademy/gamut-patterns": "0.10.31-alpha.
|
|
10
|
-
"@codecademy/gamut-styles": "18.0.1-alpha.
|
|
11
|
-
"@codecademy/variance": "0.26.2-alpha.
|
|
8
|
+
"@codecademy/gamut-icons": "9.57.6-alpha.df4bce.0",
|
|
9
|
+
"@codecademy/gamut-illustrations": "0.58.12-alpha.df4bce.0",
|
|
10
|
+
"@codecademy/gamut-patterns": "0.10.31-alpha.df4bce.0",
|
|
11
|
+
"@codecademy/gamut-styles": "18.0.1-alpha.df4bce.0",
|
|
12
|
+
"@codecademy/variance": "0.26.2-alpha.df4bce.0",
|
|
12
13
|
"@formatjs/intl-locale": "5.3.1",
|
|
13
14
|
"@react-aria/interactions": "3.25.0",
|
|
14
15
|
"@types/marked": "^4.0.8",
|
|
@@ -30,7 +31,9 @@
|
|
|
30
31
|
"sanitize-markdown": "^2.6.7"
|
|
31
32
|
},
|
|
32
33
|
"files": [
|
|
33
|
-
"dist"
|
|
34
|
+
"dist",
|
|
35
|
+
"bin",
|
|
36
|
+
"agent-tools"
|
|
34
37
|
],
|
|
35
38
|
"license": "MIT",
|
|
36
39
|
"main": "./dist/index.js",
|
|
@@ -52,7 +55,7 @@
|
|
|
52
55
|
"build": "nx build @codecademy/gamut",
|
|
53
56
|
"build:watch": "yarn build && onchange ./src -- yarn build",
|
|
54
57
|
"compile": "babel ./src --out-dir ./dist --extensions \".ts,.tsx\"",
|
|
55
|
-
"verify": "tsc --noEmit"
|
|
58
|
+
"verify": "tsc --noEmit && tsc --project tsconfig.bin.json"
|
|
56
59
|
},
|
|
57
60
|
"sideEffects": [
|
|
58
61
|
"**/*.css",
|