Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add @gasket/request during create #990

Merged
merged 3 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 10 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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);
Expand Down
8 changes: 3 additions & 5 deletions packages/create-gasket-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,19 @@
"@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",
"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",
"@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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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 () => {
Expand Down
Loading