Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added validate-exports script to check the consistency of package exports #1269

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/actions.yml
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
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
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
@@ -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/**/*"
]
}