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

test: add package compatibility tests using publint #4446

Merged
merged 47 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
4c3d793
type module everywhere
louis-bompart Sep 19, 2024
8896adb
Apply suggestions from code review
louis-bompart Sep 19, 2024
d4f9150
lint&ut
louis-bompart Sep 20, 2024
d65b94c
e2e should be fine
louis-bompart Sep 20, 2024
ad2e6f8
Update packages/atomic/tsconfig.storybook.json
louis-bompart Sep 20, 2024
bbae835
fix typedoc
louis-bompart Sep 20, 2024
c6264b8
deps
louis-bompart Sep 20, 2024
8d232fd
make react uses proper path
louis-bompart Sep 20, 2024
062e6e7
missing patch
louis-bompart Sep 20, 2024
6d8345d
tweak-cypresses
louis-bompart Sep 20, 2024
4c48774
fixlint
louis-bompart Sep 20, 2024
4c5d357
fix errors and add script check
alexprudhomme Sep 20, 2024
7c7e7fa
Delete action.yml
alexprudhomme Sep 20, 2024
a4ebfab
Update packages-compatibility.mjs
alexprudhomme Sep 20, 2024
395a91c
typo
alexprudhomme Sep 20, 2024
872438d
typo
alexprudhomme Sep 20, 2024
3dc0016
fix most errors atomic-react
alexprudhomme Sep 20, 2024
38f7b3a
Update packages/atomic/.storybook/main.mts
louis-bompart Sep 20, 2024
39fe585
Update package.json
alexprudhomme Sep 20, 2024
480b5bb
typo ahh
alexprudhomme Sep 20, 2024
95c6b60
Revert "typo ahh"
alexprudhomme Sep 20, 2024
c999749
Update package.json
alexprudhomme Sep 20, 2024
daadc1d
fix headless type defintions
alexprudhomme Sep 20, 2024
b70bdde
changes forgotten
alexprudhomme Sep 20, 2024
b2de421
Merge branch 'master' into type=module
louis-bompart Sep 20, 2024
2207b51
use @coveo/atomic-storybook-utils
louis-bompart Sep 20, 2024
015040f
fix errors (#4444)
alexprudhomme Sep 20, 2024
8795d9c
Merge branch 'type=module' into type=module-headless-types
alexprudhomme Sep 20, 2024
921168c
remove script
alexprudhomme Sep 20, 2024
4db6223
test: add package compatibility tests using publint and are the types…
alexprudhomme Sep 20, 2024
0715277
Merge branch 'master' into KIT-3596
alexprudhomme Sep 24, 2024
3d0fc63
Merge branch 'master' into KIT-3596
fbeaudoincoveo Sep 25, 2024
78f5bda
Fix typos
fbeaudoincoveo Sep 25, 2024
97cbe45
Fix another typo
fbeaudoincoveo Sep 25, 2024
44c6ee2
Update description
fbeaudoincoveo Sep 25, 2024
f7858d1
Fix error display
fbeaudoincoveo Sep 25, 2024
2869bb9
Add attw check
fbeaudoincoveo Sep 25, 2024
b551c24
Improvements to script
fbeaudoincoveo Sep 26, 2024
a08c38f
Merge branch 'master' into KIT-3596
fbeaudoincoveo Sep 26, 2024
cdee62a
Fix typos
fbeaudoincoveo Sep 26, 2024
fca54e1
Only run publint scan
fbeaudoincoveo Sep 26, 2024
58d9c32
Remove attw
fbeaudoincoveo Sep 26, 2024
7a27083
remove jest.config change from old merge
alexprudhomme Sep 26, 2024
d21fb11
Merge branch 'master' into KIT-3596
fbeaudoincoveo Oct 16, 2024
f33c442
Merge branch 'KIT-3596' of github.com:coveo/ui-kit into KIT-3596
fbeaudoincoveo Oct 16, 2024
19a73d5
Apply review comments
fbeaudoincoveo Oct 16, 2024
bc80970
Merge branch 'master' into KIT-3596
alexprudhomme Oct 23, 2024
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
8 changes: 8 additions & 0 deletions .github/workflows/prbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: ./.github/actions/setup
- run: npm test
package-compatibility:
name: 'Verify compatibility of packages'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: ./.github/actions/setup
- run: npm run package-compatibility
e2e-atomic-csp-test:
name: 'Run e2e tests on Atomic CSP'
needs: build
Expand Down
28 changes: 25 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"e2e": "nx run-many --target=e2e",
"lint:check": "eslint . && cspell **/*.md --no-progress --show-suggestions --show-context && prettier --check '**/*.{css,pcss,html,md,yml,ts,tsx,js,mjs,json}'",
"lint:fix": "eslint --fix . && prettier --write '**/*.{css,pcss,html,md,yml,ts,tsx,js,mjs,json}'",
"package-compatibility": "node ./scripts/ci/package-compatibility.mjs",
"pr:report": "node ./scripts/reports/pr-report.mjs",
"report:bundle-size:time-series": "node ./scripts/reports/bundle-size/time-series.mjs",
"commit": "git-cz",
Expand Down Expand Up @@ -83,6 +84,7 @@
"patch-package": "8.0.0",
"prettier": "3.3.3",
"prettier-plugin-tailwindcss": "0.6.5",
"publint": "0.2.11",
"react-syntax-highlighter": "15.5.0",
"rimraf": "5.0.9",
"semver": "7.6.3",
Expand Down
69 changes: 69 additions & 0 deletions scripts/ci/package-compatibility.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import {publint} from 'publint';

let exitCode = 0;

const pkgDirs = [
'packages/atomic',
'packages/headless',
'packages/atomic-react',
];

const issues = await Promise.all(
pkgDirs.map(async (pkgDir) => {
const {messages} = await publint({
pkgDir,
level: 'suggestion',
strict: false,
});

const suggestions = [];
const warnings = [];
const errors = [];

for (const message of messages) {
switch (message.type) {
case 'suggestion':
suggestions.push(message);
break;
case 'warning':
warnings.push(message);
break;
case 'error':
errors.push(message);
break;
}
}

return {
pkgDir,
suggestions,
warnings,
errors,
};
})
);

if (issues.length > 0) {
console.info('The publint scan detected compatibility issues:\n');

for (const issue of issues) {
console.info(`\n********** ${issue.pkgDir} **********\n`);
if (issue.errors.length > 0) {
exitCode = 1;
console.info('Errors:\n');
console.error(JSON.stringify(issue.errors, null, 2));
}
if (issue.warnings.length > 0) {
console.info('Warnings:\n');
console.warn(JSON.stringify(issue.warnings, null, 2));
}
if (issue.suggestions.length > 0) {
console.info('Suggestions:\n');
console.info(JSON.stringify(issue.suggestions, null, 2));
}
fbeaudoincoveo marked this conversation as resolved.
Show resolved Hide resolved
}
} else {
console.info('No compatibility issues found by publint.');
}

process.exit(exitCode);
Loading