From 99c9dc1d7832ce3e4c260c4c3f80545e5fa85bd3 Mon Sep 17 00:00:00 2001 From: Andrew Gerard Date: Thu, 12 Dec 2024 11:41:31 -0700 Subject: [PATCH 1/3] chore: add request package by default --- .../lib/scaffold/actions/setup-pkg.js | 5 +++-- packages/create-gasket-app/package.json | 1 + .../test/unit/scaffold/actions/setup-pkg.test.js | 10 ++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/create-gasket-app/lib/scaffold/actions/setup-pkg.js b/packages/create-gasket-app/lib/scaffold/actions/setup-pkg.js index 0ddcd0853..2be89a9b6 100644 --- a/packages/create-gasket-app/lib/scaffold/actions/setup-pkg.js +++ b/packages/create-gasket-app/lib/scaffold/actions/setup-pkg.js @@ -3,7 +3,7 @@ import { ConfigBuilder } from '../config-builder.js'; import { PackageManager } from '@gasket/utils'; import { createRequire } from 'module'; const require = createRequire(import.meta.url); -const { dependencies } = require('../../../package.json'); +const { dependencies, devDependencies } = require('../../../package.json'); /** * Initializes the ConfigBuilder builder and adds to context. @@ -22,7 +22,8 @@ async function setupPkg({ context }) { // Add critical dependencies pkg.add('dependencies', { '@gasket/core': dependencies['@gasket/core'], - '@gasket/utils': dependencies['@gasket/utils'] + '@gasket/utils': dependencies['@gasket/utils'], + '@gasket/request': devDependencies['@gasket/request'] }); const pkgManager = new PackageManager(context); diff --git a/packages/create-gasket-app/package.json b/packages/create-gasket-app/package.json index 0d45b62b0..4d9167b01 100644 --- a/packages/create-gasket-app/package.json +++ b/packages/create-gasket-app/package.json @@ -58,6 +58,7 @@ "untildify": "^4.0.0" }, "devDependencies": { + "@gasket/request": "7.1.0-next.0", "@types/inquirer": "^9.0.7", "cross-env": "^7.0.3", "diagnostics": "^2.0.2", diff --git a/packages/create-gasket-app/test/unit/scaffold/actions/setup-pkg.test.js b/packages/create-gasket-app/test/unit/scaffold/actions/setup-pkg.test.js index 3cc1eea38..51be8b696 100644 --- a/packages/create-gasket-app/test/unit/scaffold/actions/setup-pkg.test.js +++ b/packages/create-gasket-app/test/unit/scaffold/actions/setup-pkg.test.js @@ -1,4 +1,7 @@ import { jest } from '@jest/globals'; +import { createRequire } from 'module'; +const require = createRequire(import.meta.url); +const { dependencies, devDependencies } = require('../../../../package.json'); const mockContstructorStub = jest.fn(); class MockPackageManager { @@ -50,8 +53,11 @@ describe('setupPkg', () => { it('adds core dependencies', async () => { await setupPkg.wrapped({ context: mockContext }); - expect(mockContext.pkg.fields.dependencies).toHaveProperty('@gasket/core'); - expect(mockContext.pkg.fields.dependencies).toHaveProperty('@gasket/utils'); + expect(mockContext.pkg.fields.dependencies).toEqual({ + '@gasket/core': dependencies['@gasket/core'], + '@gasket/utils': dependencies['@gasket/utils'], + '@gasket/request': devDependencies['@gasket/request'] + }); }); it('instantiates PackageManager with context', async () => { From d8c7c84a79272e4f0a607a3ea26496edfab2e182 Mon Sep 17 00:00:00 2001 From: Andrew Gerard Date: Thu, 12 Dec 2024 11:43:12 -0700 Subject: [PATCH 2/3] chore: remove unused deps --- package-lock.json | 37 ++++++------------------- packages/create-gasket-app/package.json | 5 +--- 2 files changed, 10 insertions(+), 32 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7a822dbd5..c2e936d7e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12723,6 +12723,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, "license": "MIT", "dependencies": { "buffer": "^5.5.0", @@ -12923,6 +12924,7 @@ "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, "funding": [ { "type": "github", @@ -17170,6 +17172,7 @@ "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, "license": "MIT", "dependencies": { "once": "^1.4.0" @@ -20426,6 +20429,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "dev": true, "license": "MIT" }, "node_modules/fs-extra": { @@ -29904,12 +29908,6 @@ "node": ">=10" } }, - "node_modules/mkdirp-classic": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", - "license": "MIT" - }, "node_modules/mock-require": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/mock-require/-/mock-require-3.0.3.tgz", @@ -33885,6 +33883,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==", + "dev": true, "license": "MIT", "dependencies": { "end-of-stream": "^1.1.0", @@ -38202,28 +38201,11 @@ "node": ">=10" } }, - "node_modules/tar-fs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", - "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", - "license": "MIT", - "dependencies": { - "chownr": "^1.1.1", - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^2.1.4" - } - }, - "node_modules/tar-fs/node_modules/chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "license": "ISC" - }, "node_modules/tar-stream": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dev": true, "license": "MIT", "dependencies": { "bl": "^4.0.3", @@ -39551,6 +39533,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -42217,15 +42200,13 @@ "json5": "^2.2.3", "mkdirp": "^1.0.4", "ora": "3.4.0", - "pump": "^3.0.0", - "semver": "^7.6.3", - "tar-fs": "^2.0.0", - "untildify": "^4.0.0" + "semver": "^7.6.3" }, "bin": { "create-gasket-app": "lib/index.js" }, "devDependencies": { + "@gasket/request": "7.1.0-next.0", "@types/inquirer": "^9.0.7", "cross-env": "^7.0.3", "diagnostics": "^2.0.2", diff --git a/packages/create-gasket-app/package.json b/packages/create-gasket-app/package.json index 4d9167b01..26d914fca 100644 --- a/packages/create-gasket-app/package.json +++ b/packages/create-gasket-app/package.json @@ -52,10 +52,7 @@ "json5": "^2.2.3", "mkdirp": "^1.0.4", "ora": "3.4.0", - "pump": "^3.0.0", - "semver": "^7.6.3", - "tar-fs": "^2.0.0", - "untildify": "^4.0.0" + "semver": "^7.6.3" }, "devDependencies": { "@gasket/request": "7.1.0-next.0", From 5f6060e73e30cc628946aa2f193aea8738f9c097 Mon Sep 17 00:00:00 2001 From: Andrew Gerard Date: Thu, 12 Dec 2024 11:43:54 -0700 Subject: [PATCH 3/3] fix: diagnostics should be regular dep --- package-lock.json | 2 +- packages/create-gasket-app/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index c2e936d7e..c5a95034c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42194,6 +42194,7 @@ "@gasket/utils": "7.1.0-next.0", "commander": "^12.0.0", "deepmerge": "^4.3.1", + "diagnostics": "^2.0.2", "glob": "^8.1.0", "handlebars": "^4.7.8", "inquirer": "6.5.2", @@ -42209,7 +42210,6 @@ "@gasket/request": "7.1.0-next.0", "@types/inquirer": "^9.0.7", "cross-env": "^7.0.3", - "diagnostics": "^2.0.2", "dotenv": "^16.4.5", "eslint": "^8.56.0", "eslint-config-godaddy": "^7.1.1", diff --git a/packages/create-gasket-app/package.json b/packages/create-gasket-app/package.json index 26d914fca..172c91161 100644 --- a/packages/create-gasket-app/package.json +++ b/packages/create-gasket-app/package.json @@ -46,6 +46,7 @@ "@gasket/utils": "7.1.0-next.0", "commander": "^12.0.0", "deepmerge": "^4.3.1", + "diagnostics": "^2.0.2", "glob": "^8.1.0", "handlebars": "^4.7.8", "inquirer": "6.5.2", @@ -58,7 +59,6 @@ "@gasket/request": "7.1.0-next.0", "@types/inquirer": "^9.0.7", "cross-env": "^7.0.3", - "diagnostics": "^2.0.2", "dotenv": "^16.4.5", "eslint": "^8.56.0", "eslint-config-godaddy": "^7.1.1",