rollup-plugins-c90438a/000077500000000000000000000000001515215015100150375ustar00rootroot00000000000000rollup-plugins-c90438a/.charlie/000077500000000000000000000000001515215015100165245ustar00rootroot00000000000000rollup-plugins-c90438a/.charlie/instructions/000077500000000000000000000000001515215015100212705ustar00rootroot00000000000000rollup-plugins-c90438a/.charlie/instructions/pull-requests.md000066400000000000000000000030341515215015100244370ustar00rootroot00000000000000# Pull Requests: house rules - Always use the repository’s Pull Request (PR) Template. Fill out all sections, including links, context, and checklists. For breaking changes, document the migration clearly in the template. - Always analyze the change for potential breaking changes. If any public API, runtime behavior, defaults, or supported environments change, treat it as breaking. - Always use Conventional Commits format for PR titles: `type(scope): summary`. - Use lowercase `type` and `scope` (e.g., `fix(node-resolve): …`, `feat(babel): …`). - Keep the summary under ~72 characters; be specific and action‑oriented. - For breaking changes, use the bang after the scope and annotate the PR template: - Example: `feat(commonjs)!: drop Node 14 support` - Also mark the PR Template’s breaking‑change section and include migration notes. - Use `chore(repo): …` in PR titles for any PR that does not modify package source code (implementation) — docs, CI, release scripts, templates, configs, repo maintenance. - If a PR is a repository management task (even when it touches a package’s meta files like `package.json`, `.d.ts`, or config), title it with `chore(repo): …`. - Before marking a PR ready for review, run locally: - `pnpm lint` - `pnpm fix:js` Examples - Non‑breaking feature to a plugin: `feat(babel): add includeChunks/excludeChunks` - Breaking change to a plugin: `fix(node-resolve)!: change default resolution for "imports" bare targets` - Repo maintenance: `chore(repo): update PR template and lint settings` rollup-plugins-c90438a/.charlie/playbooks/000077500000000000000000000000001515215015100205275ustar00rootroot00000000000000rollup-plugins-c90438a/.charlie/playbooks/upgrade-plugin-to-esm-only.md000066400000000000000000000150751515215015100261650ustar00rootroot00000000000000# Upgrade a plugin package to ESM-only (packages/) Upgrade a single plugin under `packages/` to publish ESM-only output with TypeScript-emitted JS and declarations. ## Prerequisites - Repo already contains shared config at `.config/tsconfig.base.json` and `.config/tsconfig.plugin.json` and (optionally) `.config/vitest.config.mts` from prior migrations. - Scope constraint: make changes only inside the target package directory (e.g., `packages/alias`). Do not add or edit files outside `packages/`. - Local Node 20.19+ to run builds and tests. ## Steps 1. Identify the target package - Set a shell variable for reuse: `PKG=packages/`. 2. Package metadata: ESM-only and minimums - Edit `$PKG/package.json`: - Set `"type": "module"`. - Replace legacy `main/module/exports.require` with an ESM-only export mapped via the explicit `"."` entry for broad tooling compatibility: ```json { "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js", "default": "./dist/index.js" } }, "types": "./dist/index.d.ts" } ``` - Set minimums: `"engines": { "node": ">=20.19.0" }` and `"peerDependencies": { "rollup": ">=4.0.0" }`. - Keep `rollup` as a devDependency only if tests use it. Otherwise remove it. - Ensure published files include build output and standard docs: ```json "files": ["dist", "README.md", "LICENSE"] ``` Notes: - `package.json` `files` does not support negation patterns. If an existing `package.json` contains "files": [ ..., "!dist/**/*.map", ... ], remove the negated entry—negation is not supported and will be ignored. - Always publish source maps. Do not exclude `dist/**/*.map` via `.npmignore`, and do not disable `sourceMap`/`declarationMap` for published packages. If a package currently excludes maps (via `.npmignore` or tsconfig), remove those exclusions so maps are included. 3. Build scripts: TypeScript emit to dist - Prefer a tsc-only build for packages that do not need bundling: - In `$PKG/package.json`, set scripts: ```json "prebuild": "del-cli dist", "build": "tsc --project tsconfig.json", "pretest": "pnpm build", "prerelease": "pnpm build", "prepare": "if [ ! -d 'dist' ]; then pnpm build; fi" ``` - If this package still needs bundling for tests/examples, keep its Rollup config but point inputs at the TypeScript output in `dist/` instead of sources. 4. TypeScript config: use the shared plugin config (symlink) - Replace any existing `$PKG/tsconfig.json` with a symlink to the shared plugin config (`.config/tsconfig.plugin.json`), which already enables emit to `dist/` and declaration maps: ```bash # from repo root ln -snf ../../.config/tsconfig.plugin.json "$PKG/tsconfig.json" git add "$PKG/tsconfig.json" ``` On Windows PowerShell, you can run: ```powershell # from repo root $pkg = 'packages/' New-Item -ItemType SymbolicLink -Path "$pkg/tsconfig.json" -Target (Resolve-Path ".config/tsconfig.plugin.json") -Force git add "$pkg/tsconfig.json" ``` The shared config content lives at `.config/tsconfig.plugin.json`. - Delete any package-local `rollup` build scripts that produced CJS, and remove any `types/` folder if declarations were hand-authored (they will now be generated). 5. Source: convert to pure ESM and modern Node APIs - Replace `require`, `module.exports`, and `__dirname` patterns with ESM equivalents. - Use `node:` specifiers for built-ins (e.g., `import path from 'node:path'`). - Prefer the latest ES APIs: use `import.meta.dirname` and `import.meta.filename` (Node ≥20.11) instead of re‑creating them via `fileURLToPath`. ```ts import path from 'node:path'; const here = import.meta.dirname; // const file = import.meta.filename; const pkgJson = path.join(here, 'package.json'); ``` Use URL utilities only when specifically needed (e.g., for non‑file module URLs): `fileURLToPath(new URL('.', import.meta.url))`. - Inline and export public types from `src/index.ts`; avoid separate `types/` unless unavoidable. - Conversion rules for file types: - Always convert any `.js` in `src/` to `.ts`. - Never convert files in test `fixtures/` to TypeScript—keep fixtures exactly as authored. - Always convert any `.js` in `test/` to `.ts` (test sources only; exclude `test/**/fixtures/**`). 6. Tests: order of operations (AVA → Vitest) and ESM - Remove CJS-specific branches/assertions from tests. - Follow this sequence for reliability: 1. After JS→TS conversion in `src/` and `test/` and after any `package.json` changes, always run the AVA test suite. 2. Only after verifying AVA tests run without modifications, convert the AVA tests to Vitest. 3. After converting tests to Vitest, always run the Vitest suite after any subsequent `src/` change. - Note: If a package already uses Vitest, start at step 3 and skip AVA‑specific steps. - Ensure Rollup bundles created in tests are `await bundle.close()`-d to avoid leaks. 7. Clean up package artifacts - Remove obsolete files that are no longer used by ESM-only publishing (examples): - `$PKG/rollup.config.*` if switching to tsc-only. - `$PKG/types/**` once declarations are generated to `dist/`. ## Verify - Build succeeds and emits JS and d.ts to `dist/`: ```bash pnpm -C $PKG build tree $PKG/dist | sed -n '1,80p' ``` - Symlink exists and points at the shared config: ```bash test -L "$PKG/tsconfig.json" && ls -l "$PKG/tsconfig.json" || (echo "tsconfig.json symlink missing" && exit 1) ``` - Type declarations resolve for consumers: ```bash jq -r '.types, .exports["."].types, .exports["."].import' $PKG/package.json ``` - Runtime smoke (Node ESM import works): ```bash node -e "import('file://$PWD/$PKG/dist/index.js').then(() => console.log('ok'))" ``` - Tests pass for the package (runner may be AVA or Vitest depending on the package): ```bash pnpm -C $PKG test ``` ## Rollback - Revert the package directory to the previous commit (modern Git): ```bash git restore -SW $PKG ``` - If needed, `git reset --hard HEAD~1` when this package’s change is isolated on a feature branch. ## References - Alias migration (ESM-only) — PR #1926: feat(alias)!: ESM only. Update Node and Rollup minimum versions - Task spec used for alias — Issue #1925 - Shared TS configs used by packages — `.config/tsconfig.base.json`, `.config/tsconfig.plugin.json` rollup-plugins-c90438a/.config/000077500000000000000000000000001515215015100163625ustar00rootroot00000000000000rollup-plugins-c90438a/.config/tsconfig.base.json000066400000000000000000000006231515215015100220030ustar00rootroot00000000000000{ "compilerOptions": { "allowSyntheticDefaultImports": true, "esModuleInterop": true, "lib": ["ESNext"], "module": "esnext", "moduleResolution": "bundler", "noEmit": true, "noUnusedLocals": true, "noUnusedParameters": true, "pretty": true, "sourceMap": true, "strict": true, "target": "ES2022" }, "exclude": ["dist", "node_modules", "test/types"] } rollup-plugins-c90438a/.config/tsconfig.plugin.json000066400000000000000000000006311515215015100223660ustar00rootroot00000000000000{ // Important: this config is symlinked into package directories as `tsconfig.json`. // The `extends` path must therefore be relative to the symlink location (e.g. packages//). "extends": "../../.config/tsconfig.base.json", "compilerOptions": { "noEmit": false, "outDir": "dist", "rootDir": "src", "declaration": true, "declarationMap": true }, "include": ["src/**/*"] } rollup-plugins-c90438a/.config/vitest.config.mts000066400000000000000000000007531515215015100216760ustar00rootroot00000000000000import { defineConfig } from 'vitest/config'; import path from 'node:path'; export default defineConfig({ test: { // Store snapshots next to each test in a .snapshots folder resolveSnapshotPath: (testPath, snapExt) => path.join(path.dirname(testPath), '.snapshots', path.basename(testPath) + snapExt) }, resolve: { // Allow importing the current package under test via `~package` alias: [{ find: /^~package$/, replacement: path.resolve(process.cwd()) }] } }); rollup-plugins-c90438a/.editorconfig000066400000000000000000000004551515215015100175200ustar00rootroot00000000000000# editorconfig.org root = true [*] charset = utf-8 indent_style = space indent_size = 2 end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true [*.md] insert_final_newline = true trim_trailing_whitespace = false [README.md] max_line_length = 170 [*.yml] max_line_length = 500 rollup-plugins-c90438a/.eslintignore000066400000000000000000000010021515215015100175330ustar00rootroot00000000000000.eslintrc.js **/dist **/node_modules **/test/**/output packages/commonjs/test/fixtures packages/typescript/test/fixtures/syntax-error packages/eslint/test/fixtures/flat-config # temporary workaround for eslint bug where package.json is a directory packages/node-resolve/test/fixtures/package-json-in-path # temporary workaround for TypeScript as it doesn't support "Arbitrary module namespace identifier names" # https://github.com/microsoft/TypeScript/issues/40594 packages/json/test/fixtures/arbitrary/main.js rollup-plugins-c90438a/.eslintrc.js000066400000000000000000000011371515215015100173000ustar00rootroot00000000000000module.exports = { extends: ['rollup', 'plugin:import/typescript'], parserOptions: { project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'], tsconfigRootDir: __dirname }, rules: { // disabling sort keys for now so we can get the rest of the linting shored up 'sort-keys': 'off', 'typescript-sort-keys/interface': 'off', 'import/extensions': 'off', 'import/no-unresolved': 'off', '@typescript-eslint/consistent-type-imports': 'error' }, overrides: [ { files: ['**/fixtures/**'], rules: { 'no-console': 'off' } } ] }; rollup-plugins-c90438a/.github/000077500000000000000000000000001515215015100163775ustar00rootroot00000000000000rollup-plugins-c90438a/.github/CODE_OF_CONDUCT.md000066400000000000000000000062041515215015100212000ustar00rootroot00000000000000# Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: - Using welcoming and inclusive language - Being respectful of differing viewpoints and experiences - Gracefully accepting constructive criticism - Focusing on what is best for the community - Showing empathy towards other community members Examples of unacceptable behavior by participants include: - The use of sexualized language or imagery and unwelcome sexual attention or advances - Trolling, insulting/derogatory comments, and personal or political attacks - Public or private harassment - Publishing others' private information, such as a physical or electronic address, without explicit permission - Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at TODO. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version] [homepage]: https://contributor-covenant.org [version]: https://contributor-covenant.org/version/1/4/ rollup-plugins-c90438a/.github/CONTRIBUTING.md000066400000000000000000000131601515215015100206310ustar00rootroot00000000000000# Contribute ## Introduction First, thank you for considering contributing to rollup! It's people like you that make the open source community such a great community! 😊 We welcome any type of contribution, not only code. You can help with - **QA**: file bug reports, the more details you can give the better (i.e. [REPL](https://rollupjs.org/repl/)-links or repos that demonstrate the specific issue) - **Marketing**: writing blog posts, howto's, printing stickers, ... - **Community**: presenting the project at meetups, organizing a dedicated meetup for the local community, ... - **Code**: take a look at the [open issues](https://github.com/rollup/plugins/issues). Even if you can't write code, commenting on them, showing that you care about a given issue matters. It helps us triage them. - **Money**: we welcome financial contributions in full transparency on our [open collective](https://opencollective.com/rollup). ## Your First Contribution Working on your first Pull Request? You can learn how from this _free_ series, [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github). ## Submitting code Any code change should be submitted as a pull request. Our guidelines for Pull Requests: - Please fill in our template in its entirety. Please don't reformat it or modify it - The description should explain what the code does and give steps to execute it - The pull request should also contain tests - Before submitting your Pull Request, please lint your changes by running `pnpm lint` in the root directory - If any checks fail for your Pull Request, please resolve them. Always feel free to ask for help if unable to resolve issues with checks ## Testing packages Some packages use Vitest for tests. When converting or running tests locally inside a package directory (e.g. `packages/alias`): - Tests import the package under test via `~package`. A shared config at `.config/vitest.config.mts` provides a runtime alias that resolves `~package` to the current working directory. - Snapshots are written alongside each test under a local `.snapshots` directory. Example (from a package directory): ``` pnpm build pnpm test ``` ## Code review process The bigger the pull request, the longer it will take to review and merge. Try to break down large pull requests in smaller chunks that are easier to review and merge. It is also always helpful to have some context for your pull request. What was the purpose? Why does it matter to you? Does it resolve any known Github issues? Adding a line "resolves #" (e.g. "resolves #23") to the description of your pull request or of a specific commit will automatically close this issue once the pull request is merged. ## Financial contributions We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/rollup). Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed. ## Questions If you require technical assistance, [Stackoverflow](https://stackoverflow.com/questions/tagged/rollupjs) or [Rollup Discord](https://is.gd/rollup_chat) are usually the best places to start. You can also create an [issue](issue) (protip: do a quick search first to see if someone else didn't ask the same question before!). ## Credits ### Contributors Thank you to all the people who have already contributed to rollup! ### Backers Thank you to all our backers! [[Become a backer](https://opencollective.com/rollup#backer)] ### Sponsors Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/rollup#sponsor)) rollup-plugins-c90438a/.github/FUNDING.yml000066400000000000000000000000301515215015100202050ustar00rootroot00000000000000open_collective: rollup rollup-plugins-c90438a/.github/ISSUE_TEMPLATE.md000066400000000000000000000012731515215015100211070ustar00rootroot00000000000000 rollup-plugins-c90438a/.github/ISSUE_TEMPLATE/000077500000000000000000000000001515215015100205625ustar00rootroot00000000000000rollup-plugins-c90438a/.github/ISSUE_TEMPLATE/BUG.md000066400000000000000000000033031515215015100215200ustar00rootroot00000000000000--- name: 🐞 Bug Report about: Something went awry and you'd like to tell us about it. --- - Rollup Plugin Name: - Rollup Plugin Version: - Rollup Version: - Operating System (or Browser): - Node Version: - Link to reproduction _(⚠️ read below)_: ### Expected Behavior ### Actual Behavior ### Additional Information rollup-plugins-c90438a/.github/ISSUE_TEMPLATE/DOCS.md000066400000000000000000000015451515215015100216410ustar00rootroot00000000000000--- name: 📚 Documentation about: Are the docs lacking or missing something? Do they need some new 🔥 hotness? Tell us here. --- - Rollup Plugin Name: - Rollup Plugin Version: Documentation Is: - [ ] Missing - [ ] Needed - [ ] Confusing - [ ] Not Sure? ### Please Explain in Detail... ### Your Proposal for Changes rollup-plugins-c90438a/.github/ISSUE_TEMPLATE/FEATURE.md000066400000000000000000000012171515215015100222000ustar00rootroot00000000000000--- name: ✨ Feature Request about: Suggest an idea for this project --- - Rollup Plugin Name: - Rollup Plugin Version: ### Feature Use Case ### Feature Proposal rollup-plugins-c90438a/.github/ISSUE_TEMPLATE/MODIFICATION.md000066400000000000000000000014171515215015100227540ustar00rootroot00000000000000--- name: 🔧 Modification Request about: Would you like something work differently? Have an alternative approach? This is the template for you. --- - Rollup Plugin Name: - Rollup Plugin Version: ### Expected Behavior / Situation ### Actual Behavior / Situation ### Modification Proposal rollup-plugins-c90438a/.github/ISSUE_TEMPLATE/NEW_PLUGIN.md000066400000000000000000000024301515215015100226120ustar00rootroot00000000000000--- name: 🔌 New Plugin Request about: Request a new Core plugin --- Request Checklist: - [ ] I have searched https://npmjs.com/ before opening this issue - [ ] I have searched https://github.com/rollup/awesome before opening this issue ### New Plugin Use Case ### New Plugin Proposal rollup-plugins-c90438a/.github/ISSUE_TEMPLATE/SUPPORT.md000066400000000000000000000011231515215015100222550ustar00rootroot00000000000000--- name: 🆘 Support, Help, and Advice about: 👉🏽 Need help or tech support? Please don't open an issue! Head to https://is.gd/rollup_chat or https://stackoverflow.com/questions/tagged/rollupjs. --- Hey there! If you need help or tech support then this is not the place to ask. Please head to the [Rollup Discord](https://is.gd/rollup_chat) instead or post a question to https://stackoverflow.com/questions/tagged/rollupjs. If you arrived here because you think Rollup's documentation is unclear, insufficient or wrong, please consider creating an issue for the documentation instead. rollup-plugins-c90438a/.github/PULL_REQUEST_TEMPLATE.md000066400000000000000000000033001515215015100221740ustar00rootroot00000000000000 ## Rollup Plugin Name: `{name}` This PR contains: - [ ] bugfix - [ ] feature - [ ] refactor - [ ] documentation - [ ] other Are tests included? - [ ] yes (_bugfixes and features will not be merged without tests_) - [ ] no Breaking Changes? - [ ] yes (_breaking changes will not be merged unless absolutely necessary_) - [ ] no If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking. List any relevant issue numbers: ### Description rollup-plugins-c90438a/.github/deprecation-messages.txt000066400000000000000000000005711515215015100232450ustar00rootroot00000000000000"This package has been deprecated and is no longer maintained. Please use @rollup/plugin-." # Moved This package has moved and is now available at [@rollup/plugin-](https://github.com/rollup/plugins). Please update your dependencies. This repository is no longer maintained. This package has moved and is now available at @rollup/plugin- / https://github.com/rollup/plugins rollup-plugins-c90438a/.github/labels.json000066400000000000000000000047161515215015100205440ustar00rootroot00000000000000[ { "name": "💩 template incomplete", "color": "#4E342E" }, { "name": "💩 template removed", "color": "#4E342E" }, { "name": "b¹ 🐞 code-splitting", "color": "#F44336" }, { "name": "b² 🐞 scope-hoisting", "color": "#F44336" }, { "name": "b³ 🐞 tree-shaking", "color": "#F44336" }, { "name": "c¹ ⋅ discussion", "color": "#1976D2" }, { "name": "c² ⋅ feedback wanted", "color": "#F9A825" }, { "name": "c³ ⋅ PR welcome", "color": "#1B5E20" }, { "name": "c⁴ ⋅ need more info", "color": "#6A1B9A" }, { "name": "c⁵ ⋅ question", "color": "#C2185B" }, { "name": "c⁶ ⋅ request for comments", "color": "#BBDEFB" }, { "name": "p¹ ⋅ browser", "color": "#B2DFDB" }, { "name": "p² ⋅ linux", "color": "#B2DFDB" }, { "name": "p³ ⋅ mac", "color": "#B2DFDB" }, { "name": "p⁴ ⋅ windows", "color": "#B2DFDB" }, { "name": "pr¹ 🔧 chore", "color": "#D7CCC8" }, { "name": "pr² 🔧 docs", "color": "#D7CCC8" }, { "name": "pr³ 🔧 feature", "color": "#D7CCC8" }, { "name": "pr⁴ 🔧 fix", "color": "#D7CCC8" }, { "name": "pr⁵ 🔧 performance", "color": "#D7CCC8" }, { "name": "pr⁶ 🔧 refactor", "color": "#D7CCC8" }, { "name": "pr⁷ 🔧 style", "color": "#D7CCC8" }, { "name": "pr⁸ 🔧 test", "color": "#D7CCC8" }, { "name": "s¹ 🔥🔥🔥 critical", "color": "#E53935" }, { "name": "s² 🔥🔥 important", "color": "#FB8C00" }, { "name": "s³ 🔥 nice to have", "color": "#FDD835" }, { "name": "s⁴ 💧 low", "color": "#039BE5" }, { "name": "s⁵ 💧💧 inconvenient", "color": "#c0e0f7" }, { "name": "t¹ 🐞 bug", "color": "#F44336" }, { "name": "t² 📚 documentation", "color": "#FDD835" }, { "name": "t³ ✨ enhancement", "color": "#03a9f4" }, { "name": "t⁴ ⋅ regression", "color": "#0052cc" }, { "name": "t⁵ ⋅ todo", "color": "#311B92" }, { "name": "t⁶ ⋅ waiting on upstream", "color": "#0D47A1" }, { "name": "v¹ ⋅ major", "color": "#CDDC39" }, { "name": "v² ⋅ minor", "color": "#FF9800" }, { "name": "v³ ⋅ minor (experimental)", "color": "#FFC107" }, { "name": "x¹ ⋅ abandoned", "color": "#CFD8DC" }, { "name": "x² ⋅ could not reproduce", "color": "#CFD8DC" }, { "name": "x³ ⋅ duplicate", "color": "#CFD8DC" }, { "name": "x⁴ ⋅ hold", "color": "#CFD8DC" }, { "name": "x⁵ ⋅ in progress", "color": "#4CAF50" }, { "name": "x⁶ ⋅ invalid", "color": "#CFD8DC" }, { "name": "x⁷ ⋅ wontfix", "color": "#CFD8DC" } ] rollup-plugins-c90438a/.github/stale.yml000066400000000000000000000015471515215015100202410ustar00rootroot00000000000000# all settings listed here - https://github.com/probot/stale#usage daysUntilStale: 60 daysUntilClose: 1 exemptAssignees: true # use this property to disable stale bot when we apply the wontfix label, prevents users from playing stale bot ping pong and keeping an issue open with no intent of action exemptLabels: - x⁸ ⋅ wontfix - x⁴ ⋅ hold only: issues staleLabel: x⁷ ⋅ stale markComment: false closeComment: > Hey folks. This issue hasn't received any traction for 60 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it. [ⓘ](https://github.com/probot/stale#is-closing-stale-issues-really-a-good-idea) rollup-plugins-c90438a/.github/workflows/000077500000000000000000000000001515215015100204345ustar00rootroot00000000000000rollup-plugins-c90438a/.github/workflows/node-windows.yml000066400000000000000000000026001515215015100235720ustar00rootroot00000000000000name: Windows on: pull_request: types: - edited - opened - synchronize workflow_dispatch: jobs: build: runs-on: windows-latest strategy: matrix: node: ['24', '20'] name: Node v${{ matrix.node }} steps: - name: Configure git line-breaks run: git config --global core.autocrlf false - name: Checkout Commit uses: actions/checkout@v4 with: fetch-depth: 2 - name: Update Master shell: bash run: | # Ensure the remote-tracking ref exists and is up-to-date without invoking an implicit merge set -euo pipefail # Ensure the remote-tracking ref and local branch ref are up-to-date without invoking an implicit merge DEFAULT_BRANCH="${{ github.event.repository.default_branch }}" git fetch --no-tags --force origin \ "+refs/heads/${DEFAULT_BRANCH}:refs/remotes/origin/${DEFAULT_BRANCH}" \ "+refs/heads/${DEFAULT_BRANCH}:refs/heads/${DEFAULT_BRANCH}" - name: Setup Node uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} - name: Install PNPM uses: pnpm/action-setup@v4 - name: pnpm install run: pnpm install --ignore-scripts - name: run tests run: pnpm --workspace-concurrency 1 --filter "...[origin/master]" ci:test rollup-plugins-c90438a/.github/workflows/pr-title.yml000066400000000000000000000013521515215015100227200ustar00rootroot00000000000000name: Pull Request Title Format on: pull_request: branches: - '*' types: - opened - reopened - edited - synchronize jobs: prTitle: name: Check runs-on: ubuntu-latest steps: - name: Check PR Title uses: clowdhaus/actions/pr-title@v0.1.0 with: on-fail-message: "Your PR title doesn't match the required format. The title should be in the conventional commit (https://www.conventionalcommits.org/en/v1.0.0-beta.4/) format. e.g.\n\n```\nchore(plugin-name): add pr title workflow\n```" title-regex: '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(([*]|[\w|,|\-|\|]+)\))?(!)?\:\s.*' github-token: ${{ secrets.GITHUB_TOKEN }} rollup-plugins-c90438a/.github/workflows/release.yml000066400000000000000000000072021515215015100226000ustar00rootroot00000000000000name: Release Packages on: push: branches: - master permissions: # Jobs requiring OIDC (e.g., npm publish) must request `id-token: write` at the job level. contents: read pages: write jobs: publish: # let's ignore release commits, otherwise it'll try to run twice if: | !startsWith(github.event.head_commit.message , 'chore(release):') && !startsWith(github.event.head_commit.message , 'chore(repo):') permissions: # Required for `versioner` to push release commits/tags and for npm OIDC publish. contents: write id-token: write runs-on: ubuntu-latest name: release steps: - name: Checkout Commit uses: actions/checkout@v4 with: fetch-depth: 2 token: ${{ secrets.GH_TOKEN }} - name: Update Master run: | set -euo pipefail DEFAULT_BRANCH="${{ github.event.repository.default_branch }}" # Avoid implicit merges; update the remote-tracking ref explicitly git fetch --no-tags --force origin "+refs/heads/${DEFAULT_BRANCH}:refs/remotes/origin/${DEFAULT_BRANCH}" git checkout "${DEFAULT_BRANCH}" git fetch --tags - name: Setup Node uses: actions/setup-node@v3 with: node-version: 20 registry-url: https://registry.npmjs.org/ - name: Install PNPM uses: pnpm/action-setup@v4 - name: ESLint Cache uses: actions/cache@v3 with: path: ./.eslintcache key: ${{ runner.os }}-eslintcache-${{ hashFiles('./eslintcache') }} restore-keys: | ${{ runner.os }}-eslintcache- - name: Sanity Check run: | echo git `git version`; echo branch `git branch --show-current`; echo node `node -v`; echo pnpm `pnpm -v` echo `moon --version` - name: Initliaze .npmrc run: > echo -e "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}\n$(cat .npmrc)" > .npmrc && cat -n .npmrc - name: Set Git Config run: | git config pull.rebase false git config --global user.email "release-workflow@rollup.dev" git config --global user.name "Release Workflow" git remote set-url origin https://github.com/${{ github.repository }} - name: pnpm install run: pnpm install --frozen-lockfile - name: Build Packages run: pnpm --recursive build - name: Lint Monorepo run: pnpm lint - name: Run Tests run: pnpm --filter [HEAD^] test - name: OIDC Preflight shell: bash run: | if [ -z "${ACTIONS_ID_TOKEN_REQUEST_URL:-}" ] || [ -z "${ACTIONS_ID_TOKEN_REQUEST_TOKEN:-}" ]; then echo "Missing GitHub Actions OIDC env vars (ACTIONS_ID_TOKEN_REQUEST_URL/TOKEN)." >&2 echo "Ensure the job requests permissions: id-token: write." >&2 exit 1 fi echo "OIDC env vars detected." - name: Release and Publish Packages run: pnpm --filter [HEAD^] --workspace-concurrency=1 release env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Push Release and Cleanup run: | set -euo pipefail DEFAULT_BRANCH="${{ github.event.repository.default_branch }}" pnpm lint:docs git checkout .npmrc git add . && git commit --amend --no-edit git pull origin "${DEFAULT_BRANCH}" --no-edit git rebase git push origin HEAD:"${DEFAULT_BRANCH}" git push origin HEAD:"${DEFAULT_BRANCH}" --tags rollup-plugins-c90438a/.github/workflows/validate.yml000066400000000000000000000040121515215015100227450ustar00rootroot00000000000000name: Validate Monorepo on: pull_request: types: - edited - opened - synchronize workflow_dispatch: jobs: build: runs-on: ubuntu-latest strategy: matrix: node: ['20', '24'] name: Node v${{ matrix.node }} steps: - name: Checkout Commit uses: actions/checkout@v4 with: fetch-depth: 2 - name: Update Master run: | # Ensure the remote-tracking ref exists and is up-to-date without invoking an implicit merge set -euo pipefail # Ensure the remote-tracking ref and local branch ref are up-to-date without invoking an implicit merge DEFAULT_BRANCH="${{ github.event.repository.default_branch }}" git fetch --no-tags --force origin \ "+refs/heads/${DEFAULT_BRANCH}:refs/remotes/origin/${DEFAULT_BRANCH}" \ "+refs/heads/${DEFAULT_BRANCH}:refs/heads/${DEFAULT_BRANCH}" - name: Setup Node uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} - name: Install PNPM uses: pnpm/action-setup@v4 - name: ESLint Cache uses: actions/cache@v3 with: path: ./.eslintcache key: ${{ runner.os }}-eslintcache-${{ hashFiles('./eslintcache') }} restore-keys: | ${{ runner.os }}-eslintcache- - name: Sanity Check run: | echo git `git version`; echo branch `git branch --show-current`; echo node `node -v`; echo pnpm `pnpm -v` echo `moon --version` - name: pnpm install run: pnpm install --frozen-lockfile - name: Prettier run: pnpm run prettier:check # pnpm audit isn't as robust as it needs to be atm # - name: Audit Dependencies # run: pnpm security - name: Build Packages run: pnpm --recursive build - name: Lint Monorepo run: pnpm lint:js - name: Run Tests run: pnpm --filter "...[origin/master]" ci:coverage rollup-plugins-c90438a/.gitignore000066400000000000000000000005321515215015100170270ustar00rootroot00000000000000.nyc_output/ coverage/ dist/ node_modules/ output/ .DS_Store .eslintcache coverage.lcov .pnpm-debug.log .idea .rollup.cache !packages/*/test/**/node_modules !packages/node-resolve/test/fixtures/**/node_modules !packages/commonjs/test/**/node_modules !packages/typescript/test/fixtures/**/node_modules !packages/typescript/test/fixtures/**/dist rollup-plugins-c90438a/.husky/000077500000000000000000000000001515215015100162605ustar00rootroot00000000000000rollup-plugins-c90438a/.husky/pre-commit000077500000000000000000000001131515215015100202550ustar00rootroot00000000000000#!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" pnpm exec lint-staged rollup-plugins-c90438a/.npmrc000066400000000000000000000003011515215015100161510ustar00rootroot00000000000000registry=https://registry.npmjs.org/ enable-pre-post-scripts = true link-workspace-packages = false shamefully-hoist = true shared-workspace-shrinkwrap = true strict-peer-dependencies = false rollup-plugins-c90438a/.nvmrc000066400000000000000000000000031515215015100161560ustar00rootroot0000000000000020 rollup-plugins-c90438a/.prettierignore000066400000000000000000000003141515215015100201000ustar00rootroot00000000000000.github/ISSUE_TEMPLATE .github/ISSUE_TEMPLATE.md .github/PULL_REQUEST_TEMPLATE.md packages/json/test/fixtures/garbage/* packages/yaml/test/fixtures/**/* **/dist/ **/fixtures/ **/snapshots/ pnpm-lock.yaml rollup-plugins-c90438a/.prettierrc.js000066400000000000000000000003371515215015100176410ustar00rootroot00000000000000// Note: This file is necessary so that prettier writes which happen in hooks and scripts match the // same config that we're using from the eslint-config package. module.exports = require('eslint-config-rollup/prettier'); rollup-plugins-c90438a/.vscode/000077500000000000000000000000001515215015100164005ustar00rootroot00000000000000rollup-plugins-c90438a/.vscode/launch.json000066400000000000000000000007741515215015100205550ustar00rootroot00000000000000{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "Mocha Tests", "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", "args": ["-u", "tdd", "--timeout", "999999", "--colors"], "console": "integratedTerminal" } ] } rollup-plugins-c90438a/.vscode/settings.json000066400000000000000000000004071515215015100211340ustar00rootroot00000000000000// Place your settings in this file to overwrite default and user settings. { "typescript.format.insertSpaceBeforeFunctionParenthesis": true, "typescript.format.insertSpaceAfterConstructor": true, "typescript.format.enable": true, "eslint.enable": true } rollup-plugins-c90438a/CODEOWNERS000066400000000000000000000002731515215015100164340ustar00rootroot00000000000000* @shellscape /packages/babel/ @Andarist /packages/esm-shim/ @tada5hi /packages/image/ @tjenkinson /packages/node-resolve/ @tjenkinson /packages/swc/ @tada5hi /packages/terser/ @tada5hi rollup-plugins-c90438a/LICENSE000066400000000000000000000021771515215015100160530ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2019 RollupJS Plugin Contributors (https://github.com/rollup/plugins/graphs/contributors) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. rollup-plugins-c90438a/README.md000066400000000000000000000213521515215015100163210ustar00rootroot00000000000000[cover]: https://codecov.io/gh/rollup/plugins/branch/master/graph/badge.svg [cover-url]: https://codecov.io/gh/rollup/plugins [discord]: https://img.shields.io/discord/466787075518365708?color=778cd1&label=chat [discord-url]: https://is.gd/rollup_chat [tests]: https://img.shields.io/circleci/project/github/rollup/plugins.svg [tests-url]: https://circleci.com/gh/rollup/plugins [![tests][tests]][tests-url] [![cover][cover]][cover-url] [![discord][discord]][discord-url] [![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com) # Rollup Plugins 🍣 The one-stop shop for official Rollup plugins This repository houses plugins that Rollup considers critical to every day use of Rollup, plugins which the organization has adopted maintenance of, and plugins that the project recommends to its users. ## Plugins Found Here | | | | --------------------------------------------------- | ----------------------------------------------------------------------------------------- | | [alias](packages/alias) | Define and resolve aliases for bundle dependencies | | [auto-install](packages/auto-install) | Automatically install dependencies that are imported by a bundle | | [babel](packages/babel) | Compile your files with Babel | | [beep](packages/beep) | System beeps on errors and warnings | | [buble](packages/buble) | Compile ES2015 with buble | | [commonjs](packages/commonjs) | Convert CommonJS modules to ES6 | | [data-uri](packages/data-uri) | Import modules from Data URIs | | [dsv](packages/dsv) | Convert .csv and .tsv files into JavaScript modules with d3-dsv | | [dynamic-import-vars](packages/dynamic-import-vars) | Resolving dynamic imports that contain variables. | | [eslint](packages/eslint) | Verify entry point and all imported files with ESLint | | [esm-shim](packages/esm-shim) | Replace cjs syntax for esm output bundles | | [graphql](packages/graphql) | Convert .gql/.graphql files to ES6 modules | | [html](packages/html) | Create HTML files to serve Rollup bundles | | [image](packages/image) | Import JPG, PNG, GIF, SVG, and WebP files | | [inject](packages/inject) | Scan modules for global variables and injects `import` statements where necessary | | [json](packages/json) | Convert .json files to ES6 modules | | [legacy](packages/legacy) | Add `export` declarations to legacy non-module scripts | | [multi-entry](packages/multi-entry) | Use multiple entry points for a bundle | | [node-resolve](packages/node-resolve) | Locate and bundle third-party dependencies in node_modules | | [replace](packages/replace) | Replace strings in files while bundling | | [run](packages/run) | Run your bundles in Node once they're built | | [strip](packages/strip) | Remove debugger statements and functions like assert.equal and console.log from your code | | [sucrase](packages/sucrase) | Compile TypeScript, Flow, JSX, etc with Sucrase | | [swc](packages/swc) | Transpile TypeScript/JavaScript with the speedy-web-compiler | | [terser](packages/terser) | Generate a minified output bundle with terser | | [typescript](packages/typescript) | Integration between Rollup and Typescript | | [url](packages/url) | Import files as data-URIs or ES Modules | | [virtual](packages/virtual) | Load virtual modules from memory | | [wasm](packages/wasm) | Import WebAssembly code with Rollup | | [yaml](packages/yaml) | Convert YAML files to ES6 modules | | | | ## Other Packages Found Here | | | | ----------------------------------- | ---------------------------------------------------------- | | [pluginutils](packages/pluginutils) | A set of utility functions commonly used by Rollup plugins | | | | ## Contributing This repository is a [monorepo](https://en.wikipedia.org/wiki/Monorepo) which leverages [pnpm](https://pnpm.io/) for dependency management. To begin, please install `pnpm`: ```console $ npm install pnpm -g ``` ### Working with Plugin Packages All plugin packages are kept in the `/packages` directory. #### Adding dependencies: ```console $ pnpm --filter ./packages/ add ``` Where `` is the name of the NPM package you wish to add for a plugin package, and `` is the proper name of the plugin. e.g. `@rollup/plugin-beep`. #### Publishing: ```console $ pnpm publish [flags] ``` Where `` is the portion of the plugin package name following `@rollup/plugin-`. (e.g. `beep`) The publish script performs the following actions: - Gathers commits from the last release tag - Determines the next appropriate version bump (major, minor, or patch) - Updates `package.json` - Generates a new ChangeLog entry - Updates `CHANGELOG.md` for the target plugin - Commits `package.json` and `CHANGELOG.md`, with a commit message is in the form `chore(release): -v` - Publishes to NPM - Tags the release in the form `-v` (e.g. `beep-v0.1.0`) - Pushes the commit and tag to Github ##### Flags The following flags are available to modify the publish process: - `--dry` tells the script to perform a dry-run, skipping any file modifications, NPM, or Git Actions. Results from version determination and new ChangeLog additions are displayed. - `--major`, `--minor`, `--patch` can be used to force a particular type of semver bump. - `--no-push` will instruct the script not to push changes and tags to Git. - `--no-tag` will instruct the script not to tag the release. #### Running Tests: To run tests on all packages which have changes: ```console $ pnpm test ``` To run tests on a specific package: ```console $ pnpm --filter ./packages/ test ``` Linting: To lint all packages which have changes: ```console $ pnpm lint ``` To lint a specific package: ```console $ pnpm --filter ./packages/ lint ``` _Note: Scripts in the repository will run the root `test` and `lint` script on those packages which have changes. This is also how the CI pipelines function. To run either on a package outside of that pipeline, use `pnpm