diff --git a/packages/test-setup/package.json b/packages/test-setup/package.json index 94fb7ce44..d5ac6bc60 100644 --- a/packages/test-setup/package.json +++ b/packages/test-setup/package.json @@ -16,11 +16,27 @@ "resolve": "^1.20.0" }, "devDependencies": { - "@embroider/compat": "workspace:*", - "@embroider/core": "workspace:*", - "@embroider/webpack": "workspace:*", + "@embroider/compat": "workspace:^", + "@embroider/core": "workspace:^", + "@embroider/webpack": "workspace:^", "@types/lodash": "^4.14.170" }, + "peerDependencies": { + "@embroider/compat": "workspace:^", + "@embroider/core": "workspace:^", + "@embroider/webpack": "workspace:^" + }, + "peerDependenciesMeta": { + "@embroider/compat": { + "optional": true + }, + "@embroider/core": { + "optional": true + }, + "@embroider/webpack": { + "optional": true + } + }, "engines": { "node": "12.* || 14.* || >= 16" }, diff --git a/packages/test-setup/src/index.ts b/packages/test-setup/src/index.ts index 8ce4cf3d8..ebe48bf46 100644 --- a/packages/test-setup/src/index.ts +++ b/packages/test-setup/src/index.ts @@ -5,7 +5,15 @@ import type { Webpack } from '@embroider/webpack'; type EmberWebpackOptions = typeof Webpack extends PackagerConstructor ? Options : never; // eslint-disable-next-line @typescript-eslint/no-require-imports -const currentEmbroiderVersion = `^${require('../package.json').version}`; +const ourPeerDeps = require('../package.json').peerDependencies; + +const embroiderDevDeps = { + '@embroider/core': `^${ourPeerDeps['@embroider/core']}`, + '@embroider/webpack': `^${ourPeerDeps['@embroider/webpack']}`, + '@embroider/compat': `^${ourPeerDeps['@embroider/compat']}`, + // Webpack is a peer dependency of `@embroider/webpack` + webpack: '^5.0.0', +}; /* Use this instead of `app.toTree()` in your ember-cli-build.js: @@ -49,14 +57,7 @@ export function embroiderSafe(extension?: object) { { name: 'embroider-safe', npm: { - devDependencies: { - '@embroider/core': currentEmbroiderVersion, - '@embroider/webpack': currentEmbroiderVersion, - '@embroider/compat': currentEmbroiderVersion, - - // Webpack is a peer dependency of `@embroider/webpack` - webpack: '^5.0.0', - }, + devDependencies: embroiderDevDeps, }, env: { EMBROIDER_TEST_SETUP_OPTIONS: 'safe', @@ -71,14 +72,7 @@ export function embroiderOptimized(extension?: object) { { name: 'embroider-optimized', npm: { - devDependencies: { - '@embroider/core': currentEmbroiderVersion, - '@embroider/webpack': currentEmbroiderVersion, - '@embroider/compat': currentEmbroiderVersion, - - // Webpack is a peer dependency of `@embroider/webpack` - webpack: '^5.0.0', - }, + devDependencies: embroiderDevDeps, }, env: { EMBROIDER_TEST_SETUP_OPTIONS: 'optimized', diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 12a1e4ec6..890ff5752 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -719,13 +719,13 @@ importers: version: 1.20.0 devDependencies: '@embroider/compat': - specifier: workspace:* + specifier: workspace:^ version: link:../compat '@embroider/core': - specifier: workspace:* + specifier: workspace:^ version: link:../core '@embroider/webpack': - specifier: workspace:* + specifier: workspace:^ version: link:../webpack '@types/lodash': specifier: ^4.14.170 @@ -8657,7 +8657,7 @@ packages: dev: true /cookie-signature@1.0.6: - resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} + resolution: {integrity: sha1-4wOogrNCzD7oylE6eZmXNNqzriw=} /cookie@0.4.2: resolution: {integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==} @@ -13103,7 +13103,7 @@ packages: map-cache: 0.2.2 /fresh@0.5.2: - resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} + resolution: {integrity: sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=} engines: {node: '>= 0.6'} /from2@2.3.0: @@ -15810,7 +15810,7 @@ packages: dev: true /merge-descriptors@1.0.1: - resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} + resolution: {integrity: sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=} /merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} @@ -16751,7 +16751,7 @@ packages: dev: true /path-to-regexp@0.1.7: - resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} + resolution: {integrity: sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=} /path-type@3.0.0: resolution: {integrity: sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==}