Skip to content

v1.0.0

Choose a tag to compare

@lxsmnsyc lxsmnsyc released this 16 Oct 11:32
· 157 commits to master since this release
  • Drop react and ink for CLI. Now uses prompts and ora.
  • Template generation is no longer bundled into the package. The templates are now downloaded remotely from this repository.
  • ESM bundles, like CJS, now have prod and dev builds. This drops the need for process.env.NODE_ENV for the builds, allowing the use of ESM bundle in CDNs.
  • CJS bundle no longer has a common entrypoint. Loading CJS modules now relies on export conditions.
  • ts-jest is no longer a peer dependency (due to conflict reasons). It is still the default transformer, but users need to install ts-jest separately (if not installed previously).
  • Adds start and dev commands for templates like fastify.
  • plugins option can now be a function (through pridepack.config.js). When using a function, it can accept an object with the properties isDev, isCJS and isESM.
  • create and init commands now prompts users for package information. This also generates LICENSE file.
  • watch now uses incremental mode ESBuild
  • PNPM is now supported.
  • Users can now choose whichever package manager they are using to initialize the package. Previously, this aggressively uses the installed package manager's availability.

Migrating to 1.0.0

package.json

The following entrypoints must now be provided. ./esm and ./cjs entrypoints are optional.

{
  "types": "dist/types/index.d.ts",
  "main": "dist/cjs/production/index.js",
  "module": "dist/esm/production/index.js",
  "exports": {
    ".": {
      "development": {
        "require": "./dist/cjs/development/index.js",
        "import": "./dist/esm/development/index.js"
      },
      "require": "./dist/cjs/production/index.js",
      "import": "./dist/esm/production/index.js",
      "types": "./dist/types/index.d.ts"
    },
    "./dev": {
      "production": {
        "require": "./dist/cjs/production/index.js",
        "import": "./dist/esm/production/index.js"
      },
      "require": "./dist/cjs/development/index.js",
      "import": "./dist/esm/development/index.js",
      "types": "./dist/types/index.d.ts"
    },
    "./esm": {
      "development": "./dist/esm/development/index.js",
      "production": "./dist/esm/production/index.js",
      "default": "./dist/esm/production/index.js",
      "types": "./dist/types/index.d.ts"
    },
    "./cjs": {
      "development": "./dist/cjs/development/index.js",
      "production": "./dist/cjs/production/index.js",
      "default": "./dist/cjs/production/index.js",
      "types": "./dist/types/index.d.ts"
    }
  }
}

For scripts, if you are using a start command for running the index file (e.g. fastify-based templates), you may add the following to the scripts field:

{
  "start": "pridepack start",
  "dev": "pridepack dev",
}

ts-jest

ts-jest is still the default preset for pridepack test, however, it is no longer a peer dependency. In this case, users needs to install ts-jest as devDependency. Templates have also been re-adjusted.