Skip to content

[pull] master from rollup:master#132

Open
pull[bot] wants to merge 653 commits intoMichaelDeBoey:masterfrom
rollup:master
Open

[pull] master from rollup:master#132
pull[bot] wants to merge 653 commits intoMichaelDeBoey:masterfrom
rollup:master

Conversation

@pull
Copy link

@pull pull bot commented May 1, 2021

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull bot added ⤵️ pull merge-conflict Resolve conflicts manually labels May 1, 2021
@shellscape shellscape force-pushed the master branch 18 times, most recently from 486cc69 to 34ba4ce Compare July 16, 2021 14:41
@shellscape shellscape force-pushed the master branch 2 times, most recently from 5d30e6f to 1a40963 Compare October 19, 2021 22:39
@shellscape shellscape force-pushed the master branch 2 times, most recently from dd51665 to cb34f90 Compare April 13, 2022 19:09
@lukastaegert lukastaegert force-pushed the master branch 4 times, most recently from e5b66ba to b79dc40 Compare October 8, 2022 04:49
GauBen and others added 30 commits October 4, 2025 12:42
* feat: ensure multi-entry is deterministic

* bump workflows

* undo bump change

---------

Co-authored-by: Andrew Powell <shellscape@users.noreply.github.com>
…port maps; avoid fileURLToPath(null) (#1908)

fix(node-resolve): resolve bare targets of package "imports" using export maps; avoid fileURLToPath(null)\n\n- When an imports mapping points to a bare specifier (e.g. "#foo/*": "@scope/pkg/*"), resolve the target with the full export-map-aware algorithm instead of classic only.\n- Guard against null return to prevent TypeError from fileURLToPath(null).\n- Add test: imports pattern -> bare package that uses exports.\n\nFixes #1907

Co-authored-by: CharlieHelps <charlie@charlielabs.ai>
…d code (#1906)

* feat(babel): add includeChunks/excludeChunks to filter generated-code transforms by manual chunk name; docs + tests

* chore(babel): fix lint in as-output-plugin test (avoid explicit undefined; disable consistent-return for manualChunks)

* ci(workflows): avoid 'git pull' divergence error; use explicit fetch refspecs and default_branch; update Windows to windows-latest

* chore(babel): remove superfluous "new:" inline comment in options destructure

---------

Co-authored-by: CharlieHelps <charlie@charlielabs.ai>
chore(repo): add PR authoring instructions under .charlie/instructions

Co-authored-by: CharlieHelps <charlie@charlielabs.ai>
…er strictRequires (#1909)

* fix(commonjs): avoid hoisting dynamically required node: builtins under strictRequires

- Treat external node: builtins as wrapped requires only when the parent module is wrapped (strictRequires or dynamic require), so requires are left lazy via a __require helper and resolved with createRequire instead of top-level ESM imports.
- Add getExternalBuiltinRequireProxy to emit a proxy that exports a lazy __require for builtins.
- Keep non-strict behavior unchanged to preserve existing unresolved-import warnings (e.g., require("path")).
- Add test: strict-requires-external-node-builtin.

* style(commonjs): inline node: builtin check per review (no single-use var)

---------

Co-authored-by: CharlieHelps <charlie@charlielabs.ai>
* fix(commonjs): avoid null access to moduleSideEffects for wrapped externals\n\n- Guard  returning null (e.g., for external Node built-ins) when computing .\n- Default to treating as side-effectful when info is unavailable; preserves Rollup tri-state when available.\n- Keeps per-dependency metadata in sync when forcing wrapped CJS for Node built-ins under strictRequires.

* test(commonjs): add regression for wrapped external Node built-ins under strictRequires

- New fixture: module-side-effects-external-node-builtin-wrapped
- Ensures transform doesn’t crash when resolving moduleSideEffects for wrapped externals
- Provides __filename in test context to avoid env-dependent failures

Refs #1913

---------

Co-authored-by: CharlieHelps <charlie@charlielabs.ai>
* feat(typescript): honor allowJs and transform .js files\n\n- Expand default include to JS/JSX/MJS/CJS when  is enabled\n- Avoid TS5055 by redirecting JS emit to a temp outDir when none is set\n- Add tests for downleveling JS (direct entry and TS->JS import)\n- Document behavior in README

* feat(typescript): auto-include JS when allowJs is set; use temp outDir and clean up\n\n- Use brace expansion in default include glob\n- Create per-build temp outDir under os.tmpdir(), exclude it from filter, and remove on build end\n- Document behavior in README

* fix(typescript): exclude effective outDir from filter to avoid re-processing outputs\n\n- Exclude user-configured or auto temp outDir from the plugin filter\n- Guard against excluding sources when outDir contains the filter root (e.g., outDir='.' with rootDir='src')\n\nImplements review feedback to avoid feedback loops with allowJs and user outDir.

* fix(typescript): use path.relative for robust outDir containment check

- Replace brittle startsWith-based check with path.relative to detect containment
- Address ESLint prefer-template with template literal

Refs #1920

* test(typescript): add regression ensuring user-configured outDir is excluded with allowJs

* fix(typescript): gate temp outDir cleanup to non-watch; cleanup in closeWatcher; harden outDir exclusion\n\n- Clean temp outDir only when not watching; perform final cleanup in closeWatcher to avoid watch-mode churn\n- Robust containment check for excluding outDir using drive-root equality + path.relative + !isAbsolute (handles Windows cross-drive)\n- When filterRoot=false, use CWD fallback for containment to avoid over-excluding sources (e.g., outDir='.')\n- Docs: clarify cleanup timing in README (non-watch vs watch)

* test(typescript): harden user outDir exclusion test (robust path check, guaranteed cleanup)

* fix(typescript): robust outDir containment; gate temp outDir cleanup in watch mode\n\n- Guard containment with cross-drive root check and absolute-relative detection\n- Skip over-exclusion when filterRoot is false by falling back to process.cwd()\n- Delete temp outDir only for non-watch builds; clean up in closeWatcher for watch\n- Docs: clarify effective outDir exclusion and watch-mode cleanup timing\n\nRefs #1920

# Conflicts:
#	packages/typescript/README.md
#	packages/typescript/src/index.ts

* test(typescript): make isInside helper treat equal path as inside; mirror plugin containment semantics

* test(typescript): remove REBUILD_WITH_WATCH_OFF from incremental-watch-off fixture

Drop the unused export from the fixture. It was only there to force a change and is no longer needed. No behavior change; keeps the test fixture minimal and avoids pointless noise.

* fix(typescript): guard string-only filterRoot base; close watch program on shutdown\n\n- Treat only string values of  as a base path; fall back to tsconfig  otherwise to avoid resolving boolean  to 'true'\n- Align 's  option with the same guard to prevent passing non-string truthy values\n- Close the TypeScript watch program in  to release resources in watch mode\n\nRefs #1920

* fix(typescript): normalize Windows drive roots in containment; exclude node_modules by default when auto‑including JS\n\n- Normalize drive‑letter case when comparing roots in outDir containment (win32)\n- When allowJs expands include and user did not set include/exclude, add '**/node_modules/**' to exclude to avoid transforming third‑party code\n\nRefs #1920

* docs(typescript): note default node_modules exclusion when allowJs expands include

* fix(typescript): default filter resolve to cwd when rootDir unset\n\n- Align runtime with README for  default:  when  is not a string and resolution is enabled\n- Prevents  from receiving  base in edge configs\n\nRefs #1920

* refactor(typescript): centralize temp outDir cleanup into a helper

- Deduplicate try/catch cleanup in buildEnd and closeWatcher via local function
- No behavior change; preserves watch vs non-watch cleanup semantics

Refs #1920

* refactor(typescript): unify program close + temp outDir cleanup via helper

- Add local closeProgramAndCleanup() that always cleans in finally
- Use in buildEnd (non-watch) and closeWatcher (watch)

Refs #1920

---------

Co-authored-by: CharlieHelps <charlie@charlielabs.ai>
…#1923)

* feat(typescript): expose latest Program to transformers in watch mode\n\n- Add optional getProgram to ProgramTransformerFactory.factory\n- Pass getProgram() to program-scoped transformer factories\n- Recompute custom transformers after each TS watch rebuild\n- Docs: document getProgram and watch-mode behavior\n- Test: ensure factories are recreated and getProgram returns the latest Program

* test(typescript): close bundle in new watch-mode transformer test; refactor customTransformers for clearer lazy initialization

* test(typescript): add watch-mode test for typeChecker factories; tidy emitted-file cleanup in program test

* fix(typescript): replace runtime undefined with void 0 in new code\n\n- watchProgram: use void 0 when resetting cached transformers in watch mode\n- tests: use void 0 in new watch-mode transformer test to satisfy no-undefined\n\nRefs PR #1923 review feedback from @shellscape

* feat(typescript): add `recreateTransformersOnRebuild` option; default to legacy watch behavior\n\n- Gate watch-mode transformer recreation behind new option (default false)\n- Plumb option through plugin options -> watch host\n- Types/README: document option and clarify `getProgram` semantics\n- Tests: enable option for watch-mode freshness tests

* test(typescript): add legacy-behavior regression and format via ESLint

* docs(typescript): clarify getProgram getter semantics; fix typos in README (its/TypeScript factory, below)

* fix(typescript): strict boolean normalization for recreateTransformersOnRebuild\n\nUse === true instead of Boolean(...) to avoid enabling the option for truthy strings in JS configs. Refs PR #1923 review by @shellscape.

---------

Co-authored-by: CharlieHelps <charlie@charlielabs.ai>
…1928)

* ci(workflows): run validate/windows only on pull_request to avoid double runs\n\n- Remove redundant push triggers that caused duplicate runs for internal PR branches\n- Release workflow continues to handle push to master after merge\n\nresolves #1927

* ci(workflows): add workflow_dispatch to validate and windows workflows as requested\n\n- Allow manual runs via Actions UI on both workflows\n- Keep duplicate-run avoidance by staying PR-only; no concurrency added\n\nRefs #1927, follow-up to PR review by @shellscape

---------

Co-authored-by: CharlieHelps <charlie@charlielabs.ai>
…1930)

fix(commonjs): handle `node:` builtins correctly with `strictRequires: auto`
* chore(repo): add explicit eslint dependency

The root workspace was missing an eslint dependency, but was
invoking the eslint CLI directly in the scripts. Make the
dependency explicit.

* fix(eslint): switch flat config to .mjs in test

The parent package hasn't opt in to ES modules, which breaks on
Node.js v18:

    (node:5286) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.

* feat(eslint): add support for ESLint v9

Update package.json to make eslint a peerDependency, so that the
user has control over which version to pick. Move the existing
eslint dependency to devDependencies so that tests work as expected.

Introduce a new test to ensure the plugin works with ESLint v9. To
do so without breaking v8 tests, install ESLint v9 under a different
alias, and use an ESM import mocking library to override the "eslint"
import.

The current directory needs to be changed during the ESLint v9 test
so that ESLint finds its config file properly. This requires ava
workerThreads to be disabled:

    TypeError [ERR_WORKER_UNSUPPORTED_OPERATION]: process.chdir() is not supported in workers
* feat(alias)!: ESM only; tsc-only build; Node >=20.19.0 and Rollup >=4\n\n- Convert @rollup/plugin-alias to ESM-only with "type": "module" and exports { import, types } to dist\n- Drop Rollup from package build; build with tsc to dist (JS, d.ts, and maps)\n- Raise engines.node to >=20.19.0 and peer rollup to >=4.0.0; keep dev rollup for tests\n- Inline and export public types from src; remove hand-authored types/\n- Add shared .config/{tsconfig.base.json,tsconfig.plugin.json,vitest.config.ts}\n- Switch tests to Vitest (TypeScript), import from ~package, drop CJS branch\n- Update CONTRIBUTING: Vitest + ~package alias + snapshots\n- Bump workspace TypeScript and @types/node; install Vitest at the root

* chore(alias): address self-review feedback\n\n- Keep library maps out of published package\n- Normalize backslashes reliably in warning test\n- Retain function-only ResolverFunction mapping for Rollup hook typing\n- Remove tsconfig baseUrl/paths from build tsconfig (alias is runtime via Vitest)

* chore(alias): address review feedback\n\n- tests: close Rollup bundle in helper to avoid leaks/flakes\n- types: narrow MapToFunction to explicit callable form (avoid global Function)

* merge: resolve conflicts in alias types/tests; adopt robust bundle close in tests

* chore(repo): use .mts for shared Vitest config; update alias test script/docs

- Rename .config/vitest.config.ts -> .config/vitest.config.mts per review
- Update packages/alias test script to reference .mts
- Update CONTRIBUTING to mention .mts config

* chore(alias): fix ci:test to use Vitest reporter instead of unsupported --verbose

* chore(repo): use pnpm catalog for TypeScript and align alias (typescript -> catalog:)

- Add default catalog in pnpm-workspace.yaml: typescript ^5.9.3\n- Update packages/alias to reference catalog for TypeScript\n- Bump packageManager to pnpm@9.5.0 to support catalogs

* chore(repo): use pnpm catalog for TypeScript in root package.json

---------

Co-authored-by: CharlieHelps <charlie@charlielabs.ai>
* chore(repo): add ESM-only upgrade playbook for plugin packages\n\nRefs #1933

* docs(playbook): map exports via '.' and add tsconfig symlink step

- Use explicit . export with types/import (+default) for compatibility
- Replace tsconfig JSON example with symlink to .config/tsconfig.plugin.json
- Update verify jq path and add symlink check
- Clarify package.json files note and prefer .npmignore for maps

* docs(playbook): clarify files negation and simplify rollback\n\n- Instruct to remove '!dist/**/*.map' if present in package.json (negation unsupported)\n- Keep only modern 'git restore -SW ' in rollback section

* docs(playbook): add JS→TS and AVA→Vitest conversion order\n\n- Always convert JS in src to TS\n- Never convert fixtures to TS\n- Always convert JS in test to TS\n- Run AVA after JS→TS + package.json changes; then convert to Vitest and run Vitest thereafter\n\nRefs #1933

* docs(playbook): prefer import.meta.dirname/filename over URL utilities\n\n- Node >=20.11 supports import.meta.dirname and import.meta.filename; prefer them\n- Keep URL utilities as a fallback for non-file URLs or special cases

* docs(playbook): always publish source maps; drop .npmignore/disable-map guidance

- Remove suggestion to exclude dist/**/*.map via .npmignore
- Remove suggestion to disable sourceMap/declarationMap via tsconfig
- Add explicit note to keep maps published and remove any existing exclusions

Refs #1934

---------

Co-authored-by: CharlieHelps <charlie@charlielabs.ai>
…1938)

* fix(replace): update delimiters to respect valid js identifier chars

* test: update snapshots
…1937)

* Initial plan

* Add requireNodeBuiltins option to control createRequire injection

Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>

* Address code review feedback - use explicit boolean checks

Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>

* Add requireNodeBuiltins: false variant tests for 3 fixtures

Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>

* Generate snapshots for requireNodeBuiltins: false variant tests

Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⤵️ pull merge-conflict Resolve conflicts manually

Projects

None yet

Development

Successfully merging this pull request may close these issues.