Skip to content

Commit

Permalink
feat!: update frs-replace to modern ESM
Browse files Browse the repository at this point in the history
BREAKING CHANGE: drop support for Node lower than 20
  • Loading branch information
FRSgit committed Jan 4, 2025
1 parent f342249 commit c153930
Show file tree
Hide file tree
Showing 34 changed files with 7,518 additions and 4,013 deletions.
58 changes: 52 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,71 @@ jobs:
test:
name: Unit tests & coverage
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version-file: '.nvmrc'
cache: 'pnpm'
- run: pnpm install
- run: pnpm build
- name: Unit tests & coverage
run: pnpm coverage:ci
run: pnpm test:ci
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'chore: update benchmark results [no ci]'
file_pattern: 'benchmark/results.json README.md'
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version-file: '.nvmrc'
cache: 'pnpm'
- run: pnpm install
- run: pnpm lint:ci
- run: pnpm lint

build-and-release:
name: build and release
runs-on: ubuntu-latest
needs: [test, lint]
steps:
- uses: actions/checkout@v4
with:
# pulls all commits (needed for lerna / semantic release to correctly version)
fetch-depth: '0'
- name: Setup git user
run: |
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: '.nvmrc'
cache: 'pnpm'
- name: remove git auth
run: git config --unset http.https://github.com/.extraheader
- run: pnpm install --frozen-lockfile
- name: Authenticate with Registry
run: |
echo "registry=http://registry.npmjs.org/" >> .npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
npm whoami
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: pnpm build
- name: release package
if: ${{ success() && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
run: pnpm release:ci
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_REGISTRY: https://registry.npmjs.org/
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,5 @@ typings/
.next

html
dist
benchmark/results.json
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.11.1
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/dist
pnpm-lock.yaml
CHANGELOG.md
109 changes: 42 additions & 67 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,183 +6,158 @@ All notable changes to this project will be documented in this file. See [standa

## [4.1.0](https://github.com/FRSource/frs-replace/compare/v4.0.0...v4.1.0) (2023-02-05)


### Features

* add stdin flag ([7574b49](https://github.com/FRSource/frs-replace/commit/7574b49274a525432f0353b0ce24c54e1514e580))
- add stdin flag ([7574b49](https://github.com/FRSource/frs-replace/commit/7574b49274a525432f0353b0ce24c54e1514e580))

## [4.0.0](https://github.com/FRSource/frs-replace/compare/v3.0.3...v4.0.0) (2022-12-07)


### ⚠ BREAKING CHANGES

* from now on replatement file path should be relative to projects' root
- from now on replatement file path should be relative to projects' root

Signed-off-by: Jakub Freisler <[email protected]>

### Features

* require replacement method in scope of projects' root ([69fc050](https://github.com/FRSource/frs-replace/commit/69fc05009bf11230fbab73d649b4ce636ebbc8e2))
- require replacement method in scope of projects' root ([69fc050](https://github.com/FRSource/frs-replace/commit/69fc05009bf11230fbab73d649b4ce636ebbc8e2))

### [3.0.3](https://github.com/FRSource/frs-replace/compare/v3.0.2...v3.0.3) (2021-04-18)

### [3.0.2](https://github.com/FRSource/frs-replace/compare/v3.0.1...v3.0.2) (2021-04-18)


### Bug Fixes

* cli release ([#122](https://github.com/FRSource/frs-replace/issues/122)) ([f813be4](https://github.com/FRSource/frs-replace/commit/f813be403baf49a0c8e8a878e8e4687a73a39832))
- cli release ([#122](https://github.com/FRSource/frs-replace/issues/122)) ([f813be4](https://github.com/FRSource/frs-replace/commit/f813be403baf49a0c8e8a878e8e4687a73a39832))

### [3.0.1](https://github.com/FRSource/frs-replace/compare/v3.0.0...v3.0.1) (2021-01-02)

### Bug Fixes

* security update: ini ([#110](https://github.com/FRSource/frs-replace/pull/110))
* updates: standard ([#107](https://github.com/FRSource/frs-replace/pull/107)), tap ([#106](https://github.com/FRSource/frs-replace/pull/106)), yargs ([#108](https://github.com/FRSource/frs-replace/pull/108)), standard-version ([#111](https://github.com/FRSource/frs-replace/pull/111))
- security update: ini ([#110](https://github.com/FRSource/frs-replace/pull/110))
- updates: standard ([#107](https://github.com/FRSource/frs-replace/pull/107)), tap ([#106](https://github.com/FRSource/frs-replace/pull/106)), yargs ([#108](https://github.com/FRSource/frs-replace/pull/108)), standard-version ([#111](https://github.com/FRSource/frs-replace/pull/111))

## [3.0.0](https://github.com/FRSource/frs-replace/compare/v2.1.2...v3.0.0) (2020-10-27)


### ⚠ BREAKING CHANGES

* from this version on Node.js api ALWAYS returns an array of replace result array, where replace result array follows the pattern: `[<replaced/new file path>, <replaced content>]`
* renamed `regex` option to `needle`
* renamed `inputJoinString` option to `outputJoinString`
- from this version on Node.js api ALWAYS returns an array of replace result array, where replace result array follows the pattern: `[<replaced/new file path>, <replaced content>]`
- renamed `regex` option to `needle`
- renamed `inputJoinString` option to `outputJoinString`

### Features

* different output strategies support ([#100](https://github.com/FRSource/frs-replace/issues/100)) ([d9cabac](https://github.com/FRSource/frs-replace/commit/d9cabac7d220a770637f5ef455e2770b1e28cdd4))
- different output strategies support ([#100](https://github.com/FRSource/frs-replace/issues/100)) ([d9cabac](https://github.com/FRSource/frs-replace/commit/d9cabac7d220a770637f5ef455e2770b1e28cdd4))

### [2.1.2](https://github.com/FRSource/frs-replace/compare/v2.1.1...v2.1.2) (2020-10-14)

### Bug Fixes

* migration to yargs v16 ([yargs changelog](https://github.com/yargs/yargs/blob/master/CHANGELOG.md#1600-2020-09-09))
- migration to yargs v16 ([yargs changelog](https://github.com/yargs/yargs/blob/master/CHANGELOG.md#1600-2020-09-09))

### [2.1.1](https://github.com/FRSource/frs-replace/compare/v2.1.0...v2.1.1) (2020-05-16)


### Bug Fixes

* cli path for binary command ([2546905](https://github.com/FRSource/frs-replace/commit/254690572e86d31c60aaac5b234fbb6b5d11eabf))
- cli path for binary command ([2546905](https://github.com/FRSource/frs-replace/commit/254690572e86d31c60aaac5b234fbb6b5d11eabf))

## [2.1.0](https://github.com/FRSource/frs-replace/compare/v2.0.1...v2.1.0) (2020-05-15)


### Features

* change npm package name - add it [@frsource](https://github.com/frsource) scope ([0208a90](https://github.com/FRSource/frs-replace/commit/0208a900c88f29ac167e06524ba583ea62eeb457))
* rename FRS-replace to frs-replace ([#73](https://github.com/FRSource/frs-replace/issues/73)) ([8547685](https://github.com/FRSource/frs-replace/commit/8547685e09e133265ba493b8e5349adf8298b463))
- change npm package name - add it [@frsource](https://github.com/frsource) scope ([0208a90](https://github.com/FRSource/frs-replace/commit/0208a900c88f29ac167e06524ba583ea62eeb457))
- rename FRS-replace to frs-replace ([#73](https://github.com/FRSource/frs-replace/issues/73)) ([8547685](https://github.com/FRSource/frs-replace/commit/8547685e09e133265ba493b8e5349adf8298b463))

### [2.0.1](https://github.com/FRSource/frs-replace/compare/v2.0.0...v2.0.1) (2019-11-01)

## [2.0.0](https://github.com/FRSource/frs-replace/compare/v1.0.1...v2.0.0) (2019-10-21)


### ⚠ BREAKING CHANGES

* **package:** fast-glob does not support backslashes in glob patterns anymore, always use forward-slashes
- **package:** fast-glob does not support backslashes in glob patterns anymore, always use forward-slashes

### Features

* better parallelization ([4d90537](https://github.com/FRSource/frs-replace/commit/4d905375f0550a097d9464b742d13515e1314c94)), closes [#17](https://github.com/FRSource/frs-replace/issues/17) [#10](https://github.com/FRSource/frs-replace/issues/10) [#19](https://github.com/FRSource/frs-replace/issues/19)

- better parallelization ([4d90537](https://github.com/FRSource/frs-replace/commit/4d905375f0550a097d9464b742d13515e1314c94)), closes [#17](https://github.com/FRSource/frs-replace/issues/17) [#10](https://github.com/FRSource/frs-replace/issues/10) [#19](https://github.com/FRSource/frs-replace/issues/19)

### Bug Fixes

* **package:** update fast-glob to version 3.1.0 ([#44](https://github.com/FRSource/frs-replace/issues/44)) ([735785d](https://github.com/FRSource/frs-replace/commit/735785dfdc99869096cd4c6a3be60fb8f796d54b))
* **package:** update write to version 2.0.0 ([#36](https://github.com/FRSource/frs-replace/issues/36)) ([d0b7ffd](https://github.com/FRSource/frs-replace/commit/d0b7ffdbbd668262860e130551e64b54840ac782))
* **package:** update yargs to version 14.2.0 ([#45](https://github.com/FRSource/frs-replace/issues/45)) ([6df29e4](https://github.com/FRSource/frs-replace/commit/6df29e4e9bda262f9467d85349cd1c61d260c328)), closes [#35](https://github.com/FRSource/frs-replace/issues/35)
- **package:** update fast-glob to version 3.1.0 ([#44](https://github.com/FRSource/frs-replace/issues/44)) ([735785d](https://github.com/FRSource/frs-replace/commit/735785dfdc99869096cd4c6a3be60fb8f796d54b))
- **package:** update write to version 2.0.0 ([#36](https://github.com/FRSource/frs-replace/issues/36)) ([d0b7ffd](https://github.com/FRSource/frs-replace/commit/d0b7ffdbbd668262860e130551e64b54840ac782))
- **package:** update yargs to version 14.2.0 ([#45](https://github.com/FRSource/frs-replace/issues/45)) ([6df29e4](https://github.com/FRSource/frs-replace/commit/6df29e4e9bda262f9467d85349cd1c61d260c328)), closes [#35](https://github.com/FRSource/frs-replace/issues/35)

## [1.0.1](https://github.com/FRSource/frs-replace/compare/v1.0.0...v1.0.1) (2019-10-18)


### Bug Fixes

* **package:** update yargs to version 13.2.2 ([749b721](https://github.com/FRSource/frs-replace/commit/749b72144049d9c900b04dd2b14473938af963d7)), closes [#20](https://github.com/FRSource/frs-replace/issues/20)


- **package:** update yargs to version 13.2.2 ([749b721](https://github.com/FRSource/frs-replace/commit/749b72144049d9c900b04dd2b14473938af963d7)), closes [#20](https://github.com/FRSource/frs-replace/issues/20)

<a name="1.0.0"></a>
# [1.0.0](https://github.com/FRSource/frs-replace/compare/v0.1.2...v1.0.0) (2018-11-14)

# [1.0.0](https://github.com/FRSource/frs-replace/compare/v0.1.2...v1.0.0) (2018-11-14)

### Features

* **input:** add support for globbing matching ([#14](https://github.com/FRSource/frs-replace/issues/14)) ([b289ffe](https://github.com/FRSource/frs-replace/commit/b289ffe)), closes [#3](https://github.com/FRSource/frs-replace/issues/3)
* **sync:** Sync speed improvements ([#18](https://github.com/FRSource/frs-replace/issues/18)) ([4ff2a1e](https://github.com/FRSource/frs-replace/commit/4ff2a1e)), closes [#17](https://github.com/FRSource/frs-replace/issues/17)

- **input:** add support for globbing matching ([#14](https://github.com/FRSource/frs-replace/issues/14)) ([b289ffe](https://github.com/FRSource/frs-replace/commit/b289ffe)), closes [#3](https://github.com/FRSource/frs-replace/issues/3)
- **sync:** Sync speed improvements ([#18](https://github.com/FRSource/frs-replace/issues/18)) ([4ff2a1e](https://github.com/FRSource/frs-replace/commit/4ff2a1e)), closes [#17](https://github.com/FRSource/frs-replace/issues/17)

### BREAKING CHANGES

* **input:** api options rename: 'inputOptions' to 'inputReadOptions', 'outputOptions' to 'outputWriteOptions'
* **input:** cli options rename: 'in-opts' to 'i-read-opts', 'out-opts' to 'o-write-opts'
Add possibility to set input or output options through cli
Docs - fixes & new example
Turn off camel-case-expansion to speed up yargs a bit


- **input:** api options rename: 'inputOptions' to 'inputReadOptions', 'outputOptions' to 'outputWriteOptions'
- **input:** cli options rename: 'in-opts' to 'i-read-opts', 'out-opts' to 'o-write-opts'
Add possibility to set input or output options through cli
Docs - fixes & new example
Turn off camel-case-expansion to speed up yargs a bit

<a name="0.1.2"></a>
## [0.1.2](https://github.com/FRSource/frs-replace/compare/v0.1.1...v0.1.2) (2018-10-19)


## [0.1.2](https://github.com/FRSource/frs-replace/compare/v0.1.1...v0.1.2) (2018-10-19)

<a name="0.1.1"></a>
## [0.1.1](https://github.com/FRSource/frs-replace/compare/v0.1.0...v0.1.1) (2018-10-17)


## [0.1.1](https://github.com/FRSource/frs-replace/compare/v0.1.0...v0.1.1) (2018-10-17)

<a name="0.1.0"></a>
# [0.1.0](https://github.com/FRSource/frs-replace/compare/v0.0.6...v0.1.0) (2018-10-17)

# [0.1.0](https://github.com/FRSource/frs-replace/compare/v0.0.6...v0.1.0) (2018-10-17)

### Features

* **cli:** Input & output options ([06e8363](https://github.com/FRSource/frs-replace/commit/06e8363)), closes [#7](https://github.com/FRSource/frs-replace/issues/7)


- **cli:** Input & output options ([06e8363](https://github.com/FRSource/frs-replace/commit/06e8363)), closes [#7](https://github.com/FRSource/frs-replace/issues/7)

<a name="0.0.6"></a>
## [0.0.6](https://github.com/FRSource/frs-replace/compare/v0.0.5...v0.0.6) (2018-10-15)

## [0.0.6](https://github.com/FRSource/frs-replace/compare/v0.0.5...v0.0.6) (2018-10-15)

### Bug Fixes

* **docs:** positionals table ([7168474](https://github.com/FRSource/frs-replace/commit/7168474)), closes [#6](https://github.com/FRSource/frs-replace/issues/6)


- **docs:** positionals table ([7168474](https://github.com/FRSource/frs-replace/commit/7168474)), closes [#6](https://github.com/FRSource/frs-replace/issues/6)

<a name="0.0.5"></a>
## [0.0.5](https://github.com/FRSource/frs-replace/compare/v0.0.4...v0.0.5) (2018-10-15)

## [0.0.5](https://github.com/FRSource/frs-replace/compare/v0.0.4...v0.0.5) (2018-10-15)

### Bug Fixes

* **docs:** styling & API usage/examples ([cba85dc](https://github.com/FRSource/frs-replace/commit/cba85dc)), closes [#1](https://github.com/FRSource/frs-replace/issues/1)
* **node:** expose public node API ([c727dff](https://github.com/FRSource/frs-replace/commit/c727dff)), closes [#5](https://github.com/FRSource/frs-replace/issues/5)


- **docs:** styling & API usage/examples ([cba85dc](https://github.com/FRSource/frs-replace/commit/cba85dc)), closes [#1](https://github.com/FRSource/frs-replace/issues/1)
- **node:** expose public node API ([c727dff](https://github.com/FRSource/frs-replace/commit/c727dff)), closes [#5](https://github.com/FRSource/frs-replace/issues/5)

<a name="0.0.4"></a>
## [0.0.4](https://github.com/FRSource/frs-replace/compare/v0.0.3...v0.0.4) (2018-10-15)


## [0.0.4](https://github.com/FRSource/frs-replace/compare/v0.0.3...v0.0.4) (2018-10-15)

<a name="0.0.3"></a>
## [0.0.3](https://github.com/FRSource/frs-replace/compare/v0.0.2...v0.0.3) (2018-10-15)


## [0.0.3](https://github.com/FRSource/frs-replace/compare/v0.0.2...v0.0.3) (2018-10-15)

<a name="0.0.2"></a>
## [0.0.2](https://github.com/FRSource/frs-replace/compare/v0.0.1...v0.0.2) (2018-10-15)

## [0.0.2](https://github.com/FRSource/frs-replace/compare/v0.0.1...v0.0.2) (2018-10-15)

### Bug Fixes

* **npm:** lowercase package name to meet npm requirements ([06daa6a](https://github.com/FRSource/frs-replace/commit/06daa6a))


- **npm:** lowercase package name to meet npm requirements ([06daa6a](https://github.com/FRSource/frs-replace/commit/06daa6a))

<a name="0.0.1"></a>

## 0.0.1 (2018-10-15)
Loading

0 comments on commit c153930

Please sign in to comment.