From 6aa356723233b23f3c31abf2865c689b2442fd57 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Oct 2025 19:13:37 +0000 Subject: [PATCH 1/9] Initial plan From 15b22c4a48412bb5672f412e6a864107f6a75ee0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Oct 2025 19:17:46 +0000 Subject: [PATCH 2/9] Initial plan for OIDC NPM publishing update Co-authored-by: alexasselin008 <38871812+alexasselin008@users.noreply.github.com> --- packages/create-schemas/bin/create-schemas.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 packages/create-schemas/bin/create-schemas.js diff --git a/packages/create-schemas/bin/create-schemas.js b/packages/create-schemas/bin/create-schemas.js old mode 100644 new mode 100755 From 1fb753262ed783b3b03cca5bdab1778f35d60990 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Oct 2025 19:21:00 +0000 Subject: [PATCH 3/9] Update NPM publishing to use OIDC with Node 24 and pnpm 10.19 Co-authored-by: alexasselin008 <38871812+alexasselin008@users.noreply.github.com> --- .changeset/update-npm-oidc.md | 5 +++++ .github/actions/setup/action.yml | 1 - .github/workflows/publish.yml | 3 ++- .npmrc | 2 ++ .nvmrc | 2 +- package.json | 5 +++-- 6 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 .changeset/update-npm-oidc.md create mode 100644 .npmrc diff --git a/.changeset/update-npm-oidc.md b/.changeset/update-npm-oidc.md new file mode 100644 index 0000000..19af086 --- /dev/null +++ b/.changeset/update-npm-oidc.md @@ -0,0 +1,5 @@ +--- +"@workleap/create-schemas": patch +--- + +Update NPM publishing to use OIDC authentication diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 13931d0..42292b2 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -9,7 +9,6 @@ runs: - name: Install pnpm uses: pnpm/action-setup@v4 with: - version: 9 run_install: false - name: Install Node.js diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b3b3046..e4145b7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -30,7 +30,8 @@ jobs: publish: pnpm run changeset:publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.WORKLEAP_NPM_TOKEN }} + NPM_CONFIG_PROVENANCE: true + NODE_AUTH_TOKEN: ${{ secrets.WORKLEAP_NPM_TOKEN }} linearb: needs: [release] diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..661d3aa --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +minimumReleaseAge=1440 +minimumReleaseAgeExclude[]=@workleap* diff --git a/.nvmrc b/.nvmrc index b009dfb..a45fd52 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -lts/* +24 diff --git a/package.json b/package.json index 2a81d1c..ed3f31f 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "typescript": "5.5.3" }, "engines": { - "node": ">=18.0.0" - } + "node": ">=24.0.0" + }, + "packageManager": "pnpm@10.19.0" } \ No newline at end of file From b813313c614a94062d2e32f11aadbc6f507d1ab1 Mon Sep 17 00:00:00 2001 From: Alexandre Asselin Date: Wed, 22 Oct 2025 15:43:01 -0400 Subject: [PATCH 4/9] Apply suggestion from @alexasselin008 --- .github/workflows/publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e4145b7..5c66a66 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -30,7 +30,6 @@ jobs: publish: pnpm run changeset:publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_CONFIG_PROVENANCE: true NODE_AUTH_TOKEN: ${{ secrets.WORKLEAP_NPM_TOKEN }} linearb: From bbd0ec8f6982b3bc92f31d3b32c9fedc8312b960 Mon Sep 17 00:00:00 2001 From: Alexandre Asselin Date: Wed, 22 Oct 2025 15:43:16 -0400 Subject: [PATCH 5/9] Update .npmrc --- .npmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.npmrc b/.npmrc index 661d3aa..de038bd 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1,2 @@ minimumReleaseAge=1440 -minimumReleaseAgeExclude[]=@workleap* +minimum-release-age-exclude[]="@workleap*" From b99872d08701185b70f45a076d6fb7c3ea0c4fff Mon Sep 17 00:00:00 2001 From: Alexandre Asselin Date: Wed, 22 Oct 2025 15:43:26 -0400 Subject: [PATCH 6/9] Update .github/workflows/publish.yml --- .github/workflows/publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5c66a66..ba73cae 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -30,7 +30,6 @@ jobs: publish: pnpm run changeset:publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NODE_AUTH_TOKEN: ${{ secrets.WORKLEAP_NPM_TOKEN }} linearb: needs: [release] From fa34c72d982161ea98a3d0e358188907c0604454 Mon Sep 17 00:00:00 2001 From: Alexandre Asselin Date: Wed, 22 Oct 2025 15:43:33 -0400 Subject: [PATCH 7/9] Update .npmrc --- .npmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.npmrc b/.npmrc index de038bd..08c7678 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1,2 @@ -minimumReleaseAge=1440 +minimum-release-age=1440 minimum-release-age-exclude[]="@workleap*" From c2ad63c06a4e71b264a8d134e255362b6b23c3d8 Mon Sep 17 00:00:00 2001 From: Alexandre Asselin Date: Wed, 22 Oct 2025 15:44:32 -0400 Subject: [PATCH 8/9] Update package.json --- packages/create-schemas/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/create-schemas/package.json b/packages/create-schemas/package.json index ea14031..9e59328 100644 --- a/packages/create-schemas/package.json +++ b/packages/create-schemas/package.json @@ -47,7 +47,7 @@ "vitest": "1.6.0" }, "engines": { - "node": ">=18.0.0" + "node": ">=24.0.0" }, "dependencies": { "c12": "1.11.1", @@ -58,4 +58,4 @@ "typescript": "5.5.3", "zod": "3.23.8" } -} \ No newline at end of file +} From 42fee9e2c59d97f319de2ba4ed82f7955ff597f8 Mon Sep 17 00:00:00 2001 From: Alexandre Asselin Date: Wed, 22 Oct 2025 16:12:34 -0400 Subject: [PATCH 9/9] add update snapshot command --- package.json | 3 +- packages/create-schemas/package.json | 1 + .../tests/__snapshots__/e2e.test.ts.snap | 333 ++++++++++++++---- 3 files changed, 267 insertions(+), 70 deletions(-) diff --git a/package.json b/package.json index ed3f31f..e4767f0 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "postinstall": "pnpm -r --parallel --include-workspace-root exec pnpm dlx rimraf node_modules/.cache", "dev": "pnpm --filter \"./packages/**\" -r dev", "test": "pnpm --filter \"./packages/**\" -r test", + "test-update": "pnpm --filter \"./packages/**\" -r test-update", "build": "pnpm --filter \"./packages/**\" -r build", "lint": "pnpm run \"/^lint:.*/\"", "lint:eslint": "eslint --ext .js,.ts,.tsx . --max-warnings=-1 --cache --cache-location node_modules/.cache/eslint", @@ -36,4 +37,4 @@ "node": ">=24.0.0" }, "packageManager": "pnpm@10.19.0" -} \ No newline at end of file +} diff --git a/packages/create-schemas/package.json b/packages/create-schemas/package.json index 9e59328..5033501 100644 --- a/packages/create-schemas/package.json +++ b/packages/create-schemas/package.json @@ -34,6 +34,7 @@ "scripts": { "dev": "tsup --config tsup.dev.ts", "test": "vitest", + "test-update": "vitest -- update-snapshots", "build": "tsup --config tsup.build.ts" }, "devDependencies": { diff --git a/packages/create-schemas/tests/__snapshots__/e2e.test.ts.snap b/packages/create-schemas/tests/__snapshots__/e2e.test.ts.snap index 2fa6da9..03b092a 100644 --- a/packages/create-schemas/tests/__snapshots__/e2e.test.ts.snap +++ b/packages/create-schemas/tests/__snapshots__/e2e.test.ts.snap @@ -267,13 +267,13 @@ export interface paths { }; get?: never; /** - * Update an existing pet - * @description Update an existing pet by Id + * Update an existing pet. + * @description Update an existing pet by Id. */ put: operations["updatePet"]; /** - * Add a new pet to the store - * @description Add a new pet to the store + * Add a new pet to the store. + * @description Add a new pet to the store. */ post: operations["addPet"]; delete?: never; @@ -290,8 +290,8 @@ export interface paths { cookie?: never; }; /** - * Finds Pets by status - * @description Multiple status values can be provided with comma separated strings + * Finds Pets by status. + * @description Multiple status values can be provided with comma separated strings. */ get: operations["findPetsByStatus"]; put?: never; @@ -310,7 +310,7 @@ export interface paths { cookie?: never; }; /** - * Finds Pets by tags + * Finds Pets by tags. * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. */ get: operations["findPetsByTags"]; @@ -330,14 +330,20 @@ export interface paths { cookie?: never; }; /** - * Find pet by ID - * @description Returns a single pet + * Find pet by ID. + * @description Returns a single pet. */ get: operations["getPetById"]; put?: never; - /** Updates a pet in the store with form data */ + /** + * Updates a pet in the store with form data. + * @description Updates a pet resource based on the form data. + */ post: operations["updatePetWithForm"]; - /** Deletes a pet */ + /** + * Deletes a pet. + * @description Delete a pet. + */ delete: operations["deletePet"]; options?: never; head?: never; @@ -353,7 +359,10 @@ export interface paths { }; get?: never; put?: never; - /** uploads an image */ + /** + * Uploads an image. + * @description Upload image of the pet. + */ post: operations["uploadFile"]; delete?: never; options?: never; @@ -369,8 +378,8 @@ export interface paths { cookie?: never; }; /** - * Returns pet inventories by status - * @description Returns a map of status codes to quantities + * Returns pet inventories by status. + * @description Returns a map of status codes to quantities. */ get: operations["getInventory"]; put?: never; @@ -391,8 +400,8 @@ export interface paths { get?: never; put?: never; /** - * Place an order for a pet - * @description Place a new order in the store + * Place an order for a pet. + * @description Place a new order in the store. */ post: operations["placeOrder"]; delete?: never; @@ -409,15 +418,15 @@ export interface paths { cookie?: never; }; /** - * Find purchase order by ID + * Find purchase order by ID. * @description For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. */ get: operations["getOrderById"]; put?: never; post?: never; /** - * Delete purchase order by ID - * @description For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by identifier. + * @description For valid response try integer IDs with value < 1000. Anything above 1000 or non-integers will generate API errors. */ delete: operations["deleteOrder"]; options?: never; @@ -435,7 +444,7 @@ export interface paths { get?: never; put?: never; /** - * Create user + * Create user. * @description This can only be done by the logged in user. */ post: operations["createUser"]; @@ -455,8 +464,8 @@ export interface paths { get?: never; put?: never; /** - * Creates list of users with given input array - * @description Creates list of users with given input array + * Creates list of users with given input array. + * @description Creates list of users with given input array. */ post: operations["createUsersWithListInput"]; delete?: never; @@ -472,7 +481,10 @@ export interface paths { path?: never; cookie?: never; }; - /** Logs user into the system */ + /** + * Logs user into the system. + * @description Log into the system. + */ get: operations["loginUser"]; put?: never; post?: never; @@ -489,7 +501,10 @@ export interface paths { path?: never; cookie?: never; }; - /** Logs out current logged in user session */ + /** + * Logs out current logged in user session. + * @description Log user out of the system. + */ get: operations["logoutUser"]; put?: never; post?: never; @@ -506,16 +521,19 @@ export interface paths { path?: never; cookie?: never; }; - /** Get user by user name */ + /** + * Get user by user name. + * @description Get user detail based on username. + */ get: operations["getUserByName"]; /** - * Update user + * Update user resource. * @description This can only be done by the logged in user. */ put: operations["updateUser"]; post?: never; /** - * Delete user + * Delete user resource. * @description This can only be done by the logged in user. */ delete: operations["deleteUser"]; @@ -554,26 +572,6 @@ export interface components { status?: "placed" | "approved" | "delivered"; complete?: boolean; }; - Customer: { - /** - * Format: int64 - * @example 100000 - */ - id?: number; - /** @example fehguy */ - username?: string; - address?: components["schemas"]["Address"][]; - }; - Address: { - /** @example 437 Lytton */ - street?: string; - /** @example Palo Alto */ - city?: string; - /** @example CA */ - state?: string; - /** @example 94301 */ - zip?: string; - }; Category: { /** * Format: int64 @@ -681,8 +679,8 @@ export interface operations { [name: string]: unknown; }; content: { - "application/xml": components["schemas"]["Pet"]; "application/json": components["schemas"]["Pet"]; + "application/xml": components["schemas"]["Pet"]; }; }; /** @description Invalid ID supplied */ @@ -700,7 +698,14 @@ export interface operations { content?: never; }; /** @description Validation exception */ - 405: { + 422: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Unexpected error */ + default: { headers: { [name: string]: unknown; }; @@ -730,12 +735,26 @@ export interface operations { [name: string]: unknown; }; content: { - "application/xml": components["schemas"]["Pet"]; "application/json": components["schemas"]["Pet"]; + "application/xml": components["schemas"]["Pet"]; }; }; /** @description Invalid input */ - 405: { + 400: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Validation exception */ + 422: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Unexpected error */ + default: { headers: { [name: string]: unknown; }; @@ -745,9 +764,9 @@ export interface operations { }; findPetsByStatus: { parameters: { - query?: { + query: { /** @description Status values that need to be considered for filter */ - status?: "available" | "pending" | "sold"; + status: "available" | "pending" | "sold"; }; header?: never; path?: never; @@ -761,8 +780,8 @@ export interface operations { [name: string]: unknown; }; content: { - "application/xml": components["schemas"]["Pet"][]; "application/json": components["schemas"]["Pet"][]; + "application/xml": components["schemas"]["Pet"][]; }; }; /** @description Invalid status value */ @@ -772,13 +791,20 @@ export interface operations { }; content?: never; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; findPetsByTags: { parameters: { - query?: { + query: { /** @description Tags to filter by */ - tags?: string[]; + tags: string[]; }; header?: never; path?: never; @@ -792,8 +818,8 @@ export interface operations { [name: string]: unknown; }; content: { - "application/xml": components["schemas"]["Pet"][]; "application/json": components["schemas"]["Pet"][]; + "application/xml": components["schemas"]["Pet"][]; }; }; /** @description Invalid tag value */ @@ -803,6 +829,13 @@ export interface operations { }; content?: never; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; getPetById: { @@ -823,8 +856,8 @@ export interface operations { [name: string]: unknown; }; content: { - "application/xml": components["schemas"]["Pet"]; "application/json": components["schemas"]["Pet"]; + "application/xml": components["schemas"]["Pet"]; }; }; /** @description Invalid ID supplied */ @@ -841,6 +874,13 @@ export interface operations { }; content?: never; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; updatePetWithForm: { @@ -860,8 +900,25 @@ export interface operations { }; requestBody?: never; responses: { + /** @description successful operation */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Pet"]; + "application/xml": components["schemas"]["Pet"]; + }; + }; /** @description Invalid input */ - 405: { + 400: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Unexpected error */ + default: { headers: { [name: string]: unknown; }; @@ -883,6 +940,13 @@ export interface operations { }; requestBody?: never; responses: { + /** @description Pet deleted */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; /** @description Invalid pet value */ 400: { headers: { @@ -890,6 +954,13 @@ export interface operations { }; content?: never; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; uploadFile: { @@ -920,6 +991,27 @@ export interface operations { "application/json": components["schemas"]["ApiResponse"]; }; }; + /** @description No file uploaded */ + 400: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Pet not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; getInventory: { @@ -942,6 +1034,13 @@ export interface operations { }; }; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; placeOrder: { @@ -969,7 +1068,21 @@ export interface operations { }; }; /** @description Invalid input */ - 405: { + 400: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Validation exception */ + 422: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Unexpected error */ + default: { headers: { [name: string]: unknown; }; @@ -995,8 +1108,8 @@ export interface operations { [name: string]: unknown; }; content: { - "application/xml": components["schemas"]["Order"]; "application/json": components["schemas"]["Order"]; + "application/xml": components["schemas"]["Order"]; }; }; /** @description Invalid ID supplied */ @@ -1013,6 +1126,13 @@ export interface operations { }; content?: never; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; deleteOrder: { @@ -1027,6 +1147,13 @@ export interface operations { }; requestBody?: never; responses: { + /** @description order deleted */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; /** @description Invalid ID supplied */ 400: { headers: { @@ -1041,6 +1168,13 @@ export interface operations { }; content?: never; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; createUser: { @@ -1060,7 +1194,7 @@ export interface operations { }; responses: { /** @description successful operation */ - default: { + 200: { headers: { [name: string]: unknown; }; @@ -1069,6 +1203,13 @@ export interface operations { "application/xml": components["schemas"]["User"]; }; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; createUsersWithListInput: { @@ -1090,11 +1231,11 @@ export interface operations { [name: string]: unknown; }; content: { - "application/xml": components["schemas"]["User"]; "application/json": components["schemas"]["User"]; + "application/xml": components["schemas"]["User"]; }; }; - /** @description successful operation */ + /** @description Unexpected error */ default: { headers: { [name: string]: unknown; @@ -1138,6 +1279,13 @@ export interface operations { }; content?: never; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; logoutUser: { @@ -1150,6 +1298,13 @@ export interface operations { requestBody?: never; responses: { /** @description successful operation */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Unexpected error */ default: { headers: { [name: string]: unknown; @@ -1163,7 +1318,7 @@ export interface operations { query?: never; header?: never; path: { - /** @description The name that needs to be fetched. Use user1 for testing. */ + /** @description The name that needs to be fetched. Use user1 for testing */ username: string; }; cookie?: never; @@ -1176,8 +1331,8 @@ export interface operations { [name: string]: unknown; }; content: { - "application/xml": components["schemas"]["User"]; "application/json": components["schemas"]["User"]; + "application/xml": components["schemas"]["User"]; }; }; /** @description Invalid username supplied */ @@ -1194,6 +1349,13 @@ export interface operations { }; content?: never; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; updateUser: { @@ -1201,7 +1363,7 @@ export interface operations { query?: never; header?: never; path: { - /** @description name that needs to be updated */ + /** @description name that need to be deleted */ username: string; }; cookie?: never; @@ -1216,6 +1378,27 @@ export interface operations { }; responses: { /** @description successful operation */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description user not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Unexpected error */ default: { headers: { [name: string]: unknown; @@ -1236,6 +1419,13 @@ export interface operations { }; requestBody?: never; responses: { + /** @description User deleted */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; /** @description Invalid username supplied */ 400: { headers: { @@ -1250,13 +1440,18 @@ export interface operations { }; content?: never; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; } export type Order = components["schemas"]["Order"]; -export type Customer = components["schemas"]["Customer"]; -export type Address = components["schemas"]["Address"]; export type Category = components["schemas"]["Category"]; export type User = components["schemas"]["User"]; export type Tag = components["schemas"]["Tag"];