@temir.ra/create-ts-lib 0.2.1-patch.3 → 0.2.3

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 CHANGED
@@ -1,24 +1,24 @@
1
1
  # Version 0
2
2
 
3
+ ## 0.2.3
4
+
5
+ 1. Updated change management workflow in `README.md` and `template/README.md`: build step now happens after merge (not before PR), so `buildinfo.txt` captures the correct git hash and artifacts are up to date before publish.
6
+ 2. Added Change Management section to root and template `CLAUDE.md`.
7
+
8
+ ## 0.2.2
9
+
10
+ 1. Fixed `CHANGELOG.md` and `buildinfo.txt` copy paths in `cli.ts`: they were resolved relative to `template/` instead of the package root, causing the copy to fail. Refactored URL/path construction to derive all paths from a single `packageUrl`, eliminating redundant `fileURLToPath` calls at each copy site.
11
+ 2. Added `buildinfo-template.txt` and `CHANGELOG-template.md` to `template/gitignore` so generated libraries do not track template files.
12
+ 3. Added `example/` to the root `.gitignore` to exclude local test scaffold output.
13
+ 4. Added a `bun run dist/cli.bundle.js -- example` snippet to the DevOps section of the README for quick local testing.
14
+
3
15
  ## 0.2.1
4
16
 
5
17
  1. Added asset resolution documentation to root README: scoped asset folder convention, inline `import.meta.url` resolution, `fetch()` for isomorphic I/O, setup steps, checklist, and consumer README statement.
6
18
  2. Updated template README with a reference to the asset resolution docs in the create-ts-lib README.
7
19
  3. Updated both `CLAUDE.md` files.
8
20
  4. Updated both `dev.ts` files to use inline `new URL('../', import.meta.url)`.
9
- 5. Removed `src/urls.ts` from root and template (not needed inline resolution is sufficient).
10
-
11
- ### patch.1
12
-
13
- 1. Fixed minor documentation issues.
14
-
15
- ### patch.2
16
-
17
- 1. Fixed missing `template/` files in the published package.
18
-
19
- ### patch.3
20
-
21
- 1. Fixed missing `template/` files in the published package.
21
+ 5. Removed `src/urls.ts` from root and template (not needed - inline resolution is sufficient).
22
22
 
23
23
  ## 0.1.0
24
24
 
package/README.md CHANGED
@@ -430,8 +430,6 @@ AI assistant context files. Provide project layout, commands, and architecture n
430
430
 
431
431
  # DevOps
432
432
 
433
- ## Build
434
-
435
433
  ```bash
436
434
  # remove dist/ and tsconfig.build.tsbuildinfo
437
435
  bun run clean
@@ -444,6 +442,9 @@ bun run clean:tsbuildinfo
444
442
 
445
443
  # compile + bundle
446
444
  bun run build
445
+
446
+ # create a new test library in example/
447
+ bun run dist/cli.bundle.js -- example
447
448
  ```
448
449
 
449
450
  ## Change Management
@@ -452,8 +453,9 @@ bun run build
452
453
  2. Make the changes and commit.
453
454
  3. Bump the version in [`package.json`](package.json).
454
455
  4. Add an entry for the new version in [`CHANGELOG.md`](CHANGELOG.md).
455
- 5. Run `bun run build`.
456
- 6. Pull request the branch and publish.
456
+ 5. Pull request the branch.
457
+ 6. After merge, run `bun run build`.
458
+ 7. Publish
457
459
 
458
460
  ## Publish
459
461
 
package/buildinfo.txt CHANGED
@@ -1 +1 @@
1
- 0.2.1+5ddcc14
1
+ 0.2.3+0a2de3a
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{cpSync as r,readFileSync as m,renameSync as p,writeFileSync as g}from"fs";import{resolve as t,basename as f}from"path";import{fileURLToPath as a}from"url";var o=new URL("../template/",import.meta.url),d=new URL("CHANGELOG.md",o),u=new URL("buildinfo.txt",o);try{let n=process.argv[2];if(!n)throw Error("Destination path is required. Usage: `bun/npm create <template> <destination>`");let e=t(process.cwd(),n),s=f(e),l=t(a(o));r(l,e,{recursive:!0}),r(t(a(d)),t(e,"CHANGELOG-template.md")),r(t(a(u)),t(e,"buildinfo-template.txt"));let i=t(e,"package.json"),c=JSON.parse(m(i,"utf-8"));c.name=s,g(i,JSON.stringify(c,null,2)),p(t(e,"gitignore"),t(e,".gitignore")),console.log(`Template has been successfully instantiated at '${e}' with package name '${s}'.`)}catch(n){let e=n instanceof Error?n:Error(String(n));console.error("Error:",e.message),process.exit(1)}
2
+ import{cpSync as n,readFileSync as c,renameSync as p,writeFileSync as l}from"fs";import{resolve as t,basename as m}from"path";import{fileURLToPath as g}from"url";var f=new URL("../",import.meta.url),r=t(g(f)),d=t(r,"template/"),h=t(r,"CHANGELOG.md"),u=t(r,"buildinfo.txt");try{let a=process.argv[2];if(!a)throw Error("Destination path is required. Usage: `bun/npm create <template> <destination>`");let e=t(process.cwd(),a),o=m(e);n(d,e,{recursive:!0}),n(h,t(e,"CHANGELOG-template.md")),n(u,t(e,"buildinfo-template.txt"));let s=t(e,"package.json"),i=JSON.parse(c(s,"utf-8"));i.name=o,l(s,JSON.stringify(i,null,2)),p(t(e,"gitignore"),t(e,".gitignore")),console.log(`Template has been successfully instantiated at '${e}' with package name '${o}'.`)}catch(a){let e=a instanceof Error?a:Error(String(a));console.error("Error:",e.message),process.exit(1)}
3
3
 
4
- //# debugId=4F322049A7A4E1DA64756E2164756E21
4
+ //# debugId=27529CB64FC389F464756E2164756E21
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["..\\src\\cli.ts"],
4
4
  "sourcesContent": [
5
- "#!/usr/bin/env node\r\n\r\nimport { cpSync, readFileSync, renameSync, writeFileSync } from 'fs';\r\nimport { resolve, basename } from 'path';\r\nimport { fileURLToPath } from 'url';\r\n\r\n\r\nconst templateUrl = new URL('../template/', import.meta.url);\r\nconst changelogUrl = new URL('CHANGELOG.md', templateUrl);\r\nconst buildinfoUrl = new URL('buildinfo.txt', templateUrl);\r\n\r\n\r\ntry {\r\n\r\n const dest = process.argv[2];\r\n if (!dest) throw new Error('Destination path is required. Usage: `bun/npm create <template> <destination>`');\r\n\r\n const destinationPath = resolve(process.cwd(), dest);\r\n const packageName = basename(destinationPath);\r\n\r\n const templatePath = resolve(fileURLToPath(templateUrl));\r\n\r\n cpSync(templatePath, destinationPath, { recursive: true });\r\n cpSync(resolve(fileURLToPath(changelogUrl)), resolve(destinationPath, 'CHANGELOG-template.md'));\r\n cpSync(resolve(fileURLToPath(buildinfoUrl)), resolve(destinationPath, 'buildinfo-template.txt'));\r\n\r\n const packageManifestPath = resolve(destinationPath, 'package.json');\r\n const packageManifest = JSON.parse(readFileSync(packageManifestPath, 'utf-8'));\r\n packageManifest.name = packageName;\r\n writeFileSync(packageManifestPath, JSON.stringify(packageManifest, null, 2));\r\n\r\n renameSync(resolve(destinationPath, 'gitignore'), resolve(destinationPath, '.gitignore'));\r\n\r\n console.log(`Template has been successfully instantiated at '${destinationPath}' with package name '${packageName}'.`);\r\n\r\n}\r\ncatch (error) {\r\n const err = error instanceof Error ? error : new Error(String(error));\r\n console.error('Error:', err.message);\r\n process.exit(1);\r\n}\r\n"
5
+ "#!/usr/bin/env node\r\n\r\nimport { cpSync, readFileSync, renameSync, writeFileSync } from 'fs';\r\nimport { resolve, basename } from 'path';\r\nimport { fileURLToPath } from 'url';\r\n\r\n\r\nconst packageUrl = new URL('../', import.meta.url);\r\nconst packagePath = resolve(fileURLToPath(packageUrl));\r\n\r\nconst templatePath = resolve(packagePath, 'template/');\r\n\r\nconst changelogPath = resolve(packagePath, 'CHANGELOG.md');\r\nconst buildinfoPath = resolve(packagePath, 'buildinfo.txt');\r\n\r\n\r\ntry {\r\n\r\n const dest = process.argv[2];\r\n if (!dest) throw new Error('Destination path is required. Usage: `bun/npm create <template> <destination>`');\r\n\r\n const destinationPath = resolve(process.cwd(), dest);\r\n const packageName = basename(destinationPath);\r\n\r\n cpSync(templatePath, destinationPath, { recursive: true });\r\n cpSync(changelogPath, resolve(destinationPath, 'CHANGELOG-template.md'));\r\n cpSync(buildinfoPath, resolve(destinationPath, 'buildinfo-template.txt'));\r\n\r\n const packageManifestPath = resolve(destinationPath, 'package.json');\r\n const packageManifest = JSON.parse(readFileSync(packageManifestPath, 'utf-8'));\r\n packageManifest.name = packageName;\r\n writeFileSync(packageManifestPath, JSON.stringify(packageManifest, null, 2));\r\n\r\n renameSync(resolve(destinationPath, 'gitignore'), resolve(destinationPath, '.gitignore'));\r\n\r\n console.log(`Template has been successfully instantiated at '${destinationPath}' with package name '${packageName}'.`);\r\n\r\n}\r\ncatch (error) {\r\n const err = error instanceof Error ? error : new Error(String(error));\r\n console.error('Error:', err.message);\r\n process.exit(1);\r\n}\r\n"
6
6
  ],
7
- "mappings": ";AAEA,iBAAS,kBAAQ,gBAAc,mBAAY,WAC3C,kBAAS,cAAS,aAClB,wBAAS,YAGT,IAAM,EAAc,IAAI,IAAI,eAAgB,YAAY,GAAG,EACrD,EAAe,IAAI,IAAI,eAAgB,CAAW,EAClD,EAAe,IAAI,IAAI,gBAAiB,CAAW,EAGzD,GAAI,CAEA,IAAM,EAAO,QAAQ,KAAK,GAC1B,GAAI,CAAC,EAAM,MAAU,MAAM,gFAAgF,EAE3G,IAAM,EAAkB,EAAQ,QAAQ,IAAI,EAAG,CAAI,EAC7C,EAAc,EAAS,CAAe,EAEtC,EAAe,EAAQ,EAAc,CAAW,CAAC,EAEvD,EAAO,EAAc,EAAiB,CAAE,UAAW,EAAK,CAAC,EACzD,EAAO,EAAQ,EAAc,CAAY,CAAC,EAAG,EAAQ,EAAiB,uBAAuB,CAAC,EAC9F,EAAO,EAAQ,EAAc,CAAY,CAAC,EAAG,EAAQ,EAAiB,wBAAwB,CAAC,EAE/F,IAAM,EAAsB,EAAQ,EAAiB,cAAc,EAC7D,EAAkB,KAAK,MAAM,EAAa,EAAqB,OAAO,CAAC,EAC7E,EAAgB,KAAO,EACvB,EAAc,EAAqB,KAAK,UAAU,EAAiB,KAAM,CAAC,CAAC,EAE3E,EAAW,EAAQ,EAAiB,WAAW,EAAG,EAAQ,EAAiB,YAAY,CAAC,EAExF,QAAQ,IAAI,mDAAmD,yBAAuC,KAAe,EAGzH,MAAO,EAAO,CACV,IAAM,EAAM,aAAiB,MAAQ,EAAY,MAAM,OAAO,CAAK,CAAC,EACpE,QAAQ,MAAM,SAAU,EAAI,OAAO,EACnC,QAAQ,KAAK,CAAC",
8
- "debugId": "4F322049A7A4E1DA64756E2164756E21",
7
+ "mappings": ";AAEA,iBAAS,kBAAQ,gBAAc,mBAAY,WAC3C,kBAAS,cAAS,aAClB,wBAAS,YAGT,IAAM,EAAa,IAAI,IAAI,MAAO,YAAY,GAAG,EAC3C,EAAc,EAAQ,EAAc,CAAU,CAAC,EAE/C,EAAe,EAAQ,EAAa,WAAW,EAE/C,EAAgB,EAAQ,EAAa,cAAc,EACnD,EAAgB,EAAQ,EAAa,eAAe,EAG1D,GAAI,CAEA,IAAM,EAAO,QAAQ,KAAK,GAC1B,GAAI,CAAC,EAAM,MAAU,MAAM,gFAAgF,EAE3G,IAAM,EAAkB,EAAQ,QAAQ,IAAI,EAAG,CAAI,EAC7C,EAAc,EAAS,CAAe,EAE5C,EAAO,EAAc,EAAiB,CAAE,UAAW,EAAK,CAAC,EACzD,EAAO,EAAe,EAAQ,EAAiB,uBAAuB,CAAC,EACvE,EAAO,EAAe,EAAQ,EAAiB,wBAAwB,CAAC,EAExE,IAAM,EAAsB,EAAQ,EAAiB,cAAc,EAC7D,EAAkB,KAAK,MAAM,EAAa,EAAqB,OAAO,CAAC,EAC7E,EAAgB,KAAO,EACvB,EAAc,EAAqB,KAAK,UAAU,EAAiB,KAAM,CAAC,CAAC,EAE3E,EAAW,EAAQ,EAAiB,WAAW,EAAG,EAAQ,EAAiB,YAAY,CAAC,EAExF,QAAQ,IAAI,mDAAmD,yBAAuC,KAAe,EAGzH,MAAO,EAAO,CACV,IAAM,EAAM,aAAiB,MAAQ,EAAY,MAAM,OAAO,CAAK,CAAC,EACpE,QAAQ,MAAM,SAAU,EAAI,OAAO,EACnC,QAAQ,KAAK,CAAC",
8
+ "debugId": "27529CB64FC389F464756E2164756E21",
9
9
  "names": []
10
10
  }
package/dist/cli.js CHANGED
@@ -2,19 +2,20 @@
2
2
  import { cpSync, readFileSync, renameSync, writeFileSync } from 'fs';
3
3
  import { resolve, basename } from 'path';
4
4
  import { fileURLToPath } from 'url';
5
- const templateUrl = new URL('../template/', import.meta.url);
6
- const changelogUrl = new URL('CHANGELOG.md', templateUrl);
7
- const buildinfoUrl = new URL('buildinfo.txt', templateUrl);
5
+ const packageUrl = new URL('../', import.meta.url);
6
+ const packagePath = resolve(fileURLToPath(packageUrl));
7
+ const templatePath = resolve(packagePath, 'template/');
8
+ const changelogPath = resolve(packagePath, 'CHANGELOG.md');
9
+ const buildinfoPath = resolve(packagePath, 'buildinfo.txt');
8
10
  try {
9
11
  const dest = process.argv[2];
10
12
  if (!dest)
11
13
  throw new Error('Destination path is required. Usage: `bun/npm create <template> <destination>`');
12
14
  const destinationPath = resolve(process.cwd(), dest);
13
15
  const packageName = basename(destinationPath);
14
- const templatePath = resolve(fileURLToPath(templateUrl));
15
16
  cpSync(templatePath, destinationPath, { recursive: true });
16
- cpSync(resolve(fileURLToPath(changelogUrl)), resolve(destinationPath, 'CHANGELOG-template.md'));
17
- cpSync(resolve(fileURLToPath(buildinfoUrl)), resolve(destinationPath, 'buildinfo-template.txt'));
17
+ cpSync(changelogPath, resolve(destinationPath, 'CHANGELOG-template.md'));
18
+ cpSync(buildinfoPath, resolve(destinationPath, 'buildinfo-template.txt'));
18
19
  const packageManifestPath = resolve(destinationPath, 'package.json');
19
20
  const packageManifest = JSON.parse(readFileSync(packageManifestPath, 'utf-8'));
20
21
  packageManifest.name = packageName;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@temir.ra/create-ts-lib",
3
- "version": "0.2.1-patch.3",
3
+ "version": "0.2.3",
4
4
  "description": "Typescript library template",
5
5
  "author": "temir.ra",
6
6
  "license": "MIT",
@@ -153,6 +153,16 @@ Key `package.json` fields:
153
153
  - `"sideEffects": false` — enables full tree-shaking by bundlers
154
154
  - `"imports": { "#src/*.js": "./src/*.ts" }` — package-internal alias for `src/`; use as `import { foo } from "#src/module.js"`. **Only for `dev.ts`, `tests/`, and `scripts/`** — not for library source files compiled by `tsconfig.build.json`, as tsc emits the specifier verbatim and it would break in published unbundled output.
155
155
 
156
+ ## Change Management
157
+
158
+ 1. Branch off main.
159
+ 2. Make the changes and commit.
160
+ 3. Bump the version in [`package.json`](package.json).
161
+ 4. Add an entry for the new version in [`CHANGELOG.md`](CHANGELOG.md).
162
+ 5. Pull request the branch.
163
+ 6. After merge, run `bun run build`. ← must happen after merge so `buildinfo.txt` captures the correct git hash, and before publish so the artifacts are up to date.
164
+ 7. Publish.
165
+
156
166
  ## Publishing
157
167
 
158
168
  See [README.md](README.md) for registry setup and publish commands.
@@ -48,8 +48,9 @@ bun run dev
48
48
  2. Make the changes and commit.
49
49
  3. Bump the version in [`package.json`](package.json).
50
50
  4. Add an entry for the new version in [`CHANGELOG.md`](CHANGELOG.md).
51
- 5. Run `bun run build`.
52
- 6. Pull request the branch and publish.
51
+ 5. Pull request the branch.
52
+ 6. After merge, run `bun run build`.
53
+ 7. Publish
53
54
 
54
55
  ## Publish
55
56
 
@@ -2,3 +2,5 @@ dist
2
2
  node_modules
3
3
  buildinfo.txt
4
4
  *.tsbuildinfo
5
+ buildinfo-template.txt
6
+ CHANGELOG-template.md
@@ -1 +0,0 @@
1
- 0.0.0+0b7448f