Skip to content

Commit

Permalink
Added validate-exports script to check the consistency of package exp…
Browse files Browse the repository at this point in the history
…orts
  • Loading branch information
spoenemann committed Nov 8, 2023
1 parent 2b20f94 commit 2915ff4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
run: |
npm ci
npm run build:clean
npm run validate-exports
- name: Test
if: success() || failure()
shell: bash
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"test": "vitest",
"test-ui": "vitest --ui",
"coverage": "vitest run --coverage",
"validate-exports": "npm run validate-exports --workspace=langium",
"version:dependencies": "node ./scripts/update-version.js && npm install",
"langium:generate": "npm run langium:generate --workspace=langium --workspace=examples/domainmodel --workspace=examples/arithmetics --workspace=examples/statemachine --workspace=examples/requirements",
"dev-build": "npm run dev-clean && npm install && npm link ./packages/langium && npm link ./packages/langium-cli && npm link ./packages/generator-langium",
Expand Down
1 change: 1 addition & 0 deletions packages/langium/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"build": "tsc",
"watch": "tsc --watch",
"lint": "eslint src test --ext .ts",
"validate-exports": "tsc -p test/tsconfig.export-main.json",
"langium:generate": "langium generate",
"langium:generate:production": "langium generate --mode=production",
"publish:next": "npm --no-git-tag-version version \"$(semver $npm_package_version -i minor)-next.$(git rev-parse --short HEAD)\" && npm publish --tag next",
Expand Down
10 changes: 10 additions & 0 deletions packages/langium/test/tsconfig.export-main.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Validate the main package export by excluding parts of the code that shouldn't be directly linked
{
"extends": "../tsconfig.src.json",
"compilerOptions": {
"noEmit": true
},
"exclude": [
"../src/test/**/*"
]
}

0 comments on commit 2915ff4

Please sign in to comment.