@temir.ra/create-ts-lib 0.2.1-patch.2 → 0.2.2
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 +8 -9
- package/README.md +3 -2
- package/buildinfo.txt +1 -1
- package/dist/cli.bundle.js +2 -2
- package/dist/cli.bundle.js.map +3 -3
- package/dist/cli.js +7 -6
- package/package.json +1 -1
- package/template/gitignore +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
# Version 0
|
|
2
2
|
|
|
3
|
+
## 0.2.2
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
2. Added `buildinfo-template.txt` and `CHANGELOG-template.md` to `template/gitignore` so generated libraries do not track template files.
|
|
7
|
+
3. Added `example/` to the root `.gitignore` to exclude local test scaffold output.
|
|
8
|
+
4. Added a `bun run dist/cli.bundle.js -- example` snippet to the DevOps section of the README for quick local testing.
|
|
9
|
+
|
|
3
10
|
## 0.2.1
|
|
4
11
|
|
|
5
12
|
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
13
|
2. Updated template README with a reference to the asset resolution docs in the create-ts-lib README.
|
|
7
14
|
3. Updated both `CLAUDE.md` files.
|
|
8
15
|
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
|
|
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.
|
|
16
|
+
5. Removed `src/urls.ts` from root and template (not needed - inline resolution is sufficient).
|
|
18
17
|
|
|
19
18
|
## 0.1.0
|
|
20
19
|
|
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
|
package/buildinfo.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.2.
|
|
1
|
+
0.2.2+77ce44b
|
package/dist/cli.bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{cpSync as
|
|
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=
|
|
4
|
+
//# debugId=27529CB64FC389F464756E2164756E21
|
package/dist/cli.bundle.js.map
CHANGED
|
@@ -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
|
|
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,
|
|
8
|
-
"debugId": "
|
|
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
|
|
6
|
-
const
|
|
7
|
-
const
|
|
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(
|
|
17
|
-
cpSync(
|
|
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