Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Jan 9, 2025
1 parent 83a0fd2 commit 1fe854e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/codemods/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 0 additions & 3 deletions release/core/publish/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
37 changes: 26 additions & 11 deletions scripts/test-package-manager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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-') {
Expand Down Expand Up @@ -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
Expand All @@ -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() {
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 1fe854e

Please sign in to comment.