From 1fe854e14c1e7dd1d561ed43f9a65828ab68c94d Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Thu, 9 Jan 2025 18:31:27 -0500 Subject: [PATCH] Fix --- packages/codemods/package.json | 2 +- release/core/publish/index.ts | 3 --- scripts/test-package-manager.mjs | 37 ++++++++++++++++++++++---------- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/packages/codemods/package.json b/packages/codemods/package.json index 700a680d82e..872e0a61ac7 100644 --- a/packages/codemods/package.json +++ b/packages/codemods/package.json @@ -42,7 +42,7 @@ "devDependencies": { "@types/bun": "^1.1.4", "@types/jscodeshift": "0.11.11", - "@warp-drive/internal-config": "workspace:5.4.0-alpha.122", + "@warp-drive/internal-config": "5.4.0-alpha.122", "eslint": "^9.12.0", "pnpm-sync-dependencies-meta-injected": "0.0.14", "qunit": "^2.20.1" diff --git a/release/core/publish/index.ts b/release/core/publish/index.ts index 6a89b08fb5b..d98917f30a3 100644 --- a/release/core/publish/index.ts +++ b/release/core/publish/index.ts @@ -35,9 +35,6 @@ export async function executePublish(args: string[]) { // get packages present on our current branch const packages = await gatherPackages(strategy.config); - console.log(packages); - console.log(strategy.config); - // get packages present in the git tag version const fromVersion = config.full.get('from') as SEMVER_VERSION | undefined; const fromTag = `v${fromVersion}` as GIT_TAG; diff --git a/scripts/test-package-manager.mjs b/scripts/test-package-manager.mjs index 372daac9a5e..d084a67c5c2 100644 --- a/scripts/test-package-manager.mjs +++ b/scripts/test-package-manager.mjs @@ -6,12 +6,17 @@ import { join, basename } from 'node:path'; import { $ } from 'execa'; import { globby } from 'globby'; -import { gatherPackages, loadStrategy } from '../release/utils/package.ts'; +import { gatherPackages } from '../release/utils/package.ts'; import { generatePackageTarballs } from '../release/core/publish/steps/generate-tarballs.ts'; -import { applyStrategy } from '../release/core/publish/steps/generate-strategy.ts'; const CWD = process.cwd(); +/** + * We don't test types for these packages + * (they also don't end up in the browser) + */ +const IGNORED_PACKAGES = new Set(['@ember-data/codemods']); + const PROJECT_TO_USE = join(import.meta.dirname, '../tests/vite-basic-compat'); async function createTempFolder(prefix = 'tmp-') { @@ -63,9 +68,12 @@ async function buildAll(tag) { return this[key]; }, }; - const strategy = await loadStrategy(); - const packages = await gatherPackages(strategy.config); - const applied = await applyStrategy(config, strategy, packages, packages); + + /* + * During actual publish, the whole strategy file is passed here for convinience, + * but we don't need all of it for the tests + */ + const packages = await gatherPackages({ packageRoots: ['packages/*', 'tests/*', 'config'] }); /** * The applied stategy is mostly based off release/strategy.json @@ -74,15 +82,22 @@ async function buildAll(tag) { * It's lies, as we're not changing the versions, but the release / build * code has different behavior based on channel */ - for (let [pkgName, config] of Object.entries(applied.public_pks)) { - applied.public_pks[pkgName] = { - ...config, + const strategy = new Map(); + for (let [pkgName, config] of packages.entries()) { + if (config.pkgData.private) continue; + if (IGNORED_PACKAGES.has(config.pkgData.name)) continue; + + strategy.set(pkgName, { stage: tag, types: tag, - }; + typesPublish: true, + name: config.pkgData.name, + private: false, + disttag: tag, + }); } - await generatePackageTarballs(config, packages, applied.public_pks); + await generatePackageTarballs(config, packages, strategy); } async function deleteTars() { @@ -152,7 +167,7 @@ async function fixManifest(projectDir) { if (!local) { console.warn(` -Could not find ${depName} in list of tarballs: +Could not find ${depName} in list of tarballs: ${tars.map((x) => `\t${x}\n`).join('')} ${depName} will be omitted from this test project.