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

ci(github): add check to validate exported types being correct #3140

Open
petermetz opened this issue Mar 23, 2024 · 3 comments · May be fixed by #3561
Open

ci(github): add check to validate exported types being correct #3140

petermetz opened this issue Mar 23, 2024 · 3 comments · May be fixed by #3561
Assignees
Labels
backlog Tasks that are needed but we cannot prioritize them at present. Developer_Experience P4 Priority 4: Low Triage_Needed Triage if the issue is/still relevant, bug report is valid, arch/design details etc.

Comments

@petermetz
Copy link
Contributor

Description

As a maintainer/reviewer I want to have automation that checks if our exports are correct for both CJS/ESM so that we are less likely to accidentally merge something that would make the exports mess up and cause import issues for the downstream libraries/applications.

https://www.npmjs.com/package/@arethetypeswrong/cli

Acceptance Criteria

  1. Does not duplicate the entire build process needlessly.
  2. Evaluate if we should do it for every commit or just prior to release issuance.
  3. Be mindful of CI resources consumed by this in general.
@petermetz petermetz added Developer_Experience Triage_Needed Triage if the issue is/still relevant, bug report is valid, arch/design details etc. P4 Priority 4: Low backlog Tasks that are needed but we cannot prioritize them at present. labels Mar 23, 2024
@petermetz
Copy link
Contributor Author

@ruzell22

yarn lerna exec 'npm pack'
$ attw ./packages/cactus-plugin-ledger-connector-besu/hyperledger-cactus-plugin-ledger-connector-besu-2.0.0-rc.3.tgz 

@hyperledger/cactus-plugin-ledger-connector-besu v2.0.0-rc.3

 No problems found 🌟


┌───────────────────┬────────────────────────────────────────────────────┐
│                   │ "@hyperledger/cactus-plugin-ledger-connector-besu" │
├───────────────────┼────────────────────────────────────────────────────┤
│ node10            │ 🟢                                                 │
├───────────────────┼────────────────────────────────────────────────────┤
│ node16 (from CJS) │ 🟢 (CJS)                                           │
├───────────────────┼────────────────────────────────────────────────────┤
│ node16 (from ESM) │ 🟢 (CJS)                                           │
├───────────────────┼────────────────────────────────────────────────────┤
│ bundler           │ 🟢                                                 │
└───────────────────┴────────────────────────────────────────────────────┘

@petermetz
Copy link
Contributor Author

@ruzell22

  1. The above example works for a single .tgz file
  2. You can write a globby pattern in one of the nodejs tooling scripts (the ones that are within the custom-checks area)
  3. Capture a list of the file paths for all the *.tgz files and then run a shell command for each individually

@petermetz
Copy link
Contributor Author

https://github.com/arethetypeswrong/arethetypeswrong.github.io/tree/main/packages/core

@ruzell22 If possible use the library not the CLI (which would force you to run shell commands from the NodeJS script)

ruzell22 added a commit to ruzell22/cactus that referenced this issue Sep 30, 2024
Primary Changes
---------------
1. Added get-all-tgz-path.ts to get all tgz files path
2. Added run-attw-on-tgz.ts to run attw on each tgz filepath
3. Added workflow to run the are-the-types-wrong script

Fixes: hyperledger-cacti#3140

Signed-off-by: ruzell22 <[email protected]>
@ruzell22 ruzell22 linked a pull request Sep 30, 2024 that will close this issue
5 tasks
ruzell22 added a commit to ruzell22/cactus that referenced this issue Oct 2, 2024
Primary Changes
---------------
1. Added get-all-tgz-path.ts to get all tgz files path
2. Added run-attw-on-tgz.ts to run attw on each tgz filepath
3. Added workflow to run the are-the-types-wrong script

Fixes: hyperledger-cacti#3140

Signed-off-by: ruzell22 <[email protected]>
ruzell22 added a commit to ruzell22/cactus that referenced this issue Oct 2, 2024
Primary Changes
---------------
1. Added get-all-tgz-path.ts to get all tgz files path
2. Added run-attw-on-tgz.ts to run attw on each tgz filepath
3. Added workflow to run the are-the-types-wrong script

Fixes: hyperledger-cacti#3140

Signed-off-by: ruzell22 <[email protected]>
ruzell22 added a commit to ruzell22/cactus that referenced this issue Oct 3, 2024
Primary Changes
---------------
1. Added get-all-tgz-path.ts to get all tgz files path
2. Added run-attw-on-tgz.ts to run attw on each tgz filepath
3. Added workflow to run the are-the-types-wrong script

Fixes: hyperledger-cacti#3140

Signed-off-by: ruzell22 <[email protected]>
ruzell22 added a commit to ruzell22/cactus that referenced this issue Oct 8, 2024
Primary Changes
---------------
1. Added get-all-tgz-path.ts to get all tgz files path
2. Added run-attw-on-tgz.ts to run attw on each tgz filepath
3. Added are-the-types-wrong as part of the custom-checks mechanism

Fixes: hyperledger-cacti#3140

Signed-off-by: ruzell22 <[email protected]>
ruzell22 added a commit to ruzell22/cactus that referenced this issue Oct 23, 2024
Primary Changes
---------------
1. Added get-all-tgz-path.ts to get all tgz files path
2. Added run-attw-on-tgz.ts to run attw on each tgz filepath
3. Added are-the-types-wrong as part of the custom-checks mechanism

Fixes: hyperledger-cacti#3140

Signed-off-by: ruzell22 <[email protected]>
ruzell22 added a commit to ruzell22/cactus that referenced this issue Nov 8, 2024
Primary Changes
---------------
1. Added get-all-tgz-path.ts to get all tgz files path
2. Added run-attw-on-tgz.ts to run attw on each tgz filepath
3. Added are-the-types-wrong as part of the custom-checks mechanism

Fixes: hyperledger-cacti#3140

Signed-off-by: ruzell22 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Tasks that are needed but we cannot prioritize them at present. Developer_Experience P4 Priority 4: Low Triage_Needed Triage if the issue is/still relevant, bug report is valid, arch/design details etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants