@frsource/frs-replace 4.1.0 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/cli.js CHANGED
@@ -128,7 +128,7 @@ const replaceSync = require('../sync');
128
128
  inputReadOptions: argv['i-read-opts'],
129
129
  inputGlobOptions: argv['i-glob-opts'],
130
130
  content: argv.c,
131
- strategy: argv.strategy,
131
+ strategy: argv.s,
132
132
  output: argv.o,
133
133
  outputWriteOptions: argv['o-write-opts'],
134
134
  outputJoinString: argv['o-join-str'],
@@ -141,7 +141,7 @@ const replaceSync = require('../sync');
141
141
  }
142
142
 
143
143
  return process.exit()
144
- } catch (e) /* istanbul ignore next */ {
144
+ } catch (e) /* c8 ignore next */ {
145
145
  process.stderr.write(e.toString())
146
146
  return process.exit(1)
147
147
  }
package/package.json CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "name": "@frsource/frs-replace",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "description": "Simple wrapper around javascript replace with CLI usage support!",
5
5
  "bin": {
6
6
  "frs-replace": "./bin/cli.js"
7
7
  },
8
8
  "main": "index.js",
9
- "repository": "https://github.com/FRSource/frs-replace.git",
9
+ "repository": "https://github.com/FRSOURCE/frs-replace.git",
10
10
  "author": "Jakub Freisler <FRSgit@users.noreply.github.com>",
11
11
  "license": "Apache-2.0",
12
+ "packageManager": "pnpm@8.5.1",
12
13
  "bugs": {
13
- "url": "https://github.com/FRSource/frs-replace/issues"
14
+ "url": "https://github.com/FRSOURCE/frs-replace/issues"
14
15
  },
15
- "homepage": "https://github.com/FRSource/frs-replace#readme",
16
+ "homepage": "https://github.com/FRSOURCE/frs-replace#readme",
16
17
  "files": [
17
18
  "bin/cli.js",
18
19
  "src/sync.js",
@@ -22,8 +23,7 @@
22
23
  "async.js",
23
24
  "index.js",
24
25
  "LICENSE",
25
- "package.json",
26
- "yarn.lock"
26
+ "package.json"
27
27
  ],
28
28
  "keywords": [
29
29
  "replace",
@@ -40,35 +40,31 @@
40
40
  "regular-expression",
41
41
  "javascript"
42
42
  ],
43
- "scripts": {
44
- "prerelease": "yarn standard:fix && yarn test",
45
- "release": "standard-version",
46
- "postrelease": "git push --follow-tags origin master && yarn publish",
47
- "pretest": "standard",
48
- "test": "yarn test:unit --100",
49
- "posttest": "tap --coverage-report=html",
50
- "pretest:unit": "yarn standard:fix",
51
- "test:unit": "tap ./src/*.test.js ./bin/*.test.js -J",
52
- "test:unit:debug": "tap ./bin/cli.spec.test.js -J -R spec",
53
- "test:benchmark": "tap ./benchmark/*.benchmark.test.js --no-timeout --no-coverage",
54
- "test:benchmark:glob": "yarn test:benchmark --grep=\"/input as glob pattern/\"",
55
- "test:benchmark:string": "yarn test:benchmark --grep=\"/input & replacement as strings/\"",
56
- "standard:fix": "standard --fix"
57
- },
58
43
  "devDependencies": {
59
- "perfy": "1.1.5",
44
+ "@vitest/coverage-c8": "^0.31.1",
45
+ "@vitest/ui": "^0.31.1",
60
46
  "replace": "1.2.2",
61
47
  "replace-in-file": "6.3.5",
62
48
  "replace-string": "3.1.0",
63
49
  "standard": "17.0.0",
64
50
  "standard-version": "9.5.0",
65
- "tap": "16.3.4",
66
- "tmp-promise": "3.0.3"
51
+ "tmp-promise": "3.0.3",
52
+ "vitest": "^0.31.1"
67
53
  },
68
54
  "dependencies": {
69
55
  "fast-glob": "^3.1.0",
70
56
  "get-stdin": "^8.0.0",
71
57
  "write": "^2.0.0",
72
58
  "yargs": "^17.0.0"
59
+ },
60
+ "scripts": {
61
+ "release": "pnpm lint:fix && pnpm coverage:ci && standard-version && git push --follow-tags origin main && pnpm publish",
62
+ "test:ci": "vitest run",
63
+ "coverage:ci": "vitest run --coverage",
64
+ "test": "vitest",
65
+ "coverage": "vitest --coverage",
66
+ "lint:fix": "pnpm standard --fix",
67
+ "lint:ci": "pnpm standard",
68
+ "test:benchmark": "vitest bench"
73
69
  }
74
- }
70
+ }
package/src/async.js CHANGED
@@ -73,7 +73,7 @@ module.exports = async ({
73
73
  fileStream.on('error', writeError)
74
74
  fileStream.on('data', path => replacePromises.push(new Promise((resolve, reject) =>
75
75
  fs.readFile(path, inputReadOptions, (error, data) => {
76
- /* istanbul ignore next */
76
+ /* c8 ignore next */
77
77
  if (error) return reject(error)
78
78
 
79
79
  resolve([path, replaceFn(data)])
package/CHANGELOG.md DELETED
@@ -1,186 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
-
5
- ## [4.1.0](https://github.com/FRSource/frs-replace/compare/v4.0.0...v4.1.0) (2023-02-05)
6
-
7
-
8
- ### Features
9
-
10
- * add stdin flag ([7574b49](https://github.com/FRSource/frs-replace/commit/7574b49274a525432f0353b0ce24c54e1514e580))
11
-
12
- ## [4.0.0](https://github.com/FRSource/frs-replace/compare/v3.0.3...v4.0.0) (2022-12-07)
13
-
14
-
15
- ### ⚠ BREAKING CHANGES
16
-
17
- * from now on replatement file path should be relative to projects' root
18
-
19
- Signed-off-by: Jakub Freisler <jakub@frsource.org>
20
-
21
- ### Features
22
-
23
- * require replacement method in scope of projects' root ([69fc050](https://github.com/FRSource/frs-replace/commit/69fc05009bf11230fbab73d649b4ce636ebbc8e2))
24
-
25
- ### [3.0.3](https://github.com/FRSource/frs-replace/compare/v3.0.2...v3.0.3) (2021-04-18)
26
-
27
- ### [3.0.2](https://github.com/FRSource/frs-replace/compare/v3.0.1...v3.0.2) (2021-04-18)
28
-
29
-
30
- ### Bug Fixes
31
-
32
- * cli release ([#122](https://github.com/FRSource/frs-replace/issues/122)) ([f813be4](https://github.com/FRSource/frs-replace/commit/f813be403baf49a0c8e8a878e8e4687a73a39832))
33
-
34
- ### [3.0.1](https://github.com/FRSource/frs-replace/compare/v3.0.0...v3.0.1) (2021-01-02)
35
-
36
- ### Bug Fixes
37
-
38
- * security update: ini ([#110](https://github.com/FRSource/frs-replace/pull/110))
39
- * 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))
40
-
41
- ## [3.0.0](https://github.com/FRSource/frs-replace/compare/v2.1.2...v3.0.0) (2020-10-27)
42
-
43
-
44
- ### ⚠ BREAKING CHANGES
45
-
46
- * 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>]`
47
- * renamed `regex` option to `needle`
48
- * renamed `inputJoinString` option to `outputJoinString`
49
-
50
- ### Features
51
-
52
- * different output strategies support ([#100](https://github.com/FRSource/frs-replace/issues/100)) ([d9cabac](https://github.com/FRSource/frs-replace/commit/d9cabac7d220a770637f5ef455e2770b1e28cdd4))
53
-
54
- ### [2.1.2](https://github.com/FRSource/frs-replace/compare/v2.1.1...v2.1.2) (2020-10-14)
55
-
56
- ### Bug Fixes
57
-
58
- * migration to yargs v16 ([yargs changelog](https://github.com/yargs/yargs/blob/master/CHANGELOG.md#1600-2020-09-09))
59
-
60
- ### [2.1.1](https://github.com/FRSource/frs-replace/compare/v2.1.0...v2.1.1) (2020-05-16)
61
-
62
-
63
- ### Bug Fixes
64
-
65
- * cli path for binary command ([2546905](https://github.com/FRSource/frs-replace/commit/254690572e86d31c60aaac5b234fbb6b5d11eabf))
66
-
67
- ## [2.1.0](https://github.com/FRSource/frs-replace/compare/v2.0.1...v2.1.0) (2020-05-15)
68
-
69
-
70
- ### Features
71
-
72
- * change npm package name - add it [@frsource](https://github.com/frsource) scope ([0208a90](https://github.com/FRSource/frs-replace/commit/0208a900c88f29ac167e06524ba583ea62eeb457))
73
- * rename FRS-replace to frs-replace ([#73](https://github.com/FRSource/frs-replace/issues/73)) ([8547685](https://github.com/FRSource/frs-replace/commit/8547685e09e133265ba493b8e5349adf8298b463))
74
-
75
- ### [2.0.1](https://github.com/FRSource/frs-replace/compare/v2.0.0...v2.0.1) (2019-11-01)
76
-
77
- ## [2.0.0](https://github.com/FRSource/frs-replace/compare/v1.0.1...v2.0.0) (2019-10-21)
78
-
79
-
80
- ### ⚠ BREAKING CHANGES
81
-
82
- * **package:** fast-glob does not support backslashes in glob patterns anymore, always use forward-slashes
83
-
84
- ### Features
85
-
86
- * 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)
87
-
88
-
89
- ### Bug Fixes
90
-
91
- * **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))
92
- * **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))
93
- * **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)
94
-
95
- ## [1.0.1](https://github.com/FRSource/frs-replace/compare/v1.0.0...v1.0.1) (2019-10-18)
96
-
97
-
98
- ### Bug Fixes
99
-
100
- * **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)
101
-
102
-
103
-
104
- <a name="1.0.0"></a>
105
- # [1.0.0](https://github.com/FRSource/frs-replace/compare/v0.1.2...v1.0.0) (2018-11-14)
106
-
107
-
108
- ### Features
109
-
110
- * **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)
111
- * **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)
112
-
113
-
114
- ### BREAKING CHANGES
115
-
116
- * **input:** api options rename: 'inputOptions' to 'inputReadOptions', 'outputOptions' to 'outputWriteOptions'
117
- * **input:** cli options rename: 'in-opts' to 'i-read-opts', 'out-opts' to 'o-write-opts'
118
- Add possibility to set input or output options through cli
119
- Docs - fixes & new example
120
- Turn off camel-case-expansion to speed up yargs a bit
121
-
122
-
123
-
124
- <a name="0.1.2"></a>
125
- ## [0.1.2](https://github.com/FRSource/frs-replace/compare/v0.1.1...v0.1.2) (2018-10-19)
126
-
127
-
128
-
129
- <a name="0.1.1"></a>
130
- ## [0.1.1](https://github.com/FRSource/frs-replace/compare/v0.1.0...v0.1.1) (2018-10-17)
131
-
132
-
133
-
134
- <a name="0.1.0"></a>
135
- # [0.1.0](https://github.com/FRSource/frs-replace/compare/v0.0.6...v0.1.0) (2018-10-17)
136
-
137
-
138
- ### Features
139
-
140
- * **cli:** Input & output options ([06e8363](https://github.com/FRSource/frs-replace/commit/06e8363)), closes [#7](https://github.com/FRSource/frs-replace/issues/7)
141
-
142
-
143
-
144
- <a name="0.0.6"></a>
145
- ## [0.0.6](https://github.com/FRSource/frs-replace/compare/v0.0.5...v0.0.6) (2018-10-15)
146
-
147
-
148
- ### Bug Fixes
149
-
150
- * **docs:** positionals table ([7168474](https://github.com/FRSource/frs-replace/commit/7168474)), closes [#6](https://github.com/FRSource/frs-replace/issues/6)
151
-
152
-
153
-
154
- <a name="0.0.5"></a>
155
- ## [0.0.5](https://github.com/FRSource/frs-replace/compare/v0.0.4...v0.0.5) (2018-10-15)
156
-
157
-
158
- ### Bug Fixes
159
-
160
- * **docs:** styling & API usage/examples ([cba85dc](https://github.com/FRSource/frs-replace/commit/cba85dc)), closes [#1](https://github.com/FRSource/frs-replace/issues/1)
161
- * **node:** expose public node API ([c727dff](https://github.com/FRSource/frs-replace/commit/c727dff)), closes [#5](https://github.com/FRSource/frs-replace/issues/5)
162
-
163
-
164
-
165
- <a name="0.0.4"></a>
166
- ## [0.0.4](https://github.com/FRSource/frs-replace/compare/v0.0.3...v0.0.4) (2018-10-15)
167
-
168
-
169
-
170
- <a name="0.0.3"></a>
171
- ## [0.0.3](https://github.com/FRSource/frs-replace/compare/v0.0.2...v0.0.3) (2018-10-15)
172
-
173
-
174
-
175
- <a name="0.0.2"></a>
176
- ## [0.0.2](https://github.com/FRSource/frs-replace/compare/v0.0.1...v0.0.2) (2018-10-15)
177
-
178
-
179
- ### Bug Fixes
180
-
181
- * **npm:** lowercase package name to meet npm requirements ([06daa6a](https://github.com/FRSource/frs-replace/commit/06daa6a))
182
-
183
-
184
-
185
- <a name="0.0.1"></a>
186
- ## 0.0.1 (2018-10-15)