@temir.ra/create-ts-lib 0.7.2 → 0.7.4

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,5 +1,17 @@
1
1
  # Version 0
2
2
 
3
+ ## 0.7.4
4
+
5
+ 1. Updated `keywords` in `template/package.json`.
6
+ 2. Restored docs for `build*` and `tests` `package.json` scripts in `README.md`.
7
+ 3. Reduced `scripts/dev.ts` section to a DevOps command.
8
+ 4. Added clarification on the `files` field recommendation for `tests/` in the README.
9
+ 5. Updated from `@temir.ra/template@0.1.5` template.
10
+
11
+ ## 0.7.3
12
+
13
+ 1. Updated from `@temir.ra/template@0.1.4` template.
14
+
3
15
  ## 0.7.2
4
16
 
5
17
  1. Cleaned up `*-template.*` files from the template directory.
package/README.md CHANGED
@@ -8,14 +8,13 @@ A template for TypeScript libraries distributed via npm-compatible registries. P
8
8
  2. [Documentation](#documentation)
9
9
  1. [`package.json`](#packagejson)
10
10
  2. [`"bin"` field in `package.json`](#bin-field-in-packagejson)
11
- 3. [`scripts/dev.ts`](#scriptsdevts)
12
- 4. [`tsconfig.json`](#tsconfigjson)
13
- 5. [TSC Compilation](#tsc-compilation)
11
+ 3. [`tsconfig.json`](#tsconfigjson)
12
+ 4. [TSC Compilation](#tsc-compilation)
14
13
  1. [`tsconfig.build.json`](#tsconfigbuildjson)
15
14
  2. [`package.json`](#packagejson-1)
16
- 6. [Script `scripts/build-bundle.ts`](#script-scriptsbuild-bundlets)
15
+ 5. [Script `scripts/build-bundle.ts`](#script-scriptsbuild-bundlets)
17
16
  1. [CDN Map `scripts/cdn-rewrite-map.json`](#cdn-map-scriptscdn-rewrite-mapjson)
18
- 7. [Asset Resolution](#asset-resolution)
17
+ 6. [Asset Resolution](#asset-resolution)
19
18
  1. [Externalized - loaded from CDN or `node_modules/`](#externalized---loaded-from-cdn-or-node_modules)
20
19
  2. [Bundled - absorbed into the consumer's output](#bundled---absorbed-into-the-consumers-output)
21
20
  3. [Contract](#contract)
@@ -118,15 +117,28 @@ The generated package is pre-configured with `build:bundle` only. See [TSC Compi
118
117
  "scripts/buildinfo.ts",
119
118
  "scripts/build-bundle.ts",
120
119
  "scripts/cdn-rewrite-map.json",
121
- "dist",
122
120
  "CHANGELOG.md",
123
- "buildinfo.txt"
121
+ "buildinfo.txt",
122
+ "dist/",
123
+ "tests/"
124
124
  ],
125
125
 
126
126
  "scripts": {
127
127
 
128
128
  // ... ,
129
129
 
130
+ // removes the dist/ directory generated by the build steps
131
+ "clean:dist": "rm -rf dist/",
132
+
133
+ // removes .tsbuildinfo files generated by TypeScript's incremental build feature
134
+ "clean:tsbuildinfo": "rm -f *.tsbuildinfo || true",
135
+
136
+ // convenience script to run the clean steps in sequence
137
+ "clean": "bun run clean:dist && bun run clean:tsbuildinfo",
138
+
139
+ // discovers and runs test files
140
+ "tests": "bun test",
141
+
130
142
  // executed before build; generates buildinfo.txt
131
143
  "prebuild": "bun run buildinfo",
132
144
 
@@ -147,6 +159,8 @@ The generated package is pre-configured with `build:bundle` only. See [TSC Compi
147
159
  }
148
160
  ```
149
161
 
162
+ It is highly recommended to include `tests/` in the `files` field. Note, that `tests/` is not included by default in the generated `package.json`.
163
+
150
164
  ## `"bin"` field in `package.json`
151
165
 
152
166
  For CLI packages, add the following to `package.json`:
@@ -155,7 +169,6 @@ For CLI packages, add the following to `package.json`:
155
169
  {
156
170
  // ... ,
157
171
  "bin": "./dist/cli.bundle.js",
158
- // ... ,
159
172
  "scripts": {
160
173
  // ... ,
161
174
  "build": "... && bun run build:cli-bundle",
@@ -173,10 +186,6 @@ For CLI packages, add the following to `package.json`:
173
186
 
174
187
  If the package exports a CLI only and is not intended to be imported in other packages, the `exports` field can be omitted.
175
188
 
176
- ## `scripts/dev.ts`
177
-
178
- Development scratchpad. Execute it manually with `bun run --watch scripts/dev.ts`. Useful to test and explore library code during development.
179
-
180
189
  ## `tsconfig.json`
181
190
 
182
191
  Selected fields are documented in the [`create-workspace` README](https://www.npmjs.com/package/@temir.ra/create-workspace#tsconfigjson).
@@ -418,7 +427,7 @@ bun run clean
418
427
  bun run build
419
428
  bun run tests
420
429
 
421
- bun run dev
430
+ bun run --watch scripts/dev.ts
422
431
 
423
432
  # see publish section for publish instructions
424
433
  ```
package/buildinfo.txt CHANGED
@@ -1 +1 @@
1
- 0.7.2+395717b
1
+ 0.7.4+443a662
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@temir.ra/create-ts-lib",
3
- "version": "0.7.2",
4
- "description": "Typescript library template",
3
+ "version": "0.7.4",
4
+ "description": "A template for a distributable TypeScript library package.",
5
5
  "author": "temir.ra",
6
6
  "license": "MIT",
7
7
  "keywords": [
8
8
  "typescript",
9
+ "bun",
9
10
  "template",
10
- "library",
11
- "bun"
11
+ "library"
12
12
  ],
13
13
  "repository": {
14
14
  "type": "git",
@@ -24,19 +24,19 @@
24
24
  "scripts/buildinfo.ts",
25
25
  "scripts/build-bundle.ts",
26
26
  "scripts/cdn-rewrite-map.json",
27
- "dist",
28
27
  "CHANGELOG.md",
29
28
  "buildinfo.txt",
30
- "template"
29
+ "dist/",
30
+ "template/"
31
31
  ],
32
32
  "scripts": {
33
+ "reinstall": "rm -rf node_modules && rm -f bun.lock && bun pm cache rm && bun install && bunx tsc --version",
34
+ "typecheck": "tsc --noEmit",
35
+ "buildinfo": "bun run scripts/buildinfo.ts",
33
36
  "clean:dist": "rm -rf dist/",
34
37
  "clean:tsbuildinfo": "rm -f *.tsbuildinfo || true",
35
38
  "clean": "bun run clean:dist && bun run clean:tsbuildinfo",
36
- "buildinfo": "bun run scripts/buildinfo.ts",
37
39
  "tests": "bun test",
38
- "typecheck": "tsc --noEmit",
39
- "reinstall": "rm -rf node_modules && rm -f bun.lock && bun pm cache rm && bun install && bunx tsc --version",
40
40
  "prebuild": "bun run buildinfo",
41
41
  "build": "bun run build:cli-bundle",
42
42
  "build:cli-bundle": "bun build src/cli.ts --entry-naming \"[dir]/[name].bundle.[ext]\" --outdir dist --target node --format esm --minify --sourcemap=external"
@@ -29,7 +29,7 @@ bun run clean
29
29
  bun run build
30
30
  bun run tests
31
31
 
32
- bun run dev
32
+ bun run --watch scripts/dev.ts
33
33
 
34
34
  # see publish section for publish instructions
35
35
  ```
@@ -4,4 +4,4 @@ buildinfo-template.txt
4
4
  CHANGELOG-template.md
5
5
  README-template.md
6
6
  *.tsbuildinfo
7
- dist
7
+ dist/
@@ -5,7 +5,8 @@
5
5
  "author": "",
6
6
  "license": "",
7
7
  "keywords": [
8
- "typescript"
8
+ "typescript",
9
+ "bun"
9
10
  ],
10
11
  "repository": {
11
12
  "type": "git",
@@ -30,7 +31,7 @@
30
31
  "scripts/cdn-rewrite-map.json",
31
32
  "CHANGELOG.md",
32
33
  "buildinfo.txt",
33
- "dist"
34
+ "dist/"
34
35
  ],
35
36
  "scripts": {
36
37
  "reinstall": "rm -rf node_modules && rm -f bun.lock && bun pm cache rm && bun install && bunx tsc --version",