@refoldai/refold-js 10.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.
Files changed (53) hide show
  1. package/.claude/skills/method/SKILL.md +282 -0
  2. package/.claude/skills/review-pr/SKILL.md +80 -0
  3. package/.claude/skills/style/SKILL.md +67 -0
  4. package/.claude/skills/verify/SKILL.md +85 -0
  5. package/.github/pull_request_template.md +48 -0
  6. package/.github/workflows/npm-publish.yml +35 -0
  7. package/.github/workflows/pr-validation.yml +224 -0
  8. package/CLAUDE.md +127 -0
  9. package/LICENSE +21 -0
  10. package/README.md +63 -0
  11. package/docs/.nojekyll +1 -0
  12. package/docs/assets/hierarchy.js +1 -0
  13. package/docs/assets/highlight.css +113 -0
  14. package/docs/assets/icons.js +18 -0
  15. package/docs/assets/icons.svg +1 -0
  16. package/docs/assets/main.js +60 -0
  17. package/docs/assets/navigation.js +1 -0
  18. package/docs/assets/search.js +1 -0
  19. package/docs/assets/style.css +1633 -0
  20. package/docs/classes/Refold.html +123 -0
  21. package/docs/enums/AuthStatus.html +3 -0
  22. package/docs/enums/AuthType.html +4 -0
  23. package/docs/hierarchy.html +1 -0
  24. package/docs/index.html +36 -0
  25. package/docs/interfaces/Application.html +37 -0
  26. package/docs/interfaces/Config.html +6 -0
  27. package/docs/interfaces/ConfigField.html +17 -0
  28. package/docs/interfaces/ConfigPayload.html +8 -0
  29. package/docs/interfaces/ConfigWorkflow.html +6 -0
  30. package/docs/interfaces/ExecuteWorkflowPayload.html +9 -0
  31. package/docs/interfaces/Execution.html +19 -0
  32. package/docs/interfaces/ExecutionFilters.html +16 -0
  33. package/docs/interfaces/GetExecutionsParams.html +19 -0
  34. package/docs/interfaces/InputField.html +18 -0
  35. package/docs/interfaces/Label.html +6 -0
  36. package/docs/interfaces/PublicWorkflow.html +16 -0
  37. package/docs/interfaces/PublicWorkflowPayload.html +8 -0
  38. package/docs/interfaces/PublicWorkflowsPayload.html +15 -0
  39. package/docs/interfaces/RefoldOptions.html +5 -0
  40. package/docs/interfaces/RuleOptions.html +4 -0
  41. package/docs/interfaces/UpdateConfigPayload.html +10 -0
  42. package/docs/interfaces/WorkflowPayload.html +8 -0
  43. package/docs/interfaces/WorkflowPayloadResponse.html +4 -0
  44. package/docs/llms.txt +986 -0
  45. package/docs/modules.html +1 -0
  46. package/docs/types/ExecutionSource.html +2 -0
  47. package/docs/types/ExecutionStatus.html +2 -0
  48. package/docs/types/ExecutionType.html +2 -0
  49. package/package.json +38 -0
  50. package/refold.d.ts +556 -0
  51. package/refold.js +667 -0
  52. package/refold.ts +1044 -0
  53. package/tsconfig.json +12 -0
@@ -0,0 +1,282 @@
1
+ ---
2
+ name: method
3
+ description: Add a new public API method to the Refold SDK with types, JSDoc, and endpoint mapping. Use when adding new SDK functionality.
4
+ metadata:
5
+ author: iamtraction
6
+ version: "1.0.0"
7
+ argument-hint: <method-name>
8
+ ---
9
+
10
+ # Add SDK Method
11
+
12
+ Add a new public API method to the Refold class with TypeScript types, JSDoc documentation, and backend endpoint mapping.
13
+
14
+ ## Usage
15
+
16
+ The user provides a method name (e.g., "getWorkflows", "createConfig") and describes the backend endpoint it maps to.
17
+
18
+ ## Steps
19
+
20
+ 1. **Ask for details** if not provided: method name, HTTP method, endpoint URL, request payload shape, response shape, whether it supports pagination
21
+ 2. **Define TypeScript interfaces** — request payload and response types
22
+ 3. **Add JSDoc-documented method** to the `Refold` class
23
+ 4. **Build** to verify compilation
24
+
25
+ ## Implementation Order
26
+
27
+ 1. **Interfaces** — Define request/response types (before the class)
28
+ 2. **Method** — Add to `Refold` class with JSDoc
29
+ 3. **Build** — Run `npm run build` to generate `.js` and `.d.ts`
30
+
31
+ ## Interface Template
32
+
33
+ ```ts
34
+ // Add before the Refold class in refold.ts
35
+
36
+ /** The payload for creating a resource. */
37
+ export interface CreateResourcePayload {
38
+ /** The resource name. */
39
+ name: string;
40
+ /** Optional description. */
41
+ description?: string;
42
+ /** Configuration object. */
43
+ config?: Record<string, unknown>;
44
+ }
45
+
46
+ /** A resource object. */
47
+ export interface Resource {
48
+ /** The resource ID. */
49
+ _id: string;
50
+ /** The resource name. */
51
+ name: string;
52
+ /** The resource description. */
53
+ description?: string;
54
+ /** When the resource was created. */
55
+ createdAt: string;
56
+ /** When the resource was last updated. */
57
+ updatedAt: string;
58
+ }
59
+ ```
60
+
61
+ ## Method Templates
62
+
63
+ ### GET Request (single item)
64
+
65
+ ```ts
66
+ /**
67
+ * Returns the resource details for the specified resource ID.
68
+ * @param {String} id The resource ID.
69
+ * @returns {Promise<Resource>} The resource details.
70
+ */
71
+ public async getResource(id: string): Promise<Resource> {
72
+ const res = await fetch(`${this.baseUrl}/api/v2/f-sdk/resource/${id}`, {
73
+ headers: {
74
+ authorization: `Bearer ${this.token}`,
75
+ },
76
+ });
77
+
78
+ if (res.status >= 400 && res.status < 600) {
79
+ const error = await res.json();
80
+ throw error;
81
+ }
82
+
83
+ return await res.json();
84
+ }
85
+ ```
86
+
87
+ ### GET Request (list with optional overloads)
88
+
89
+ ```ts
90
+ /**
91
+ * Returns the list of all resources.
92
+ * @returns {Promise<Resource[]>} The list of resources.
93
+ */
94
+ public async getResources(): Promise<Resource[]>;
95
+ /**
96
+ * Returns the resource details for the specified slug.
97
+ * @param {String} slug The resource slug.
98
+ * @returns {Promise<Resource>} The resource details.
99
+ */
100
+ public async getResources(slug: string): Promise<Resource>;
101
+ public async getResources(slug?: string): Promise<Resource | Resource[]> {
102
+ const res = await fetch(`${this.baseUrl}/api/v2/f-sdk/resource${slug ? `/${slug}` : ""}`, {
103
+ headers: {
104
+ authorization: `Bearer ${this.token}`,
105
+ },
106
+ });
107
+
108
+ if (res.status >= 400 && res.status < 600) {
109
+ const error = await res.json();
110
+ throw error;
111
+ }
112
+
113
+ return await res.json();
114
+ }
115
+ ```
116
+
117
+ ### POST Request (with JSON body)
118
+
119
+ ```ts
120
+ /**
121
+ * Creates a new resource with the specified configuration.
122
+ * @param {CreateResourcePayload} payload The resource configuration.
123
+ * @returns {Promise<Resource>} The created resource.
124
+ */
125
+ public async createResource(payload: CreateResourcePayload): Promise<Resource> {
126
+ const res = await fetch(`${this.baseUrl}/api/v2/f-sdk/resource`, {
127
+ method: "POST",
128
+ headers: {
129
+ authorization: `Bearer ${this.token}`,
130
+ "content-type": "application/json",
131
+ },
132
+ body: JSON.stringify(payload),
133
+ });
134
+
135
+ if (res.status >= 400 && res.status < 600) {
136
+ const error = await res.json();
137
+ throw error;
138
+ }
139
+
140
+ return await res.json();
141
+ }
142
+ ```
143
+
144
+ ### PUT Request (update)
145
+
146
+ ```ts
147
+ /**
148
+ * Updates an existing resource.
149
+ * @param {String} id The resource ID.
150
+ * @param {Partial<CreateResourcePayload>} payload The fields to update.
151
+ * @returns {Promise<Resource>} The updated resource.
152
+ */
153
+ public async updateResource(id: string, payload: Partial<CreateResourcePayload>): Promise<Resource> {
154
+ const res = await fetch(`${this.baseUrl}/api/v2/f-sdk/resource/${id}`, {
155
+ method: "PUT",
156
+ headers: {
157
+ authorization: `Bearer ${this.token}`,
158
+ "content-type": "application/json",
159
+ },
160
+ body: JSON.stringify(payload),
161
+ });
162
+
163
+ if (res.status >= 400 && res.status < 600) {
164
+ const error = await res.json();
165
+ throw error;
166
+ }
167
+
168
+ return await res.json();
169
+ }
170
+ ```
171
+
172
+ ### DELETE Request
173
+
174
+ ```ts
175
+ /**
176
+ * Deletes the specified resource.
177
+ * @param {String} id The resource ID.
178
+ * @returns {Promise<unknown>} The deletion result.
179
+ */
180
+ public async deleteResource(id: string): Promise<unknown> {
181
+ const res = await fetch(`${this.baseUrl}/api/v2/f-sdk/resource/${id}`, {
182
+ method: "DELETE",
183
+ headers: {
184
+ authorization: `Bearer ${this.token}`,
185
+ },
186
+ });
187
+
188
+ if (res.status >= 400 && res.status < 600) {
189
+ const error = await res.json();
190
+ throw error;
191
+ }
192
+
193
+ return await res.json();
194
+ }
195
+ ```
196
+
197
+ ### Paginated GET Request
198
+
199
+ ```ts
200
+ /**
201
+ * Returns a paginated list of resources.
202
+ * @param {Object} [params] Pagination parameters.
203
+ * @param {Number} [params.page] The page number.
204
+ * @param {Number} [params.limit] The number of items per page.
205
+ * @returns {Promise<PaginatedResponse<Resource>>} The paginated list.
206
+ */
207
+ public async listResources(params?: { page?: number; limit?: number }): Promise<PaginatedResponse<Resource>> {
208
+ const query = new URLSearchParams();
209
+ if (params?.page) query.set("page", String(params.page));
210
+ if (params?.limit) query.set("limit", String(params.limit));
211
+
212
+ const res = await fetch(`${this.baseUrl}/api/v2/f-sdk/resources?${query}`, {
213
+ headers: {
214
+ authorization: `Bearer ${this.token}`,
215
+ },
216
+ });
217
+
218
+ if (res.status >= 400 && res.status < 600) {
219
+ const error = await res.json();
220
+ throw error;
221
+ }
222
+
223
+ return await res.json();
224
+ }
225
+ ```
226
+
227
+ ## Existing Patterns Reference
228
+
229
+ ### Error Handling Pattern (used by ALL methods)
230
+ ```ts
231
+ if (res.status >= 400 && res.status < 600) {
232
+ const error = await res.json();
233
+ throw error;
234
+ }
235
+ ```
236
+
237
+ ### Auth Header (used by ALL methods)
238
+ ```ts
239
+ headers: {
240
+ authorization: `Bearer ${this.token}`,
241
+ }
242
+ ```
243
+
244
+ ### Custom Headers (some methods pass app slug)
245
+ ```ts
246
+ headers: {
247
+ authorization: `Bearer ${this.token}`,
248
+ "content-type": "application/json",
249
+ slug, // Custom header for app context
250
+ }
251
+ ```
252
+
253
+ ### PaginatedResponse Generic
254
+ ```ts
255
+ interface PaginatedResponse<T> {
256
+ docs: T[];
257
+ totalDocs: number;
258
+ limit: number;
259
+ totalPages: number;
260
+ page: number;
261
+ }
262
+ ```
263
+
264
+ ## Verification
265
+
266
+ ```bash
267
+ npm run build # Compile to refold.js + refold.d.ts
268
+ npm run docs:llms # Generate TypeDoc (optional)
269
+ ```
270
+
271
+ ## Important
272
+
273
+ - **Zero dependencies** — only use native `fetch`, no external HTTP libraries
274
+ - **JSDoc on every method** — TypeDoc generates SDK documentation from these
275
+ - **JSDoc on every interface field** — include description for each property
276
+ - **Method overloads** — use TypeScript overloads for methods with optional parameters that change return type
277
+ - **Error handling** — always check `res.status >= 400 && res.status < 600` and throw the parsed error
278
+ - **`Bearer` auth** — all methods include `authorization: Bearer ${this.token}`
279
+ - **Single file** — everything goes in `refold.ts`, no separate files
280
+ - **Export interfaces** — all types are exported for consumer use
281
+ - **Backward compatibility** — never rename or remove existing methods, use `@deprecated` JSDoc tag
282
+ - **Build output** — `refold.js` (CommonJS) + `refold.d.ts` (type declarations)
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: review-pr
3
+ description: Review a pull request for code quality, patterns consistency, and potential issues. Use when asked to review a PR by number or URL.
4
+ metadata:
5
+ author: iamtraction
6
+ version: "1.0.0"
7
+ argument-hint: <pr-number-or-url>
8
+ ---
9
+
10
+ # Review Pull Request
11
+
12
+ Perform a thorough code review of a GitHub pull request.
13
+
14
+ ## Usage
15
+
16
+ The user provides a PR number or URL (e.g., `123`, `https://github.com/gocobalt/refold-js/pull/123`).
17
+
18
+ ## Steps
19
+
20
+ 1. **Fetch PR details** using `gh pr view {number} --json title,body,files,additions,deletions,baseRefName,headRefName`
21
+ 2. **Fetch the diff** using `gh pr diff {number}`
22
+ 3. **Analyze every changed file** against the checklist below
23
+ 4. **Output a structured review** with findings grouped by severity
24
+
25
+ ## Review Checklist
26
+
27
+ ### SDK Design
28
+ - Zero runtime dependencies maintained — no new `dependencies` added to package.json
29
+ - Public API backward compatible — no breaking changes without major version bump
30
+ - Deprecated methods/fields marked with `@deprecated` JSDoc, not removed
31
+ - New public methods have JSDoc with `@param` and `@returns`
32
+ - New interfaces/types exported correctly
33
+ - Error handling follows existing pattern: throw parsed JSON for 4xx/5xx responses
34
+ - Native `fetch` API used — no axios, node-fetch, or other HTTP libraries
35
+ - OAuth popup flow: no changes that break `window.open()` + polling pattern
36
+
37
+ ### Code Quality
38
+ - TypeScript strict mode passes — no `any` types unless truly unavoidable
39
+ - All public methods have explicit return types
40
+ - No unused imports or dead code
41
+ - No hardcoded URLs — base URL comes from constructor option
42
+ - Bearer token attached to all requests via `Authorization` header
43
+ - Pagination support: `page`/`limit` parameters where applicable
44
+
45
+ ### Backward Compatibility
46
+ - Existing method signatures unchanged (or new optional params added at the end)
47
+ - Existing interfaces only extended, never fields removed
48
+ - `connected` and `auth_type` fields preserved (deprecated, not removed)
49
+ - AuthType enum values unchanged
50
+
51
+ ### Security
52
+ - No secrets or tokens in code
53
+ - No `eval()`, `Function()`, or dynamic code execution
54
+ - Token not logged or exposed in error messages
55
+
56
+ ### Naming & Style
57
+ - 4 spaces indentation, double quotes, semicolons
58
+ - camelCase for methods/variables, PascalCase for interfaces/types/enums
59
+ - Method names follow existing patterns: `get*`, `create*`, `update*`, `delete*`, `execute*`
60
+
61
+ ## Output Format
62
+
63
+ ```
64
+ ## PR Review: #{number} — {title}
65
+
66
+ ### Summary
67
+ Brief description of what the PR does.
68
+
69
+ ### Critical Issues
70
+ - **[file:line]** Description of critical issue
71
+
72
+ ### Suggestions
73
+ - **[file:line]** Description of improvement suggestion
74
+
75
+ ### Nits
76
+ - **[file:line]** Minor style/preference issue
77
+
78
+ ### Positive Notes
79
+ - Things done well worth calling out
80
+ ```
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: style
3
+ description: Code style and formatting conventions for this codebase. Reference this when writing or reviewing code to ensure consistency.
4
+ metadata:
5
+ author: iamtraction
6
+ version: "1.0.0"
7
+ user-invocable: false
8
+ ---
9
+
10
+ # Code Style Guide
11
+
12
+ These conventions apply to all code written in this codebase. Follow them when creating, modifying, or reviewing code.
13
+
14
+ ## Formatting
15
+
16
+ - **Indentation:** 4 spaces — never tabs
17
+ - **Quotes:** Double quotes for strings
18
+ - **Semicolons:** Always
19
+ - **Line endings:** Unix (LF)
20
+ - **Trailing commas:** Use trailing commas in multiline arrays, objects, function parameters, and imports
21
+ - **Blank lines:** One blank line between top-level declarations (imports, interfaces, functions, exports). No multiple consecutive blank lines.
22
+ - **Braces:** Opening brace on the same line (`if (...) {`), closing brace on its own line
23
+ - **Bracket spacing:** Spaces inside object braces — `{ key: value }`, not `{key: value}`
24
+ - **Template literals:** Prefer template literals over string concatenation
25
+
26
+ ## Naming
27
+
28
+ - **Functions/variables:** camelCase — `getApp`, `executeWorkflow`, `configId`
29
+ - **Constants:** SCREAMING_SNAKE_CASE for true constants
30
+ - **Interfaces/Types:** PascalCase, no `I` prefix — `Application`, `Config`, `Execution`
31
+ - **Enums:** PascalCase name, PascalCase members — `AuthType.OAuth2`, `AuthStatus.Active`
32
+ - **Booleans:** Prefix with `is`, `has`, `can`, `should` — `isConnected`, `hasToken`
33
+
34
+ ## TypeScript
35
+
36
+ - **Strict typing:** Avoid `any` — use `unknown` when the type is genuinely unknown, then narrow
37
+ - **Interfaces over types:** Prefer `interface` for object shapes, `type` for unions, intersections, and utility types
38
+ - **Explicit return types:** Add them for all public methods — this is a published SDK, types are the API contract
39
+ - **Non-null assertions:** Avoid `!` — prefer optional chaining (`?.`) and nullish coalescing (`??`)
40
+
41
+ ## SDK-Specific Conventions
42
+
43
+ - **Zero dependencies:** This SDK has no runtime dependencies. Do not add any. Use native `fetch` API.
44
+ - **Single class:** All public API lives on the `Refold` class. Keep it that way.
45
+ - **Backward compatibility:** Mark deprecated fields/methods with `@deprecated` JSDoc tag — never remove them without a major version bump
46
+ - **Error propagation:** Throw parsed JSON error responses for 4xx/5xx — don't catch and transform in the SDK. Let consumers handle errors.
47
+ - **JSDoc on all public methods:** Every public method must have a JSDoc block with `@param` and `@returns` tags. This generates the TypeDoc documentation.
48
+
49
+ ## Functions
50
+
51
+ - **Method style:** Use class methods for the `Refold` class
52
+ - **Private methods:** Mark with `private` keyword — `private oauth(...)`, `private keybased(...)`
53
+ - **Async/await:** All API calls are async — use `async`/`await`, never raw `.then()` chains in new code
54
+ - **Early returns:** Prefer early returns to reduce nesting
55
+
56
+ ## Error Handling
57
+
58
+ - **Fetch errors:** Check `res.status >= 400 && res.status < 600`, parse JSON, throw it
59
+ - **No try/catch in SDK methods** — let errors propagate to the consumer
60
+ - **OAuth polling:** Catch errors in the polling interval and log to console — don't reject the promise on transient failures
61
+
62
+ ## Comments
63
+
64
+ - **JSDoc for all public API** — every exported method, interface, enum, and type
65
+ - **No obvious comments** — don't describe what the code does when it's self-evident
66
+ - **Why, not what** — comment the reasoning, not the mechanics
67
+ - **No commented-out code** — delete it; git has history
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: verify
3
+ description: Verify code quality, catch bugs, and validate implementation against codebase patterns. Use for testing, linting, type-checking, and manual review.
4
+ metadata:
5
+ author: iamtraction
6
+ version: "1.0.0"
7
+ argument-hint: <file-path-or-feature>
8
+ ---
9
+
10
+ # Verify & Test
11
+
12
+ Perform comprehensive verification of code changes.
13
+
14
+ ## Usage
15
+
16
+ The user provides a file path, feature name, or asks to verify recent changes. If no argument, verify all uncommitted changes.
17
+
18
+ ## Verification Steps
19
+
20
+ ### 1. Static Analysis
21
+ Run these checks and report results:
22
+ ```bash
23
+ npm run build # TypeScript compilation → refold.js + refold.d.ts
24
+ ```
25
+
26
+ ### 2. Type Safety Review
27
+ - Check for `any` types that should be properly typed
28
+ - Verify all public methods have explicit return types
29
+ - Ensure interface fields match the backend API responses
30
+ - Verify generic type parameters on Promise return types
31
+ - Check that deprecated fields are still present with `@deprecated` JSDoc
32
+
33
+ ### 3. SDK Design Compliance
34
+ Verify the code follows SDK conventions:
35
+ - **Zero dependencies**: No runtime dependencies added
36
+ - **Native fetch**: No HTTP libraries — uses `fetch` API only
37
+ - **Single class**: All public API on the `Refold` class
38
+ - **Error handling**: 4xx/5xx → parse JSON → throw (no swallowing errors)
39
+ - **JSDoc on all public methods**: `@param`, `@returns` tags
40
+ - **Backward compatibility**: No removed methods/fields, no changed signatures
41
+
42
+ ### 4. Runtime Safety Review
43
+ Check for common issues:
44
+ - **Missing error checks** — `res.status >= 400` not checked after fetch
45
+ - **OAuth polling** — `setInterval` properly cleaned up with `clearInterval`
46
+ - **Popup handling** — `window.open` result checked for null (popup blocked)
47
+ - **Token usage** — `this.token` attached to all requests
48
+ - **Base URL** — uses `this.baseUrl`, no hardcoded URLs
49
+
50
+ ### 5. Backward Compatibility Check
51
+ - Existing method signatures unchanged
52
+ - Existing interfaces only extended (no field removal)
53
+ - Enum values unchanged
54
+ - `getApp()` overload still works for both single and all apps
55
+
56
+ ## Output Format
57
+
58
+ ```
59
+ ## Verification Report
60
+
61
+ ### Build: PASS/FAIL
62
+ Details...
63
+
64
+ ### Type Safety: X issues found
65
+ - [file:line] Description
66
+
67
+ ### SDK Design: X issues found
68
+ - [file:line] Description
69
+
70
+ ### Runtime Safety: X issues found
71
+ - [file:line] Description
72
+
73
+ ### Backward Compatibility: X issues found
74
+ - [file:line] Description
75
+
76
+ ### Overall: PASS / NEEDS FIXES
77
+ Summary and recommended actions.
78
+ ```
79
+
80
+ ## Important
81
+
82
+ - Always run `npm run build` — don't skip compilation check
83
+ - Verify both `refold.js` and `refold.d.ts` are generated correctly
84
+ - Be specific about issues — include file paths and line numbers
85
+ - Breaking changes require major version bump — flag them as critical
@@ -0,0 +1,48 @@
1
+ <!--
2
+ Paste your Linear ticket ID anywhere in this PR.
3
+ Valid formats: DEV-123, closes DEV-123, resolves DEV-456, fixes AIA-789
4
+ -->
5
+ DEV-
6
+
7
+ ### Summary
8
+ <!-- Required. What does this PR do and why? Be specific — mention what changed and the reason for the change. -->
9
+
10
+ ### Approach
11
+ <!--
12
+ Optional — include for new features or large changes.
13
+ - What approach did you take and why?
14
+ - What alternatives did you consider and why were they rejected?
15
+ -->
16
+
17
+ ### Test Plan
18
+ <!--
19
+ Required. Steps for testing these changes — what to do and what to verify.
20
+ At least one checkbox is required.
21
+ -->
22
+
23
+ - [ ]
24
+
25
+ ### Claude Code
26
+ <!--
27
+ If this PR was built with Claude Code, check all that apply.
28
+ Delete this section entirely for PRs not written with Claude Code.
29
+ -->
30
+
31
+ - [ ] Used `superpowers:brainstorming` before starting implementation
32
+ - [ ] Plan file added to `docs/superpowers/plans/`
33
+
34
+ ### Env Changes
35
+ <!--
36
+ Include ONLY if this PR adds, removes, or modifies environment variables.
37
+ Delete this section entirely if there are no env var changes.
38
+
39
+ Format:
40
+ - name: VAR_NAME
41
+ action: add | remove | update
42
+ type: configmap | secret
43
+ value: "example_value" # omit for secrets
44
+ description: What this var does and where it's used
45
+ -->
46
+
47
+ ```yaml
48
+ ```
@@ -0,0 +1,35 @@
1
+ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
+ # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3
+
4
+ name: Node.js Package
5
+
6
+ on:
7
+ release:
8
+ types: [created]
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v6
15
+ - uses: actions/setup-node@v6
16
+ with:
17
+ node-version: 24
18
+ - run: |
19
+ echo 'NPM Token ${secrets.NPM_TOKEN}'
20
+ npm ci
21
+ npm test
22
+
23
+ publish-npm:
24
+ needs: build
25
+ runs-on: ubuntu-latest
26
+ steps:
27
+ - uses: actions/checkout@v6
28
+ - uses: actions/setup-node@v6
29
+ with:
30
+ node-version: 24
31
+ registry-url: https://registry.npmjs.org/
32
+ - run: npm ci
33
+ - run: npm publish
34
+ env:
35
+ NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}