Skip to content
Draft
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
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"clean": "nx clean",
"lint": "nx lint",
"lint:fix": "nx lint:fix",
"prepack": "NODE_ENV=production pnpm nx build && cp ../../README.md README.md",
"prepack": "NODE_ENV=production pnpm nx build && pnpm oclif manifest && cp ../../README.md README.md",
"vitest": "vitest",
"type-check": "nx type-check"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"clean": "nx clean",
"lint": "nx lint",
"lint:fix": "nx lint:fix",
"prepack": "NODE_ENV=production node ../../bin/update-bugsnag cli && cp ../../README.md README.md",
"prepack": "NODE_ENV=production node ../../bin/update-bugsnag cli && pnpm oclif manifest && cp ../../README.md README.md",
"vitest": "vitest",
"type-check": "nx type-check"
},
Expand Down
29 changes: 29 additions & 0 deletions packages/cli/src/cli/repo-health.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,32 @@ describe('Node dependency version sync', () => {
expect(different, errorMessage).toHaveLength(0)
})
})

describe('oclif manifest packaging', () => {
test('packages that ship oclif.manifest.json regenerate it in prepack', async () => {
const packageJsonPaths = await glob('packages/*/package.json', {cwd: repoRoot, absolute: true})

const missingManifestRefresh: string[] = []

for (const packageJsonPath of packageJsonPaths) {
const packageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8')) as {
files?: string[]
scripts?: {prepack?: string}
}

if (!packageJson.files?.includes('/oclif.manifest.json')) continue
if (!packageJson.scripts?.prepack?.includes('pnpm oclif manifest')) {
missingManifestRefresh.push(path.relative(repoRoot, packageJsonPath))
}
}

expect(
missingManifestRefresh,
[
'The following packages publish oclif.manifest.json without regenerating it in prepack:\n',
...missingManifestRefresh.map((packageJsonPath) => ` - ${packageJsonPath}\n`),
'\nAdd `pnpm oclif manifest` to the package prepack script so snapshot/nightly versions do not ship stale manifests.',
].join(''),
).toHaveLength(0)
})
})
2 changes: 1 addition & 1 deletion packages/create-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"clean": "nx clean",
"lint": "nx lint",
"lint:fix": "nx lint:fix",
"prepack": "NODE_ENV=production node ../../bin/update-bugsnag create-app && cp ../../README.md README.md",
"prepack": "NODE_ENV=production node ../../bin/update-bugsnag create-app && pnpm oclif manifest && cp ../../README.md README.md",
"vitest": "vitest",
"type-check": "nx type-check"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"clean": "nx clean",
"lint": "nx lint",
"lint:fix": "nx lint:fix",
"prepack": "NODE_ENV=production pnpm nx build && cp ../../README.md README.md",
"prepack": "NODE_ENV=production pnpm nx build && pnpm oclif manifest && cp ../../README.md README.md",
"vitest": "vitest",
"type-check": "nx type-check"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-did-you-mean/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"clean": "nx clean",
"lint": "nx lint",
"lint:fix": "nx lint:fix",
"prepack": "NODE_ENV=production pnpm nx build && cp ../../README.md README.md",
"prepack": "NODE_ENV=production pnpm nx build && pnpm oclif manifest && cp ../../README.md README.md",
"vitest": "vitest",
"type-check": "nx type-check"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"clean": "nx clean",
"lint": "nx lint",
"lint:fix": "nx lint:fix",
"prepack": "NODE_ENV=production pnpm nx build && cp ../../README.md README.md",
"prepack": "NODE_ENV=production pnpm nx build && pnpm oclif manifest && cp ../../README.md README.md",
"vitest": "vitest",
"type-check": "nx type-check"
},
Expand Down
Loading