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

test: dogfood rpt2 as configPlugin w/ rollup.config.ts #460

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Jul 17, 2023

  1. env: dogfood rpt2 as a configPlugin w/ rollup.config.ts

    - use rpt2 as a `configPlugin` within our own build process, as well as to build itself
      - doubly dogfood
    
    - we don't have any tests for `configPlugin`s, and it's a Rollup CLI option, so this is one of the few ways to test it
      - create a helper `_build-self` script so we don't need to type/repeat as much (or have as much potential for mistakes)
    
    NOTE: this commit fails to build, need to make some more adjustments to the base config to get it to work in TS
    - will do that in the next commits so that it's easier to read/differentiate/review
    agilgur5 committed Jul 17, 2023
    Configuration menu
    Copy the full SHA
    e4195f4 View commit details
    Browse the repository at this point in the history
  2. fix(build): make our internal Rollup configs TS compatible

    - replace the unmaintained `rollup-plugin-re` w/ `@rollup/plugin-replace`
      - `rollup-plugin-re` hasn't had a commit in ~5 years and doesn't have typings (natively or in DT)
      - also import the plugins in the same order that they're used
    - `require("package.json")` -> `import`
      - and add `resolveJsonModule` to `configPlugin` `tsconfigOverride` to handle this
        - only used by the `configPlugin`, not everything else, so not added to `tsconfig.json`
    
    - fix the usage of the `resolve` plugin as it didn't type-check/had outdated usage
    agilgur5 committed Jul 17, 2023
    Configuration menu
    Copy the full SHA
    70b358b View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2023

  1. env: attempt to support build-self as ESM

    - need to use `createRequire` in ESM mode
      - deps: bump `@types/node` to support the types for that as well
      - this is a BREAKING CHANGE as it requires Node 14+
    - fix `fs-extra` error due to it being CJS
    
    - add `build-self/*` to `prebuild` clean
      - not to `build-self` script, as the `build-self/` directory has to exist for that
    - output as `build-self/index.mjs` instead of `build-self/dist/rollup-plugin-typescript2.es.js`
      - so that types work out of the box -- due to `index.d.ts`
      - and so that Rollup correctly loads it as ESM and not CJS
    agilgur5 committed Jul 18, 2023
    Configuration menu
    Copy the full SHA
    5c04ca1 View commit details
    Browse the repository at this point in the history
  2. docs: bump Node requirement to 12.2.0 for createRequire support

    - set `engines.node` in `package.json` to show this as well
    agilgur5 committed Jul 18, 2023
    Configuration menu
    Copy the full SHA
    1d229d9 View commit details
    Browse the repository at this point in the history