@synth-coder/memhub 0.2.3 → 0.2.4

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 (143) hide show
  1. package/.eslintrc.cjs +45 -45
  2. package/.factory/commands/opsx-apply.md +150 -150
  3. package/.factory/commands/opsx-archive.md +155 -155
  4. package/.factory/commands/opsx-explore.md +171 -171
  5. package/.factory/commands/opsx-propose.md +104 -104
  6. package/.factory/skills/openspec-apply-change/SKILL.md +156 -156
  7. package/.factory/skills/openspec-archive-change/SKILL.md +114 -114
  8. package/.factory/skills/openspec-explore/SKILL.md +288 -288
  9. package/.factory/skills/openspec-propose/SKILL.md +110 -110
  10. package/.github/workflows/ci.yml +110 -74
  11. package/.github/workflows/release.yml +67 -0
  12. package/.iflow/commands/opsx-apply.md +152 -152
  13. package/.iflow/commands/opsx-archive.md +157 -157
  14. package/.iflow/commands/opsx-explore.md +173 -173
  15. package/.iflow/commands/opsx-propose.md +106 -106
  16. package/.iflow/skills/openspec-apply-change/SKILL.md +156 -156
  17. package/.iflow/skills/openspec-archive-change/SKILL.md +114 -114
  18. package/.iflow/skills/openspec-explore/SKILL.md +288 -288
  19. package/.iflow/skills/openspec-propose/SKILL.md +110 -110
  20. package/.prettierrc +11 -11
  21. package/AGENTS.md +167 -169
  22. package/README.md +276 -195
  23. package/README.zh-CN.md +245 -193
  24. package/dist/src/cli/agents/claude-code.d.ts +5 -0
  25. package/dist/src/cli/agents/claude-code.d.ts.map +1 -0
  26. package/dist/src/cli/agents/claude-code.js +14 -0
  27. package/dist/src/cli/agents/claude-code.js.map +1 -0
  28. package/dist/src/cli/agents/cline.d.ts +5 -0
  29. package/dist/src/cli/agents/cline.d.ts.map +1 -0
  30. package/dist/src/cli/agents/cline.js +14 -0
  31. package/dist/src/cli/agents/cline.js.map +1 -0
  32. package/dist/src/cli/agents/codex.d.ts +5 -0
  33. package/dist/src/cli/agents/codex.d.ts.map +1 -0
  34. package/dist/src/cli/agents/codex.js +14 -0
  35. package/dist/src/cli/agents/codex.js.map +1 -0
  36. package/dist/src/cli/agents/cursor.d.ts +5 -0
  37. package/dist/src/cli/agents/cursor.d.ts.map +1 -0
  38. package/dist/src/cli/agents/cursor.js +14 -0
  39. package/dist/src/cli/agents/cursor.js.map +1 -0
  40. package/dist/src/cli/agents/factory-droid.d.ts +5 -0
  41. package/dist/src/cli/agents/factory-droid.d.ts.map +1 -0
  42. package/dist/src/cli/agents/factory-droid.js +14 -0
  43. package/dist/src/cli/agents/factory-droid.js.map +1 -0
  44. package/dist/src/cli/agents/gemini-cli.d.ts +5 -0
  45. package/dist/src/cli/agents/gemini-cli.d.ts.map +1 -0
  46. package/dist/src/cli/agents/gemini-cli.js +14 -0
  47. package/dist/src/cli/agents/gemini-cli.js.map +1 -0
  48. package/dist/src/cli/agents/index.d.ts +14 -0
  49. package/dist/src/cli/agents/index.d.ts.map +1 -0
  50. package/dist/src/cli/agents/index.js +30 -0
  51. package/dist/src/cli/agents/index.js.map +1 -0
  52. package/dist/src/cli/agents/windsurf.d.ts +5 -0
  53. package/dist/src/cli/agents/windsurf.d.ts.map +1 -0
  54. package/dist/src/cli/agents/windsurf.js +14 -0
  55. package/dist/src/cli/agents/windsurf.js.map +1 -0
  56. package/dist/src/cli/index.d.ts +8 -0
  57. package/dist/src/cli/index.d.ts.map +1 -0
  58. package/dist/src/cli/index.js +168 -0
  59. package/dist/src/cli/index.js.map +1 -0
  60. package/dist/src/cli/init.d.ts +34 -0
  61. package/dist/src/cli/init.d.ts.map +1 -0
  62. package/dist/src/cli/init.js +160 -0
  63. package/dist/src/cli/init.js.map +1 -0
  64. package/dist/src/cli/instructions.d.ts +29 -0
  65. package/dist/src/cli/instructions.d.ts.map +1 -0
  66. package/dist/src/cli/instructions.js +141 -0
  67. package/dist/src/cli/instructions.js.map +1 -0
  68. package/dist/src/cli/types.d.ts +22 -0
  69. package/dist/src/cli/types.d.ts.map +1 -0
  70. package/dist/src/cli/types.js +86 -0
  71. package/dist/src/cli/types.js.map +1 -0
  72. package/dist/src/contracts/mcp.js +34 -34
  73. package/dist/src/contracts/schemas.js.map +1 -1
  74. package/dist/src/server/mcp-server.d.ts.map +1 -1
  75. package/dist/src/server/mcp-server.js +7 -14
  76. package/dist/src/server/mcp-server.js.map +1 -1
  77. package/dist/src/services/embedding-service.d.ts.map +1 -1
  78. package/dist/src/services/embedding-service.js +1 -1
  79. package/dist/src/services/embedding-service.js.map +1 -1
  80. package/dist/src/services/memory-service.d.ts.map +1 -1
  81. package/dist/src/services/memory-service.js.map +1 -1
  82. package/dist/src/storage/markdown-storage.d.ts.map +1 -1
  83. package/dist/src/storage/markdown-storage.js +1 -1
  84. package/dist/src/storage/markdown-storage.js.map +1 -1
  85. package/dist/src/storage/vector-index.d.ts.map +1 -1
  86. package/dist/src/storage/vector-index.js +4 -5
  87. package/dist/src/storage/vector-index.js.map +1 -1
  88. package/docs/README.md +21 -0
  89. package/docs/mcp-tools.md +136 -0
  90. package/docs/user-guide.md +182 -0
  91. package/package.json +61 -59
  92. package/src/cli/agents/claude-code.ts +14 -0
  93. package/src/cli/agents/cline.ts +14 -0
  94. package/src/cli/agents/codex.ts +14 -0
  95. package/src/cli/agents/cursor.ts +14 -0
  96. package/src/cli/agents/factory-droid.ts +14 -0
  97. package/src/cli/agents/gemini-cli.ts +14 -0
  98. package/src/cli/agents/index.ts +36 -0
  99. package/src/cli/agents/windsurf.ts +14 -0
  100. package/src/cli/index.ts +192 -0
  101. package/src/cli/init.ts +218 -0
  102. package/src/cli/instructions.ts +156 -0
  103. package/src/cli/types.ts +112 -0
  104. package/src/contracts/index.ts +12 -12
  105. package/src/contracts/mcp.ts +223 -223
  106. package/src/contracts/schemas.ts +307 -307
  107. package/src/contracts/types.ts +410 -410
  108. package/src/index.ts +8 -8
  109. package/src/server/index.ts +5 -5
  110. package/src/server/mcp-server.ts +169 -186
  111. package/src/services/embedding-service.ts +114 -114
  112. package/src/services/index.ts +5 -5
  113. package/src/services/memory-service.ts +656 -663
  114. package/src/storage/frontmatter-parser.ts +243 -243
  115. package/src/storage/index.ts +6 -6
  116. package/src/storage/markdown-storage.ts +228 -236
  117. package/src/storage/vector-index.ts +159 -160
  118. package/src/utils/index.ts +5 -5
  119. package/src/utils/slugify.ts +63 -63
  120. package/test/cli/init.test.ts +380 -0
  121. package/test/contracts/schemas.test.ts +313 -313
  122. package/test/contracts/types.test.ts +21 -21
  123. package/test/frontmatter-parser-more.test.ts +94 -94
  124. package/test/server/mcp-server.test.ts +211 -210
  125. package/test/services/memory-service-edge.test.ts +248 -248
  126. package/test/services/memory-service.test.ts +291 -279
  127. package/test/storage/frontmatter-parser.test.ts +223 -223
  128. package/test/storage/markdown-storage.test.ts +226 -217
  129. package/test/storage/storage-edge.test.ts +238 -238
  130. package/test/storage/vector-index.test.ts +149 -153
  131. package/test/utils/slugify-edge.test.ts +94 -94
  132. package/test/utils/slugify.test.ts +72 -68
  133. package/tsconfig.json +25 -25
  134. package/tsconfig.test.json +8 -8
  135. package/vitest.config.ts +29 -29
  136. package/docs/architecture-diagrams.md +0 -368
  137. package/docs/architecture.md +0 -381
  138. package/docs/contracts.md +0 -190
  139. package/docs/prompt-template.md +0 -33
  140. package/docs/proposals/mcp-typescript-sdk-refactor.md +0 -568
  141. package/docs/proposals/proposal-close-gates.md +0 -58
  142. package/docs/tool-calling-policy.md +0 -101
  143. package/docs/vector-search.md +0 -306
@@ -1,110 +1,110 @@
1
- ---
2
- name: openspec-propose
3
- description: Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.
4
- license: MIT
5
- compatibility: Requires openspec CLI.
6
- metadata:
7
- author: openspec
8
- version: "1.0"
9
- generatedBy: "1.2.0"
10
- ---
11
-
12
- Propose a new change - create the change and generate all artifacts in one step.
13
-
14
- I'll create a change with artifacts:
15
- - proposal.md (what & why)
16
- - design.md (how)
17
- - tasks.md (implementation steps)
18
-
19
- When ready to implement, run /opsx:apply
20
-
21
- ---
22
-
23
- **Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
24
-
25
- **Steps**
26
-
27
- 1. **If no clear input provided, ask what they want to build**
28
-
29
- Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
30
- > "What change do you want to work on? Describe what you want to build or fix."
31
-
32
- From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
33
-
34
- **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
35
-
36
- 2. **Create the change directory**
37
- ```bash
38
- openspec new change "<name>"
39
- ```
40
- This creates a scaffolded change at `openspec/changes/<name>/` with `.openspec.yaml`.
41
-
42
- 3. **Get the artifact build order**
43
- ```bash
44
- openspec status --change "<name>" --json
45
- ```
46
- Parse the JSON to get:
47
- - `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
48
- - `artifacts`: list of all artifacts with their status and dependencies
49
-
50
- 4. **Create artifacts in sequence until apply-ready**
51
-
52
- Use the **TodoWrite tool** to track progress through the artifacts.
53
-
54
- Loop through artifacts in dependency order (artifacts with no pending dependencies first):
55
-
56
- a. **For each artifact that is `ready` (dependencies satisfied)**:
57
- - Get instructions:
58
- ```bash
59
- openspec instructions <artifact-id> --change "<name>" --json
60
- ```
61
- - The instructions JSON includes:
62
- - `context`: Project background (constraints for you - do NOT include in output)
63
- - `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
64
- - `template`: The structure to use for your output file
65
- - `instruction`: Schema-specific guidance for this artifact type
66
- - `outputPath`: Where to write the artifact
67
- - `dependencies`: Completed artifacts to read for context
68
- - Read any completed dependency files for context
69
- - Create the artifact file using `template` as the structure
70
- - Apply `context` and `rules` as constraints - but do NOT copy them into the file
71
- - Show brief progress: "Created <artifact-id>"
72
-
73
- b. **Continue until all `applyRequires` artifacts are complete**
74
- - After creating each artifact, re-run `openspec status --change "<name>" --json`
75
- - Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array
76
- - Stop when all `applyRequires` artifacts are done
77
-
78
- c. **If an artifact requires user input** (unclear context):
79
- - Use **AskUserQuestion tool** to clarify
80
- - Then continue with creation
81
-
82
- 5. **Show final status**
83
- ```bash
84
- openspec status --change "<name>"
85
- ```
86
-
87
- **Output**
88
-
89
- After completing all artifacts, summarize:
90
- - Change name and location
91
- - List of artifacts created with brief descriptions
92
- - What's ready: "All artifacts created! Ready for implementation."
93
- - Prompt: "Run `/opsx:apply` or ask me to implement to start working on the tasks."
94
-
95
- **Artifact Creation Guidelines**
96
-
97
- - Follow the `instruction` field from `openspec instructions` for each artifact type
98
- - The schema defines what each artifact should contain - follow it
99
- - Read dependency artifacts for context before creating new ones
100
- - Use `template` as the structure for your output file - fill in its sections
101
- - **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
102
- - Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
103
- - These guide what you write, but should never appear in the output
104
-
105
- **Guardrails**
106
- - Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`)
107
- - Always read dependency artifacts before creating a new one
108
- - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
109
- - If a change with that name already exists, ask if user wants to continue it or create a new one
110
- - Verify each artifact file exists after writing before proceeding to next
1
+ ---
2
+ name: openspec-propose
3
+ description: Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.
4
+ license: MIT
5
+ compatibility: Requires openspec CLI.
6
+ metadata:
7
+ author: openspec
8
+ version: "1.0"
9
+ generatedBy: "1.2.0"
10
+ ---
11
+
12
+ Propose a new change - create the change and generate all artifacts in one step.
13
+
14
+ I'll create a change with artifacts:
15
+ - proposal.md (what & why)
16
+ - design.md (how)
17
+ - tasks.md (implementation steps)
18
+
19
+ When ready to implement, run /opsx:apply
20
+
21
+ ---
22
+
23
+ **Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
24
+
25
+ **Steps**
26
+
27
+ 1. **If no clear input provided, ask what they want to build**
28
+
29
+ Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
30
+ > "What change do you want to work on? Describe what you want to build or fix."
31
+
32
+ From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
33
+
34
+ **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
35
+
36
+ 2. **Create the change directory**
37
+ ```bash
38
+ openspec new change "<name>"
39
+ ```
40
+ This creates a scaffolded change at `openspec/changes/<name>/` with `.openspec.yaml`.
41
+
42
+ 3. **Get the artifact build order**
43
+ ```bash
44
+ openspec status --change "<name>" --json
45
+ ```
46
+ Parse the JSON to get:
47
+ - `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
48
+ - `artifacts`: list of all artifacts with their status and dependencies
49
+
50
+ 4. **Create artifacts in sequence until apply-ready**
51
+
52
+ Use the **TodoWrite tool** to track progress through the artifacts.
53
+
54
+ Loop through artifacts in dependency order (artifacts with no pending dependencies first):
55
+
56
+ a. **For each artifact that is `ready` (dependencies satisfied)**:
57
+ - Get instructions:
58
+ ```bash
59
+ openspec instructions <artifact-id> --change "<name>" --json
60
+ ```
61
+ - The instructions JSON includes:
62
+ - `context`: Project background (constraints for you - do NOT include in output)
63
+ - `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
64
+ - `template`: The structure to use for your output file
65
+ - `instruction`: Schema-specific guidance for this artifact type
66
+ - `outputPath`: Where to write the artifact
67
+ - `dependencies`: Completed artifacts to read for context
68
+ - Read any completed dependency files for context
69
+ - Create the artifact file using `template` as the structure
70
+ - Apply `context` and `rules` as constraints - but do NOT copy them into the file
71
+ - Show brief progress: "Created <artifact-id>"
72
+
73
+ b. **Continue until all `applyRequires` artifacts are complete**
74
+ - After creating each artifact, re-run `openspec status --change "<name>" --json`
75
+ - Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array
76
+ - Stop when all `applyRequires` artifacts are done
77
+
78
+ c. **If an artifact requires user input** (unclear context):
79
+ - Use **AskUserQuestion tool** to clarify
80
+ - Then continue with creation
81
+
82
+ 5. **Show final status**
83
+ ```bash
84
+ openspec status --change "<name>"
85
+ ```
86
+
87
+ **Output**
88
+
89
+ After completing all artifacts, summarize:
90
+ - Change name and location
91
+ - List of artifacts created with brief descriptions
92
+ - What's ready: "All artifacts created! Ready for implementation."
93
+ - Prompt: "Run `/opsx:apply` or ask me to implement to start working on the tasks."
94
+
95
+ **Artifact Creation Guidelines**
96
+
97
+ - Follow the `instruction` field from `openspec instructions` for each artifact type
98
+ - The schema defines what each artifact should contain - follow it
99
+ - Read dependency artifacts for context before creating new ones
100
+ - Use `template` as the structure for your output file - fill in its sections
101
+ - **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
102
+ - Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
103
+ - These guide what you write, but should never appear in the output
104
+
105
+ **Guardrails**
106
+ - Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`)
107
+ - Always read dependency artifacts before creating a new one
108
+ - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
109
+ - If a change with that name already exists, ask if user wants to continue it or create a new one
110
+ - Verify each artifact file exists after writing before proceeding to next
@@ -1,74 +1,110 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches: [main, master]
6
- pull_request:
7
- branches: [main, master]
8
-
9
- jobs:
10
- quality:
11
- name: Quality Gate
12
- runs-on: ubuntu-latest
13
-
14
- strategy:
15
- matrix:
16
- node-version: [18.x, 20.x]
17
-
18
- steps:
19
- - name: Checkout repository
20
- uses: actions/checkout@v4
21
-
22
- - name: Setup Node.js ${{ matrix.node-version }}
23
- uses: actions/setup-node@v4
24
- with:
25
- node-version: ${{ matrix.node-version }}
26
- cache: 'npm'
27
-
28
- - name: Install dependencies
29
- run: npm ci
30
-
31
- - name: Run linter
32
- run: npm run lint
33
-
34
- - name: Check formatting
35
- run: npm run format:check
36
-
37
- - name: Run type check
38
- run: npm run typecheck
39
-
40
- - name: Run tests with coverage
41
- run: npm run test:coverage
42
-
43
- - name: Upload coverage reports
44
- uses: codecov/codecov-action@v3
45
- if: matrix.node-version == '20.x'
46
- with:
47
- files: ./coverage/lcov.info
48
- fail_ci_if_error: false
49
-
50
- build:
51
- name: Build
52
- runs-on: ubuntu-latest
53
- needs: quality
54
-
55
- steps:
56
- - name: Checkout repository
57
- uses: actions/checkout@v4
58
-
59
- - name: Setup Node.js
60
- uses: actions/setup-node@v4
61
- with:
62
- node-version: 20.x
63
- cache: 'npm'
64
-
65
- - name: Install dependencies
66
- run: npm ci
67
-
68
- - name: Build project
69
- run: npm run build
70
-
71
- - name: Check build output
72
- run: |
73
- test -f dist/index.js
74
- test -f dist/server/mcp-server.js
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ pull_request:
7
+ branches: [main, master]
8
+
9
+ jobs:
10
+ quality:
11
+ name: Quality Gate
12
+ runs-on: ubuntu-latest
13
+
14
+ strategy:
15
+ matrix:
16
+ node-version: [20.x, 22.x]
17
+
18
+ steps:
19
+ - name: Checkout repository
20
+ uses: actions/checkout@v4
21
+
22
+ - name: Setup Node.js ${{ matrix.node-version }}
23
+ uses: actions/setup-node@v4
24
+ with:
25
+ node-version: ${{ matrix.node-version }}
26
+
27
+ - name: Setup pnpm
28
+ uses: pnpm/action-setup@v4
29
+ with:
30
+ version: 9
31
+
32
+ - name: Get pnpm store directory
33
+ shell: bash
34
+ run: |
35
+ echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
36
+ id: pnpm-cache
37
+
38
+ - name: Setup pnpm cache
39
+ uses: actions/cache@v4
40
+ with:
41
+ path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
42
+ key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
43
+ restore-keys: |
44
+ ${{ runner.os }}-pnpm-store-
45
+
46
+ - name: Install dependencies
47
+ run: pnpm install --frozen-lockfile
48
+
49
+ - name: Run linter
50
+ run: pnpm run lint
51
+
52
+ - name: Check formatting
53
+ run: pnpm run format:check
54
+
55
+ - name: Run type check
56
+ run: pnpm run typecheck
57
+
58
+ - name: Run tests with coverage
59
+ run: pnpm run test:coverage
60
+
61
+ - name: Upload coverage reports
62
+ uses: codecov/codecov-action@v3
63
+ if: matrix.node-version == '20.x'
64
+ with:
65
+ files: ./coverage/lcov.info
66
+ fail_ci_if_error: false
67
+
68
+ build:
69
+ name: Build
70
+ runs-on: ubuntu-latest
71
+ needs: quality
72
+
73
+ steps:
74
+ - name: Checkout repository
75
+ uses: actions/checkout@v4
76
+
77
+ - name: Setup Node.js
78
+ uses: actions/setup-node@v4
79
+ with:
80
+ node-version: 20.x
81
+
82
+ - name: Setup pnpm
83
+ uses: pnpm/action-setup@v4
84
+ with:
85
+ version: 9
86
+
87
+ - name: Get pnpm store directory
88
+ shell: bash
89
+ run: |
90
+ echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
91
+ id: pnpm-cache
92
+
93
+ - name: Setup pnpm cache
94
+ uses: actions/cache@v4
95
+ with:
96
+ path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
97
+ key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
98
+ restore-keys: |
99
+ ${{ runner.os }}-pnpm-store-
100
+
101
+ - name: Install dependencies
102
+ run: pnpm install --frozen-lockfile
103
+
104
+ - name: Build project
105
+ run: pnpm run build
106
+
107
+ - name: Check build output
108
+ run: |
109
+ test -f dist/src/index.js
110
+ test -f dist/src/server/mcp-server.js
@@ -0,0 +1,67 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ jobs:
9
+ quality:
10
+ name: Quality Gate
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - name: Checkout repository
15
+ uses: actions/checkout@v4
16
+
17
+ - name: Setup Node.js
18
+ uses: actions/setup-node@v4
19
+ with:
20
+ node-version: 20.x
21
+
22
+ - name: Setup pnpm
23
+ uses: pnpm/action-setup@v4
24
+ with:
25
+ version: 9
26
+
27
+ - name: Install dependencies
28
+ run: pnpm install --frozen-lockfile
29
+
30
+ - name: Run quality gate
31
+ run: pnpm run quality
32
+
33
+ publish:
34
+ name: Publish to npm
35
+ runs-on: ubuntu-latest
36
+ needs: quality
37
+
38
+ steps:
39
+ - name: Checkout repository
40
+ uses: actions/checkout@v4
41
+
42
+ - name: Setup Node.js
43
+ uses: actions/setup-node@v4
44
+ with:
45
+ node-version: 20.x
46
+ registry-url: 'https://registry.npmjs.org'
47
+
48
+ - name: Setup pnpm
49
+ uses: pnpm/action-setup@v4
50
+ with:
51
+ version: 9
52
+
53
+ - name: Install dependencies
54
+ run: pnpm install --frozen-lockfile
55
+
56
+ - name: Build
57
+ run: pnpm run build
58
+
59
+ - name: Publish to npm
60
+ run: pnpm publish --no-git-checks
61
+ env:
62
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
63
+
64
+ - name: Create GitHub Release
65
+ uses: softprops/action-gh-release@v1
66
+ with:
67
+ generate_release_notes: true