Skip to content

Commit 0027838

Browse files
authored
[Project Solar / Phase 1 / Cherry-pick] Updated prepublishOnly in package.json to use a custom script (#3563)
1 parent 6498d0b commit 0027838

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

packages/components/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"lint:js:fix": "eslint . --fix",
3131
"lint:types": "glint",
3232
"start": "rollup --config --watch --environment development",
33-
"prepublishOnly": "pnpm build && test -f 'dist/styles/@hashicorp/design-system-components.css' || (echo \"\n\\033[31m⚠️ Error: the pre-compiled CSS file \\`dist/styles/@hashicorp/design-system-components.css\\` was not found\\033[0m\\n\" && exit 1)"
33+
"test:dist-files": "node scripts/check-dist-files.mjs",
34+
"prepublishOnly": "pnpm build && pnpm test:dist-files"
3435
},
3536
"dependencies": {
3637
"@codemirror/autocomplete": "^6.20.0",
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env node
2+
3+
import { existsSync } from 'node:fs';
4+
5+
const FILES_TO_CHECK = [
6+
'dist/styles/@hashicorp/design-system-components.css',
7+
'dist/styles/@hashicorp/design-system-power-select-overrides.css',
8+
];
9+
10+
let hasErrors = false;
11+
12+
for (const file of FILES_TO_CHECK) {
13+
if (!existsSync(file)) {
14+
console.error(
15+
`\n\x1b[31m⚠️ Error: the pre-compiled CSS file \`${file}\` was not found\x1b[0m\n`
16+
);
17+
hasErrors = true;
18+
}
19+
}
20+
21+
if (hasErrors) {
22+
process.exit(1);
23+
}

0 commit comments

Comments
 (0)