Continuous Releases from main
chore: Update version for release (#197)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2 days agoba07fca
Feature/update multipublish configuration (#196)
* fix: update multipublishrc.json to include default exclude and fix registry url
* feat: update multipublish configuration2 days agoa4521b3
chore: Update version for release (#195)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2 days agob3a6e7b
Multipublish/bump 2 (#194)
* fix: fix pnpm multipublish command syntax in release workflow
* feat: updated multipublish workflow to warn about dirty spiders2 days agoac9320c
chore: Update version for release (#193)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2 days ago11210ae
Feature/update stdin implementation (#192)
* fix: parse stdin as json instead of relying on schema parsing
* fix: update json parse for stdin2 days ago40108ca
chore: Update version for release (#191)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2 days ago0fee0bf
chore: Update version for release (#189)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2 days ago00c679d
Stephansama/ste 14 multiple deploy targets (#187)
* fix: remove dotenv-cli dependency and related config
* feat(multipublish): add new package for publishing to multiple providers
This new package provides a CLI tool to facilitate publishing JavaScript
packages to multiple package registries or providers.
It includes:
- core logic for multi-provider publishing
- a build script for bundling and schema generation
- CLI entry point
- configuration schema (using zod)
- initial documentation
* feat: implement npm publishing strategies
The `multipublish` tool now supports publishing packages to npm registries with two
distinct strategies:
- **`.npmrc` strategy**: Creates or updates a root-level `.npmrc` file
temporarily with registry and authentication token details. This is useful for
scenarios where `publishConfig` in `package.json` is not desired or
conflicts with other configurations. The `.npmrc` file is cleaned up
after publishing.
- **`package.json` strategy**: Sets the `publishConfig.registry` field directly
in the package's `package.json` file. This is suitable when the registry
information can reside within the package's manifest. The `package.json`
is reverted to its original state after publishing.
Additionally, this change:
- Ensures the `version` field in `jsr.json` is updated before publishing.
- Introduces the `dedent` package for cleaner multiline string definitions.
* feat(multipublish): initial release of the multipublish cli tool
initial release of `@stephansama/multipublish`, a cli tool for publishing packages to multiple
registries.
features include:
- npm publishing strategies: supports .npmrc file modification or package.json's
publishconfig.registry.
- jsr support: automatically updates `version` in `jsr.json` prior to publishing.
- configuration: fully configurable via a zod schema.
* feat: add dry run publishing mode
introduces a new `--dry` argument to allow users to perform a dry run of the
publishing process without actually publishing packages. this applies to both
npm and jsr platforms.
this change also includes:
- refactoring jsr configuration generation to separate transformation from disk
writing, improving flexibility and reducing side effects.
- adding `fast-glob` dependency to enhance file globbing capabilities.
- enabling `provenance` for all npm publishes for improved security.
- enhancing `git clean` command robustness by using `execFileSync` and
explicitly marking the filename.
- memoizing argument parsing for efficiency.
- removing a redundant `test.js` file.
* chore(multipublish): narrow lint script scope to src directory
* fix: update jsr config file path and npmrc handling in publish logic
* refactor: use getargs instead of parseargs and update changeset type definition
* fix: update package.json dependencies and fix util.ts error handling
* build: move zod to dependencies
* feat: add include/exclude options for jsr and --no-git-checks flag
Add `include` and `exclude` properties to the `jsr.json` schema.
The `publish` command will now merge the global `defaultInclude` and `defaultExclude`
options with the `include` and `exclude` arrays specified in the `jsr.json`
configuration file for the platform.
Include the `--no-git-checks` flag for `npm publish` commands to prevent
failures in environments where git is not configured or in CI/CD pipelines
where git status might not be clean.
* feat(multipublish): add option to allow slow types for jsr publish
This introduces a new configuration option `allowSlowTypes` within the JSR platform
options. When set to `true` (which is the default), the `--allow-slow-types` flag
will be passed to the `jsr publish` command. This allows users to control the
behavior of the JSR publisher regarding type checking performance.
* feat: add dependency catalog support and cli config option
introduce support for dependency catalogs for bun and pnpm workspaces.
this allows resolving dependency versions defined in a `catalog` or `catalogs` section
of `package.json` (bun) or `pnpm-workspace.yaml` (pnpm).
enable specifying the config file path via a command-line argument using `--config`.
update readme with detailed zod schema for configuration options.
remove the deprecated `--output` argument; `usechangesets` is now solely
controlled through the configuration file.
* build(multipublish): clean package.json after jsr publish with experimental catalogs
The current JSR publish process might temporarily modify
the `package.json` file. This commit adds a `gitClean` operation
for `package.json` after a JSR publish, specifically when the
`config.experimentalUpdateCatalogs` flag is enabled. This ensures
that any temporary modifications to `package.json` are reverted,
preventing unintended changes from persisting in the working directory.
* docs: add detailed usage and configuration guide
This commit significantly expands the README for `core/multipublish` to
provide comprehensive guidance on its usage and configuration.
New sections include:
* Configuration: Details various supported file formats and provides
an example configuration for JSR and GitHub NPM registry.
* GitHub NPM Registry: Explains necessary GitHub Actions permissions.
* JSR: Outlines requirements for publishing to JSR.
* Changesets: Provides instructions on integrating `multipublish` with
Changesets workflows.
* feat: add jsr configuration options and update publish logic
adds:
- new cli arguments for specifying released packages and jsr config
- new jsr module to handle updating jsr config files
- update multipublish to leverage new arguments and jsr module
changes:
- refactors dependency update logic to iterate over dependency types
- modifies release loading to use new `loadReleases` function
- alters `run` function to check for `versionJsr` argument and call `updateJsrConfigVersion`
- removes unused `npmrcTemplate` function from `publish` module
* fix(multipublish): correctly handle dry run argument and package versions
* feat: add bun support and automate changeset status generation
The `useChangesetStatus` argument in multipublish is now a boolean flag.
When enabled, the `changeset status` command is executed directly to
generate the necessary status JSON file, streamlining the release process
and removing the need for a manually provided path.
Additionally, this change removes the previous restriction, enabling full
support for Bun as a package manager within multipublish.
A minor refactor was also applied to the dependency iteration in the catalog
module for improved readability.
* test: add unit tests for core multipublish modules
- Adds tests for `catalogSchema` and `loadVersion` in `catalog.ts`.
- Includes tests for `jsrTransformer` and `updateIncludeExcludeList` in `jsr.ts`.
- Adds tests for `changesetStatusSchema` in `release.ts`.
- Covers `platformsSchema` and `configSchema` in `schema.ts`,
including default values and option parsing.
The shebang `#!/usr/bin/env node` was also removed from `index.ts`,
as it is not intended to be a standalone executable script.
* refactor: normalize import paths in test files
* test: add comprehensive tests for multipublish package publishing
Adds a new test file, `publish.test.ts`, to provide comprehensive unit tests
for the `publishPlatform` function, covering npm publishing with both
`package.json` and `.npmrc` strategies, as well as jsr publishing.
Also adds a test case to `catalog.test.ts` for `updatePackageJsonWithCatalog`
to ensure correct updates for pnpm dependencies from a catalog.
* refactor(multipublish): reorder imports in catalog tests
Reorder import statements in `catalog.test.ts` for consistency.
This includes moving type and value imports to the top of the file,
as well as reordering destructured imports within a test block.
* feat: introduce `commitJsrVersionUpdate` option for JSR publishing
Adds a new configuration option `commitJsrVersionUpdate` to control whether
a commit is created when a `jsr.json` file's version is updated during the JSR
publishing process.
This change also refactors test mocks to improve clarity and maintainability,
and introduces the `es-toolkit` dependency for utility functions in tests.
The new option `commitJsrVersionUpdate` defaults to `false`.
* test(multipublish/util): add tests for directory, file, and stdin utilities
Adds unit tests for the `chdir`, `gitClean`, and `readStdin` utility functions.
The `chdir` test verifies correct directory switching and restoration.
The `gitClean` test ensures a specified file is successfully removed.
The `readStdin` tests cover both TTY and non-TTY scenarios, with `process.stdin`
mocked to simulate input streams for robust testing.
* test(multipublish): add unit tests for run function
adds comprehensive unit tests for the main `run` function within the multipublish package.
these tests verify the correct execution flow and function calls based on the `versionJsr` argument,
ensuring that either platform publishing or jsr config updates are triggered as expected.
all external dependencies are mocked to ensure isolated and reliable testing.
* chore: integrate multipublish for multi-platform package releases
this commit introduces and configures @stephansama/multipublish to manage
package releases across multiple platforms, specifically jsr and npm.
the changes include:
- adding a new `.config/.multipublishrc.json` file to define publishing
platforms and their respective configurations.
- updating the `release.yml` github actions workflow to pipe the list of
published packages from `changesets` directly into `multipublish` for
processing. this ensures that `multipublish` handles the actual deployment
to the configured registries.
- granting `packages: write` permission in the github actions workflow,
which is necessary for publishing to npm and jsr registries.
- adding `@stephansama/multipublish` as a dev dependency to the workspace.
* feat(jsr): allow string import/require in export maps
the exportSchema in jsr.ts now supports direct string values for the import and require fields
within an export map entry. previously, these fields were strictly expected to be objects
containing a default property.
the convertPkgJsonExportsToJsr function has been updated to correctly handle both the
string and object formats when converting package.json exports to the jsr format.
additionally, the catalogLoadMap mock in catalog.test.ts was refactored to an object,
enabling package manager-specific mock implementations for 'bun' and 'pnpm'. this
improves the flexibility and isolation of tests.
* build(multipublish): configure multipublish cli for use
The core/multipublish/cli.mjs script has been made executable to allow direct
invocation. The @stephansama/multipublish package was moved from devDependencies
to dependencies to ensure its availability for project build and publishing
workflows.
* refactor: remove commitJsrVersionUpdate option
The `commitJsrVersionUpdate` configuration option has been removed from the JSR
platform options. This change simplifies the configuration by consolidating
the version commit behavior under the `--versionJsr` command-line flag.
The README has been updated to reflect this new approach.
* docs: enhance jsr and changeset documentation in multipublish readme
renamed the "JSR" section to "JSR Configuration" for improved clarity
regarding setup requirements.
added new subsections under "Changesets" to provide detailed guidance:
- "JSR": updated the `preversion` script example to include
`--useChangesetStatus` for proper JSR versioning.
- "Published packages": included a github actions workflow snippet demonstrating
how to run `multipublish` to target other registries immediately following
a `changeset publish` step.
* refactor: improve workflow step name clarity
* chore: switch npm registry to github packages2 days ago635cec4