chore: Replace internal.js shim with explicit export#6632
Conversation
d6cacff to
8a05aa8
Compare
8a05aa8 to
fcd95aa
Compare
| "./INTERNAL_ONLY/test/test-util/create-generator-options": { | ||
| "workspace": { | ||
| "types": "./test/test-util/create-generator-options.ts", | ||
| "default": "./test/test-util/create-generator-options.ts" | ||
| } |
There was a problem hiding this comment.
[q] What is INTERNAL_ONLY?
There was a problem hiding this comment.
For any exported files that requires the workspace condition (not importable directly by third party packages, afaik even transitively), I added this so it's easier to spot in diffs so it does not end up in any of the non-test production code.
There was a problem hiding this comment.
I read up on this. Really nice! What I don't like though, is that you have to import it using "INTERNAL_ONLY". Wouldn't it be nicer to export everything like (aka. directly) this for tests?
I would expect something along the lines of:
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js",
"workspace": {
"types": "./internal.ts",
"default": "./internal.ts"
}
},
"./test/test-util/create-generator-options": {
"workspace": {
"types": "./test/test-util/create-generator-options.ts",
"default": "./test/test-util/create-generator-options.ts"
},I am not even sure you can configure it this way and it would be ok to consider something like this a follow up.
There was a problem hiding this comment.
It doesn't need to have that prefix, but I wanted to make it very visible as tests will also have the condition enabled; and I wanted to ensure that it's not ever imported in production code.
…-ts-shim * origin/main: chore(deps): bump js-yaml from 4.1.1 to 4.2.0 (#6647) chore(deps): bump eslint-plugin-jsdoc from 62.9.0 to 63.0.0 (#6628) chore(deps): bump bignumber.js from 11.1.1 to 11.1.2 (#6644) chore: Set explicit workflow permissions (#6629) chore(deps-dev): bump turbo from 2.9.15 to 2.9.16 (#6645) chore(deps): bump memfs from 4.57.2 to 4.57.3 (#6643) chore(deps): bump eslint-plugin-prettier from 5.5.5 to 5.5.6 (#6641) chore(deps-dev): bump eslint from 10.4.0 to 10.4.1 (#6642) chore(deps-dev): bump @sap/cds-dk from 9.9.1 to 9.9.2 (#6640)
This reverts commit 78d508c.
8b88100 to
10dc040
Compare
…-ts-shim * origin/main: chore: Remove node 20 from build matrix (#6662) chore(deps-dev): bump @types/node from 22.19.19 to 22.19.20 (#6660) chore(deps): bump bignumber.js from 11.1.2 to 11.1.3 (#6659) chore(deps): bump github/codeql-action from 4.36.1 to 4.36.2 (#6658) chore(deps): bump rtCamp/action-slack-notify from 2.3.3 to 2.4.0 (#6657) Update dependabot.yml chore(deps): bump semver from 7.8.1 to 7.8.2 (#6656) chore(deps): bump actions/checkout from 6.0.2 to 6.0.3 (#6649) chore(deps): bump @typescript-eslint/parser from 8.60.0 to 8.60.1 (#6654) chore(deps): bump typescript-eslint from 8.60.0 to 8.60.1 (#6651) chore(deps): bump memfs from 4.57.3 to 4.57.6 (#6655) chore(deps): bump axios from 1.16.1 to 1.17.0 (#6653) chore(deps): bump eslint-plugin-jsdoc from 63.0.0 to 63.0.1 (#6652) chore(deps): bump eslint-import-resolver-typescript from 4.4.4 to 4.4.5 (#6650) chore(deps): bump github/codeql-action from 4.36.0 to 4.36.1 (#6648)
…-ts-shim * origin/main: chore: Discover git-hashes in multi-line release notes (#6621) chore(deps-dev): bump eslint from 10.4.1 to 10.5.0 (#6680) chore(deps): bump memfs from 4.57.6 to 4.57.7 (#6678) chore(deps-dev): bump turbo from 2.9.16 to 2.9.18 (#6677) chore: Improve performance of `check-pr` (#6664) chore: change long workflow name (#6676) chore(deps): bump prettier from 3.8.3 to 3.8.4 (#6672) chore(deps): bump @typescript-eslint/parser from 8.60.1 to 8.61.0 (#6671) chore: Fix pnpm lockfile (#6675) chore(deps-dev): bump @types/node from 22.19.20 to 22.19.21 (#6669) chore(deps): bump semver from 7.8.2 to 7.8.4 (#6667) chore(deps): bump typescript-eslint from 8.60.1 to 8.61.0 (#6668) chore(deps): bump eslint-plugin-jsdoc from 63.0.1 to 63.0.2 (#6665) chore: delete blackduck.yml (#6661)
…-ts-shim * origin/main: chore(deps): bump fast-xml-parser from 5.9.2 to 5.9.3 (#6700) chore(deps): bump semver from 7.8.4 to 7.8.5 (#6696) chore(deps): bump yargs from 17.7.2 to 17.7.3 (#6697) chore(deps): bump @typescript-eslint/parser from 8.61.0 to 8.61.1 (#6692) chore(deps): bump eslint-plugin-jsdoc from 63.0.2 to 63.0.6 (#6693) chore(deps): bump axios from 1.17.0 to 1.18.0 (#6691) chore(deps): bump typescript-eslint from 8.61.0 to 8.61.1 (#6690) chore(deps): bump bignumber.js from 11.1.3 to 11.1.4 (#6689) chore(deps): bump fast-xml-parser from 5.8.0 to 5.9.2 (#6688) chore(deps-dev): bump http-proxy-middleware from 3.0.5 to 3.0.7 (#6686) chore: Resolve audit warnings (#6683) chore(setup): Assume availability of registry mirror in more cases (#6682) chore(deps-dev): bump multer from 2.1.1 to 2.2.0 (#6685) chore: Remove `puppeteer` and fix `npm-stats` script (#6646)
internal.jsshims which can cause issues with swc and move to dedicated export map./nested/importswhere necessary add conditional exports (INTERNAL_ONLY/export/name) tied to a newworkspacecondition and enable in projecttsconfigandjestjestmockingmoduleResolutionsnccdoes not support conditions, move torolldown(configured viatest-utilpackage helper)rolldownto rewrite__filenameand__dirnametoimport.meta.*, removing the need for excluding these from the bundle with nested imports.prettieron generated.github/actionsto avoid slowdownCloses https://github.com/SAP/ai-sdk-js-backlog/issues/576