comment-block-replacer 0.1.0 → 0.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/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## 0.1.1 (2025-10-25)
7
+
8
+ **Note:** Version bump only for package comment-block-replacer
package/package.json CHANGED
@@ -1,12 +1,22 @@
1
1
  {
2
2
  "name": "comment-block-replacer",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Process files with comment block replacements",
5
5
  "main": "src/index.js",
6
6
  "types": "types/index.d.ts",
7
+ "scripts": {
8
+ "test": "uvu test '.test.([mc]js|[jt]sx?)$'",
9
+ "build": "pnpm run types",
10
+ "types": "tsc --emitDeclarationOnly --outDir types",
11
+ "clean": "rimraf types",
12
+ "publish": "git push origin && git push origin --tags",
13
+ "release:patch": "pnpm run build && pnpm version patch && pnpm publish",
14
+ "release:minor": "pnpm run build && pnpm version minor && pnpm publish",
15
+ "release:major": "pnpm run build && pnpm version major && pnpm publish"
16
+ },
7
17
  "dependencies": {
8
- "is-valid-path": "^0.1.1",
9
- "comment-block-transformer": "0.1.1"
18
+ "comment-block-transformer": "0.2.0",
19
+ "is-valid-path": "^0.1.1"
10
20
  },
11
21
  "devDependencies": {
12
22
  "typescript": "^5.0.0",
@@ -15,13 +25,5 @@
15
25
  "publishConfig": {
16
26
  "access": "public"
17
27
  },
18
- "scripts": {
19
- "test": "uvu test",
20
- "build": "pnpm run types",
21
- "types": "tsc --emitDeclarationOnly --outDir types",
22
- "clean": "rimraf types",
23
- "release:patch": "pnpm run build && pnpm version patch && pnpm publish",
24
- "release:minor": "pnpm run build && pnpm version minor && pnpm publish",
25
- "release:major": "pnpm run build && pnpm version major && pnpm publish"
26
- }
27
- }
28
+ "gitHead": "546a15fac58d28315057449adf122a5ab8575901"
29
+ }
@@ -52,9 +52,9 @@ test('should process file content with transforms', async () => {
52
52
  const content = `
53
53
  # Test Document
54
54
 
55
- <!-- DOCS:START uppercase -->
55
+ <!-- block uppercase -->
56
56
  hello world
57
- <!-- DOCS:END -->
57
+ <!-- /block -->
58
58
 
59
59
  Some other content.
60
60
  `
@@ -77,9 +77,9 @@ test('should process file from path', async () => {
77
77
  const content = `
78
78
  # Test File
79
79
 
80
- <!-- DOCS:START wordcount -->
80
+ <!-- block wordcount -->
81
81
  This is a test document with multiple words to count.
82
- <!-- DOCS:END -->
82
+ <!-- /block -->
83
83
  `
84
84
 
85
85
  await fs.writeFile(testFile, content)
@@ -99,9 +99,9 @@ This is a test document with multiple words to count.
99
99
 
100
100
  test('should write to output file when not dry run', async () => {
101
101
  const content = `
102
- <!-- DOCS:START uppercase -->
102
+ <!-- block uppercase -->
103
103
  test content
104
- <!-- DOCS:END -->
104
+ <!-- /block -->
105
105
  `
106
106
 
107
107
  /** @type {ProcessFileOptions} */
@@ -124,9 +124,9 @@ test content
124
124
 
125
125
  test('should apply transforms to source file when applyTransformsToSource is true', async () => {
126
126
  const content = `
127
- <!-- DOCS:START uppercase -->
127
+ <!-- block uppercase -->
128
128
  source content
129
- <!-- DOCS:END -->
129
+ <!-- /block -->
130
130
  `
131
131
 
132
132
  await fs.writeFile(testFile, content)
@@ -150,9 +150,9 @@ source content
150
150
  test('should detect syntax from file extension', async () => {
151
151
  const jsFile = path.join(testDir, 'test.js')
152
152
  const content = `
153
- /* DOCS:START uppercase */
153
+ /* block uppercase */
154
154
  const test = 'hello world'
155
- /* DOCS:END */
155
+ /* /block */
156
156
  `
157
157
 
158
158
  await fs.writeFile(jsFile, content)
@@ -161,8 +161,8 @@ const test = 'hello world'
161
161
  const options = {
162
162
  srcPath: jsFile,
163
163
  dryRun: true,
164
- open: 'DOCS:START',
165
- close: 'DOCS:END',
164
+ open: 'block',
165
+ close: '/block',
166
166
  transforms: mockTransforms
167
167
  }
168
168
 
@@ -174,9 +174,9 @@ const test = 'hello world'
174
174
 
175
175
  test('should handle missing transforms', async () => {
176
176
  const content = `
177
- <!-- DOCS:START nonexistent -->
177
+ <!-- block nonexistent -->
178
178
  test content
179
- <!-- DOCS:END -->
179
+ <!-- /block -->
180
180
  `
181
181
 
182
182
  /** @type {ProcessFileOptions} */
@@ -210,9 +210,9 @@ test('should handle both srcPath and content error', async () => {
210
210
 
211
211
  test('should handle file with output directory', async () => {
212
212
  const content = `
213
- <!-- DOCS:START uppercase -->
213
+ <!-- block uppercase -->
214
214
  directory test
215
- <!-- DOCS:END -->
215
+ <!-- /block -->
216
216
  `
217
217
 
218
218
  const outputDir = path.join(testDir, 'output')