diff --git a/.github/ensureManifests.js b/.github/ensureManifests.js new file mode 100644 index 00000000..5c1dcc8b --- /dev/null +++ b/.github/ensureManifests.js @@ -0,0 +1,30 @@ +import { findWorkspaces } from 'find-workspaces' +import { existsSync } from 'node:fs' + +let result = 0 + +for (const workspace of findWorkspaces()) { + if(workspace.package.private) { + continue + } + + if (!(existsSync(workspace.location + '/manifest.ttl'))) { + console.log(`⚠️ ${workspace.package.name} - no manifest.ttl`) + continue + } + + if(!workspace.package.files) { + console.log(`✅ ${workspace.package.name} - all files included in package`) + continue + } + + if(workspace.package.files.includes('manifest.ttl')) { + console.log(`✅ ${workspace.package.name} - manifest.ttl file listed`) + continue + } + + console.error(`❌ ${workspace.package.name} - manifest.ttl file not listed`) + result += 1 +} + +process.exit(result) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fa705a27..dcfa0f90 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -77,6 +77,14 @@ jobs: - run: npm ci - run: npm run lint + ensure-manifests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + - run: npm ci + - run: node .github/ensure-manifests.js + smoke-test-cli: strategy: fail-fast: false diff --git a/package-lock.json b/package-lock.json index 461e45ac..8dc9da5e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "c8": "^7.6.0", "chai": "^4.3.10", "eslint-import-resolver-typescript": "^3.6.1", + "find-workspaces": "^0.3.1", "husky": "^8.0.3", "lint-staged": "^13.2.2", "mocha": "^10.2.0", @@ -7316,9 +7317,10 @@ } }, "node_modules/acorn": { - "version": "8.8.2", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.0.tgz", + "integrity": "sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==", "dev": true, - "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -10589,6 +10591,12 @@ "dev": true, "license": "MIT" }, + "node_modules/confbox": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.7.tgz", + "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==", + "dev": true + }, "node_modules/content-disposition": { "version": "0.5.4", "dev": true, @@ -13679,6 +13687,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/find-workspaces": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/find-workspaces/-/find-workspaces-0.3.1.tgz", + "integrity": "sha512-UDkGILGJSA1LN5Aa7McxCid4sqW3/e+UYsVwyxki3dDT0F8+ym0rAfnCkEfkL0rO7M+8/mvkim4t/s3IPHmg+w==", + "dev": true, + "dependencies": { + "fast-glob": "^3.3.2", + "pkg-types": "^1.0.3", + "yaml": "^2.3.4" + } + }, "node_modules/find-yarn-workspace-root2": { "version": "1.2.16", "dev": true, @@ -21324,6 +21343,18 @@ "mkdirp": "bin/cmd.js" } }, + "node_modules/mlly": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.1.tgz", + "integrity": "sha512-rrVRZRELyQzrIUAVMHxP97kv+G786pHmOKzuFII8zDYahFBS7qnHh2AlYSl1GAHhaMPCz6/oHjVMcfFYgFYHgA==", + "dev": true, + "dependencies": { + "acorn": "^8.11.3", + "pathe": "^1.1.2", + "pkg-types": "^1.1.1", + "ufo": "^1.5.3" + } + }, "node_modules/mocha": { "version": "10.2.0", "dev": true, @@ -22745,6 +22776,12 @@ "node": ">=8" } }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true + }, "node_modules/pathval": { "version": "1.1.1", "license": "MIT", @@ -22876,6 +22913,17 @@ "node": ">=8" } }, + "node_modules/pkg-types": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.1.1.tgz", + "integrity": "sha512-ko14TjmDuQJ14zsotODv7dBlwxKhUKQEhuhmbqo1uCi9BB0Z2alo/wAXg6q1dTR5TyuqYyWhjtfe/Tsh+X28jQ==", + "dev": true, + "dependencies": { + "confbox": "^0.1.7", + "mlly": "^1.7.0", + "pathe": "^1.1.2" + } + }, "node_modules/pkgscan": { "version": "1.0.24", "license": "MIT", @@ -26466,6 +26514,12 @@ "node": ">=14.17" } }, + "node_modules/ufo": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz", + "integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==", + "dev": true + }, "node_modules/unbox-primitive": { "version": "1.0.2", "dev": true, @@ -27319,9 +27373,13 @@ "license": "ISC" }, "node_modules/yaml": { - "version": "2.3.1", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.5.tgz", + "integrity": "sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==", "dev": true, - "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, "engines": { "node": ">= 14" } diff --git a/package.json b/package.json index 048c2d70..27d95964 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "c8": "^7.6.0", "chai": "^4.3.10", "eslint-import-resolver-typescript": "^3.6.1", + "find-workspaces": "^0.3.1", "husky": "^8.0.3", "lint-staged": "^13.2.2", "mocha": "^10.2.0",