cmx-sdk 0.2.7 → 0.2.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.
Files changed (45) hide show
  1. package/dist/add-studio-YUDYE2OH.js +0 -0
  2. package/dist/chunk-7TDMLYBI.js +0 -0
  3. package/dist/chunk-EDXXR5BE.js +0 -0
  4. package/dist/{chunk-S3TFTN6H.js → chunk-EZMBZWH7.js} +57 -0
  5. package/dist/chunk-FPQYL5GE.js +0 -0
  6. package/dist/chunk-IIQLQIDP.js +0 -0
  7. package/dist/chunk-NZQ6SBFS.js +0 -0
  8. package/dist/cli.js +567 -121
  9. package/dist/index.d.ts +343 -2
  10. package/dist/index.js +79 -31
  11. package/dist/index.js.map +1 -1
  12. package/dist/init-FLRQXJX4.js +0 -0
  13. package/dist/{interactive-menu-QKE6FMPN.js → interactive-menu-FYVOQSTL.js} +1 -1
  14. package/dist/studio-HAS6DYLO.js +0 -0
  15. package/dist/{update-sdk-ZDFOSMN4.js → update-sdk-KJZ6VB4M.js} +1 -1
  16. package/dist/update-studio-TWCYSYIS.js +0 -0
  17. package/package.json +16 -14
  18. package/templates/AGENTS.md +173 -0
  19. package/templates/CLAUDE.md +28 -0
  20. package/templates/claude/commands/check.md +64 -0
  21. package/templates/claude/commands/next-action.md +66 -0
  22. package/templates/claude/skills/cmx-cache/SKILL.md +50 -0
  23. package/templates/claude/skills/cmx-cache/references/cache-patterns.md +153 -0
  24. package/templates/claude/skills/cmx-component/SKILL.md +108 -0
  25. package/templates/claude/skills/cmx-component/references/component-schema.md +123 -0
  26. package/templates/claude/skills/cmx-content/SKILL.md +158 -0
  27. package/templates/claude/skills/cmx-content/references/migration-patterns.md +120 -0
  28. package/templates/claude/skills/cmx-content/references/seed-patterns.md +146 -0
  29. package/templates/claude/skills/cmx-dev/SKILL.md +266 -0
  30. package/templates/claude/skills/cmx-dev/references/api-patterns.md +220 -0
  31. package/templates/claude/skills/cmx-dev/references/cli-reference.md +54 -0
  32. package/templates/claude/skills/cmx-form/SKILL.md +103 -0
  33. package/templates/claude/skills/cmx-form/references/form-template.md +152 -0
  34. package/templates/claude/skills/cmx-migrate/SKILL.md +501 -0
  35. package/templates/claude/skills/cmx-migrate/references/analysis-guide.md +127 -0
  36. package/templates/claude/skills/cmx-migrate/references/html-to-mdx.md +99 -0
  37. package/templates/claude/skills/cmx-migrate/references/intermediate-format.md +196 -0
  38. package/templates/claude/skills/cmx-migrate/references/tool-setup.md +150 -0
  39. package/templates/claude/skills/cmx-schema/SKILL.md +159 -0
  40. package/templates/claude/skills/cmx-schema/references/field-types.md +164 -0
  41. package/templates/claude/skills/cmx-schema/references/migration-scenarios.md +44 -0
  42. package/templates/claude/skills/cmx-seo/SKILL.md +54 -0
  43. package/templates/claude/skills/cmx-seo/references/seo-patterns.md +216 -0
  44. package/templates/claude/skills/cmx-style/SKILL.md +48 -0
  45. package/templates/claude/skills/cmx-style/references/style-patterns.md +114 -0
File without changes
File without changes
File without changes
@@ -9,6 +9,12 @@ import {
9
9
 
10
10
  // src/commands/update-sdk.ts
11
11
  import { execSync } from "child_process";
12
+ import { cpSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
13
+ import { dirname, join } from "path";
14
+ import { fileURLToPath } from "url";
15
+ var __filename = fileURLToPath(import.meta.url);
16
+ var __dirname = dirname(__filename);
17
+ var SDK_ROOT = join(__dirname, "..", "..");
12
18
  function resolveRequestedVersion(version) {
13
19
  if (version === void 0) return "latest";
14
20
  const normalized = version.trim();
@@ -17,6 +23,52 @@ function resolveRequestedVersion(version) {
17
23
  }
18
24
  return normalized;
19
25
  }
26
+ function syncClaudeCommands(projectRoot) {
27
+ const templatesDir = join(SDK_ROOT, "templates", "claude", "commands");
28
+ if (!existsSync(templatesDir)) return;
29
+ const destDir = join(projectRoot, ".claude", "commands");
30
+ mkdirSync(destDir, { recursive: true });
31
+ cpSync(templatesDir, destDir, { recursive: true, force: true });
32
+ console.log(" \u2705 .claude/commands \u3092\u66F4\u65B0\u3057\u307E\u3057\u305F");
33
+ }
34
+ function syncClaudeSkills(projectRoot) {
35
+ const templatesDir = join(SDK_ROOT, "templates", "claude", "skills");
36
+ if (!existsSync(templatesDir)) return;
37
+ const destDir = join(projectRoot, ".claude", "skills");
38
+ mkdirSync(destDir, { recursive: true });
39
+ cpSync(templatesDir, destDir, { recursive: true, force: true });
40
+ console.log(" \u2705 .claude/skills \u3092\u66F4\u65B0\u3057\u307E\u3057\u305F");
41
+ }
42
+ function syncManagedFile(projectRoot, relativePath) {
43
+ const templatePath = join(SDK_ROOT, "templates", relativePath);
44
+ if (!existsSync(templatePath)) return;
45
+ const destPath = join(projectRoot, relativePath);
46
+ const templateContent = readFileSync(templatePath, "utf-8");
47
+ if (!existsSync(destPath)) {
48
+ mkdirSync(dirname(destPath), { recursive: true });
49
+ writeFileSync(destPath, templateContent);
50
+ console.log(` \u2705 ${relativePath} \u3092\u4F5C\u6210\u3057\u307E\u3057\u305F`);
51
+ return;
52
+ }
53
+ const blockRegex = /<!-- cmx-sdk:start id="([^"]+)" -->([\s\S]*?)<!-- cmx-sdk:end -->/g;
54
+ let userContent = readFileSync(destPath, "utf-8");
55
+ let updatedBlocks = 0;
56
+ let match;
57
+ while ((match = blockRegex.exec(templateContent)) !== null) {
58
+ const [fullBlock, id] = match;
59
+ const userBlockRegex = new RegExp(
60
+ `<!-- cmx-sdk:start id="${id}" -->[\\s\\S]*?<!-- cmx-sdk:end -->`
61
+ );
62
+ if (userBlockRegex.test(userContent)) {
63
+ userContent = userContent.replace(userBlockRegex, fullBlock);
64
+ updatedBlocks++;
65
+ }
66
+ }
67
+ if (updatedBlocks > 0) {
68
+ writeFileSync(destPath, userContent);
69
+ console.log(` \u2705 ${relativePath} \u3092\u66F4\u65B0\u3057\u307E\u3057\u305F\uFF08${updatedBlocks} \u30D6\u30ED\u30C3\u30AF\uFF09`);
70
+ }
71
+ }
20
72
  async function updateSdk(options = {}) {
21
73
  console.log("\n cmx-sdk \u306E\u4F9D\u5B58\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u66F4\u65B0\u3057\u307E\u3059...\n");
22
74
  const projectRoot = findProjectRoot();
@@ -50,6 +102,11 @@ async function updateSdk(options = {}) {
50
102
  const updatedVersion = readSdkVersion(projectRoot);
51
103
  console.log("\n \u2705 cmx-sdk \u3092\u66F4\u65B0\u3057\u307E\u3057\u305F\uFF01");
52
104
  console.log(` \u66F4\u65B0\u5F8C\u30D0\u30FC\u30B8\u30E7\u30F3: ${updatedVersion ?? "\u4E0D\u660E"}`);
105
+ console.log("\n \u23F3 Claude Code \u30D5\u30A1\u30A4\u30EB\u3092\u66F4\u65B0\u4E2D...");
106
+ syncClaudeCommands(projectRoot);
107
+ syncClaudeSkills(projectRoot);
108
+ syncManagedFile(projectRoot, "AGENTS.md");
109
+ syncManagedFile(projectRoot, "CLAUDE.md");
53
110
  console.log("\n \u6B21\u306E\u30B9\u30C6\u30C3\u30D7:");
54
111
  console.log(" 1. \u578B\u751F\u6210\u3092\u518D\u5B9F\u884C");
55
112
  console.log(" npx cmx-sdk codegen types");
File without changes
File without changes
File without changes