-
Notifications
You must be signed in to change notification settings - Fork 51
Release 5.6.0 #273
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
Release 5.6.0 #273
Changes from all commits
11e71cb
3f2abeb
ce3a14d
bf8df9d
97b9c82
8789875
f88818d
6e5ab0c
46cff7f
9bfb0a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # CodeGraph data files — local to each machine, not for committing. | ||
| # Ignore everything in .codegraph/ except this file itself, so transient | ||
| # files (the database, daemon.pid, sockets, logs) never show up in git. | ||
| * | ||
| !.gitignore |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,11 @@ | ||
| node_modules | ||
| build | ||
| __tests__/**/*.json | ||
| # Subpath facades generated by scripts/generate-resolver-facades.js | ||
| /helpers.js | ||
| /helpers.d.ts | ||
| /constants.js | ||
| /constants.d.ts | ||
| /models.d.ts | ||
| /publicReportingAPI.js | ||
| /publicReportingAPI.d.ts |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Dev Guide | ||
|
|
||
| Internal notes for contributors. This content is intentionally kept out of | ||
| README.md, which is published to package registries. | ||
|
|
||
| ## Subpath facades | ||
|
|
||
| `npm run build` compiles to `build/` and then runs `scripts/generate-resolver-facades.js`, | ||
| which writes a one-line re-export at each public subpath alias — `helpers.js`, | ||
| `constants.js`, `publicReportingAPI.js` — together with matching `.d.ts` files. `models` only | ||
| gets a `.d.ts` facade: `src/models/**` is TypeScript types with no runtime value (confirmed — | ||
| the compiled `build/models/*.js` files are all empty `__esModule` stubs), so | ||
| `package.json#exports["./models"]` has no `import` / `require` condition. Node enforces that | ||
| regardless of whether a `.js` file physically exists at the root, so writing one would just be | ||
| misleading. If a consumer's TypeScript setup runs with `isolatedModules` and they import from | ||
| `models` without `import type`, they'll now get `ERR_PACKAGE_PATH_NOT_EXPORTED` at runtime | ||
| instead of a silently-empty object — that's intentional; there are no known consumers of this | ||
|
Comment on lines
+15
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🌐 Web query:
💡 Result: No, isolatedModules alone does not control whether an import used only as a type is preserved or elided in the emitted JavaScript [1]. The isolatedModules flag is primarily designed to ensure that your code can be correctly transpiled by single-file transpilers (like Babel or SWC) that lack access to type information [1][2][3]. When isolatedModules is enabled, it forces you to use explicit syntax—such as import type or the type modifier—to distinguish type-only imports from value imports, because these transpilers cannot determine if an import is a type or a value on their own [1][2]. The runtime behavior of imports (whether they are preserved or elided in the emitted JavaScript) is instead controlled by options specifically designed for module elision, such as verbatimModuleSyntax [4][2]. Here is how the control mechanisms work: 1. verbatimModuleSyntax (Recommended): This is the modern, preferred option (introduced in TypeScript 5.0) that replaces and simplifies the older flags [4][2][5]. Under verbatimModuleSyntax, TypeScript emits imports and exports exactly as written in your source code, except for anything marked with the type modifier, which is dropped entirely [4][2][6]. It effectively makes the runtime behavior of imports explicit based on whether you use the type modifier [2][6]. 2. importsNotUsedAsValues (Deprecated): This older flag was used to control whether imports that were only referenced as types were emitted or removed [7]. It offered options such as remove (the default, which elides them) and preserve (which kept them as side-effect imports) [7]. Because verbatimModuleSyntax provides a more consistent and predictable approach to handling module elision, it has superseded both importsNotUsedAsValues and preserveValueImports, both of which are now deprecated [4][5][8]. If you are using verbatimModuleSyntax, you do not need—and should not use—the deprecated flags [8]. Citations:
🏁 Script executed: #!/bin/bash
printf '%s\n' '--- DEV_GUIDE.md ---'
cat -n DEV_GUIDE.md | sed -n '1,45p'
printf '%s\n' '--- repository manifests and TypeScript configs ---'
git ls-files | grep -E '(^|/)(package\.json|tsconfig[^/]*\.json|pnpm-workspace\.yaml|yarn\.lock|package-lock\.json|\.npmrc)$' | sort
printf '%s\n' '--- relevant configuration references ---'
rg -n --glob 'package.json' --glob 'tsconfig*.json' --glob '.npmrc' --glob 'DEV_GUIDE.md' \
'typescript|isolatedModules|verbatimModuleSyntax|importsNotUsedAsValues|preserveValueImports|models|type-only|import type' .Repository: reportportal/client-javascript Length of output: 4792 🏁 Script executed: #!/bin/bash
printf '%s\n' '--- package.json relevant sections ---'
cat -n package.json | sed -n '1,145p'
printf '%s\n' '--- tsconfig.json ---'
cat -n tsconfig.json
printf '%s\n' '--- related source and build-script references ---'
rg -n 'from ['"'"'"'"'"']?[^'"'"'"'"'"']*models|models/|isolatedModules|importsNotUsedAsValues|verbatimModuleSyntax|generate-resolver-facades' \
--glob '*.ts' --glob '*.js' --glob '*.json' --glob '*.md' .Repository: reportportal/client-javascript Length of output: 9042 Qualify the
🤖 Prompt for AI Agents |
||
| brand-new subpath yet, so this is the cheapest point to make the contract strict. If a genuine | ||
| runtime value ever needs to live under `models`, move it to `constants/` (like `MERGE_TYPES`, | ||
| which used to live here) instead of adding a runtime condition back. | ||
|
|
||
| Supported package imports resolve through the `exports` / `typesVersions` maps in | ||
| `package.json` straight to `build` for Node, TypeScript and bundlers; these files are never | ||
| on that path. They exist only for tools that resolve imports by walking the filesystem | ||
| instead of reading `exports`, chiefly `eslint-import-resolver-node` (the default resolver of | ||
| `eslint-plugin-import`), which otherwise reports `import/no-unresolved` for these subpath | ||
| imports and forces each consumer to configure an ignore. | ||
|
|
||
| The alias list in the script is intentionally fixed and small — it does not mirror every | ||
| internal module under `build`. Deep `lib/**` imports as published up to 5.5.x (e.g. | ||
| `require('@reportportal/client-javascript/lib/rest')`) resolve via the `exports` map for | ||
| Node, TypeScript and bundlers, but are **not** backed by a physical `lib/**` tree — a | ||
| filesystem-based resolver hitting one of those undocumented deep paths still needs a local | ||
| ignore. If you're bumping a first-party agent past this version and it imports | ||
| `@reportportal/client-javascript/lib/**` directly, switch it to the matching short alias in | ||
| the same PR rather than adding it here. | ||
|
|
||
| Everything the script writes is gitignored and removed by `npm run clean`. It recomputes | ||
| each facade's export style (`export *` vs `export =` vs default) from the real compiled | ||
| module on every build, so it can't silently drift the way a hand-written file could. When | ||
| you add a new top-level subpath to `exports`, add the matching entry to the `ALIASES` map in | ||
| the script. | ||
|
|
||
| ## Code knowledge graph | ||
|
|
||
| This repo carries a local **code knowledge graph** ([colbymchenry/codegraph](https://github.com/colbymchenry/codegraph)) | ||
| that the ReportPortal AI agents (and your own tooling) use to resolve symbols and | ||
| references without scanning raw files. | ||
|
|
||
| ```bash | ||
| npm run codegraph # build it the first time, fast incremental sync after | ||
| npm run codegraph -- --force # rebuild from scratch | ||
| ``` | ||
|
|
||
| The graph lives in `.codegraph/codegraph.db` — it is **gitignored and local to your | ||
| machine** (only `.codegraph/.gitignore` is committed). It is a pure derivative of the | ||
| source, so regenerate it any time. The engine is fetched on demand via `npx`, so there | ||
| is no added project dependency. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 5.5.12 | ||
| 5.5.13-SNAPSHOT |
Uh oh!
There was an error while loading. Please reload this page.