@temir.ra/create-test115 0.0.14 → 0.0.15

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.
Files changed (38) hide show
  1. package/README.md +1 -0
  2. package/dist/buildinfo.d.ts +2 -0
  3. package/dist/buildinfo.d.ts.map +1 -0
  4. package/dist/buildinfo.js +2 -0
  5. package/dist/index.bundle.js +4 -0
  6. package/dist/index.bundle.js.map +10 -0
  7. package/dist/index.d.ts +3 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +21 -0
  10. package/dist/template/README.md +29 -0
  11. package/dist/template/package.json +32 -0
  12. package/dist/template/src/buildinfo.ts +2 -0
  13. package/package.json +7 -21
  14. package/template/CHANGELOG.md +5 -0
  15. package/template/README.md +29 -0
  16. package/template/package.json +32 -0
  17. package/template/scripts/build-cdn-map.json +1 -0
  18. package/template/scripts/build-cdn.ts +158 -0
  19. package/template/scripts/buildinfo.ts +25 -0
  20. package/template/src/buildinfo.ts +2 -0
  21. package/template/src/dev.ts +5 -0
  22. package/template/src/index.ts +0 -0
  23. package/template/tests/buildinfo.test.ts +20 -0
  24. package/template/tsconfig.build.json +18 -0
  25. package/template/tsconfig.json +35 -0
  26. package/CHANGELOG.md +0 -46
  27. package/README.md.template +0 -59
  28. package/gitignore +0 -2
  29. package/src/buildinfo.ts +0 -2
  30. /package/{CHANGELOG.md.template → dist/template/CHANGELOG.md} +0 -0
  31. /package/{scripts → dist/template/scripts}/build-cdn-map.json +0 -0
  32. /package/{scripts → dist/template/scripts}/build-cdn.ts +0 -0
  33. /package/{scripts → dist/template/scripts}/buildinfo.ts +0 -0
  34. /package/{src → dist/template/src}/dev.ts +0 -0
  35. /package/{src → dist/template/src}/index.ts +0 -0
  36. /package/{tests → dist/template/tests}/buildinfo.test.ts +0 -0
  37. /package/{tsconfig.build.json → dist/template/tsconfig.build.json} +0 -0
  38. /package/{tsconfig.json → dist/template/tsconfig.json} +0 -0
package/README.md CHANGED
@@ -145,6 +145,7 @@ When building the library for distribution, the `tsconfig.build.json` configurat
145
145
  "src/**/*.ts"
146
146
  ],
147
147
  "exclude": [
148
+ "src/dev.ts",
148
149
  "node_modules",
149
150
  "dist",
150
151
  "tests",
@@ -0,0 +1,2 @@
1
+ export declare const buildInfo = "0.0.14+ac7caf3";
2
+ //# sourceMappingURL=buildinfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildinfo.d.ts","sourceRoot":"","sources":["../src/buildinfo.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,SAAS,mBAAmB,CAAC"}
@@ -0,0 +1,2 @@
1
+ // auto-generated by scripts/buildinfo.ts
2
+ export const buildInfo = '0.0.14+ac7caf3';
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import{cpSync as C,readFileSync as E,writeFileSync as G}from"fs";import{resolve as q,basename as H}from"path";import{fileURLToPath as I}from"url";var x=process.argv[2];if(!x)console.error("Usage: bun create my-template <destination>"),process.exit(1);var z=q(process.cwd(),x),A=H(z),J=q(I(import.meta.url),"../../template");C(J,z,{recursive:!0});var B=q(z,"package.json"),K=E(B,"utf8");G(B,K.replaceAll("{{PACKAGE_NAME}}",A));console.log(`✔ Created ${A}`);console.log(` cd ${x} && bun install`);
3
+
4
+ //# debugId=B480A6DF82A2DA2A64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["..\\src\\index.ts"],
4
+ "sourcesContent": [
5
+ "#!/usr/bin/env node\r\n\r\nimport { cpSync, readFileSync, writeFileSync } from 'fs';\r\nimport { resolve, basename } from 'path';\r\nimport { fileURLToPath } from 'url';\r\n\r\n\r\nconst dest = process.argv[2];\r\nif (!dest) {\r\n console.error('Usage: bun create my-template <destination>');\r\n process.exit(1);\r\n}\r\n\r\nconst destDir = resolve(process.cwd(), dest);\r\nconst packageName = basename(destDir);\r\n\r\n// template/ dir is relative to the installed package\r\nconst templateDir = resolve(fileURLToPath(import.meta.url), '../../template');\r\n\r\n// Copy template to destination\r\ncpSync(templateDir, destDir, { recursive: true });\r\n\r\n// Replace placeholders in package.json\r\nconst pkgPath = resolve(destDir, 'package.json');\r\nconst pkg = readFileSync(pkgPath, 'utf8');\r\nwriteFileSync(pkgPath, pkg.replaceAll('{{PACKAGE_NAME}}', packageName));\r\n\r\nconsole.log(`✔ Created ${packageName}`);\r\nconsole.log(` cd ${dest} && bun install`);\r\n"
6
+ ],
7
+ "mappings": ";AAEA,iBAAS,kBAAQ,mBAAc,WAC/B,kBAAS,cAAS,aAClB,wBAAS,YAGT,IAAM,EAAO,QAAQ,KAAK,GAC1B,GAAI,CAAC,EACD,QAAQ,MAAM,6CAA6C,EAC3D,QAAQ,KAAK,CAAC,EAGlB,IAAM,EAAU,EAAQ,QAAQ,IAAI,EAAG,CAAI,EACrC,EAAc,EAAS,CAAO,EAG9B,EAAc,EAAQ,EAAc,YAAY,GAAG,EAAG,gBAAgB,EAG5E,EAAO,EAAa,EAAS,CAAE,UAAW,EAAK,CAAC,EAGhD,IAAM,EAAU,EAAQ,EAAS,cAAc,EACzC,EAAM,EAAa,EAAS,MAAM,EACxC,EAAc,EAAS,EAAI,WAAW,mBAAoB,CAAW,CAAC,EAEtE,QAAQ,IAAI,aAAY,GAAa,EACrC,QAAQ,IAAI,QAAQ,kBAAqB",
8
+ "debugId": "B480A6DF82A2DA2A64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ import { cpSync, readFileSync, writeFileSync } from 'fs';
3
+ import { resolve, basename } from 'path';
4
+ import { fileURLToPath } from 'url';
5
+ const dest = process.argv[2];
6
+ if (!dest) {
7
+ console.error('Usage: bun create my-template <destination>');
8
+ process.exit(1);
9
+ }
10
+ const destDir = resolve(process.cwd(), dest);
11
+ const packageName = basename(destDir);
12
+ // template/ dir is relative to the installed package
13
+ const templateDir = resolve(fileURLToPath(import.meta.url), '../../template');
14
+ // Copy template to destination
15
+ cpSync(templateDir, destDir, { recursive: true });
16
+ // Replace placeholders in package.json
17
+ const pkgPath = resolve(destDir, 'package.json');
18
+ const pkg = readFileSync(pkgPath, 'utf8');
19
+ writeFileSync(pkgPath, pkg.replaceAll('{{PACKAGE_NAME}}', packageName));
20
+ console.log(`✔ Created ${packageName}`);
21
+ console.log(` cd ${dest} && bun install`);
@@ -0,0 +1,29 @@
1
+ # Introduction
2
+
3
+ *&lt;INTRO TEXT&gt;*
4
+
5
+ ## Table of Contents
6
+
7
+ 1. [Quick Start](#quick-start)
8
+ 2. [Documentation](#documentation)
9
+ 3. [DevOps](#devops)
10
+ 1. [Change Management](#change-management)
11
+ 2. [Publish](#publish)
12
+
13
+ # Quick Start
14
+
15
+ *&lt;QUICK START INSTRUCTIONS&gt;*
16
+
17
+ # Documentation
18
+
19
+ *&lt;DOCUMENTATION&gt;*
20
+
21
+ # DevOps
22
+
23
+ ## Change Management
24
+
25
+ 1. Create a new branch for the change.
26
+ 2. Make the changes and commit them to the branch.
27
+ 3. Bump the version in [`package.json`](package.json).
28
+ 4. Add an entry for the new version in [`CHANGELOG.md`](CHANGELOG.md).
29
+ 5. Pull request the branch.
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "",
3
+ "version": "",
4
+ "description": "",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "entrypoint": "./src/index.ts",
9
+ "browser": "./dist/index.bundle.js",
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "scripts": {
18
+ "clean": "rm -rf dist/",
19
+ "prebuild": "bun run scripts/buildinfo.ts",
20
+ "test": "bun test",
21
+ "build": "bun run build:lib && bun run build:cdn && bun run build:assets",
22
+ "build:lib": "tsc --project tsconfig.build.json",
23
+ "build:cdn": "bun run scripts/build-cdn.ts",
24
+ "build:assets": "cp src/assets/* dist/assets/",
25
+ "typecheck": "tsc --noEmit",
26
+ "dev": "bun run --watch src/dev.ts"
27
+ },
28
+ "devDependencies": {
29
+ "@types/bun": "latest",
30
+ "typescript": "^5.9.3"
31
+ }
32
+ }
@@ -0,0 +1,2 @@
1
+ // auto-generated by scripts/buildinfo.ts
2
+ export const buildInfo = '-';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@temir.ra/create-test115",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "exports": {
@@ -11,27 +11,13 @@
11
11
  "types": "./dist/index.d.ts"
12
12
  }
13
13
  },
14
+ "bin": {
15
+ "create-test115": "./dist/index.bundle.js"
16
+ },
14
17
  "files": [
15
- "src",
16
- "tests",
17
- "scripts",
18
- "tsconfig.json",
19
- "tsconfig.build.json",
20
- "README.md",
21
- "README.md.template",
22
- "CHANGELOG.md",
23
- "CHANGELOG.md.template",
24
- "gitignore",
25
- "package.json"
18
+ "dist",
19
+ "template"
26
20
  ],
27
- "bun-create": {
28
- "preinstall": [
29
- "mv README.md README-template.md",
30
- "mv README.md.template README.md",
31
- "mv CHANGELOG.md CHANGELOG-template.md",
32
- "mv CHANGELOG.md.template CHANGELOG.md"
33
- ]
34
- },
35
21
  "scripts": {
36
22
  "clean": "rm -rf dist/",
37
23
  "prebuild": "bun run scripts/buildinfo.ts",
@@ -39,7 +25,7 @@
39
25
  "build": "bun run build:lib && bun run build:cdn && bun run build:assets",
40
26
  "build:lib": "tsc --project tsconfig.build.json",
41
27
  "build:cdn": "bun run scripts/build-cdn.ts",
42
- "build:assets": "echo 'no assets to build'",
28
+ "build:assets": "cp -R template/ dist/template/",
43
29
  "typecheck": "tsc --noEmit",
44
30
  "dev": "bun run --watch src/dev.ts"
45
31
  },
@@ -0,0 +1,5 @@
1
+ # Version 0
2
+
3
+ ## 0.0.0
4
+
5
+ 1. Versioning initialized.
@@ -0,0 +1,29 @@
1
+ # Introduction
2
+
3
+ *&lt;INTRO TEXT&gt;*
4
+
5
+ ## Table of Contents
6
+
7
+ 1. [Quick Start](#quick-start)
8
+ 2. [Documentation](#documentation)
9
+ 3. [DevOps](#devops)
10
+ 1. [Change Management](#change-management)
11
+ 2. [Publish](#publish)
12
+
13
+ # Quick Start
14
+
15
+ *&lt;QUICK START INSTRUCTIONS&gt;*
16
+
17
+ # Documentation
18
+
19
+ *&lt;DOCUMENTATION&gt;*
20
+
21
+ # DevOps
22
+
23
+ ## Change Management
24
+
25
+ 1. Create a new branch for the change.
26
+ 2. Make the changes and commit them to the branch.
27
+ 3. Bump the version in [`package.json`](package.json).
28
+ 4. Add an entry for the new version in [`CHANGELOG.md`](CHANGELOG.md).
29
+ 5. Pull request the branch.
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "",
3
+ "version": "",
4
+ "description": "",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "entrypoint": "./src/index.ts",
9
+ "browser": "./dist/index.bundle.js",
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "scripts": {
18
+ "clean": "rm -rf dist/",
19
+ "prebuild": "bun run scripts/buildinfo.ts",
20
+ "test": "bun test",
21
+ "build": "bun run build:lib && bun run build:cdn && bun run build:assets",
22
+ "build:lib": "tsc --project tsconfig.build.json",
23
+ "build:cdn": "bun run scripts/build-cdn.ts",
24
+ "build:assets": "cp src/assets/* dist/assets/",
25
+ "typecheck": "tsc --noEmit",
26
+ "dev": "bun run --watch src/dev.ts"
27
+ },
28
+ "devDependencies": {
29
+ "@types/bun": "latest",
30
+ "typescript": "^5.9.3"
31
+ }
32
+ }
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +1,158 @@
1
+ import { readFileSync } from 'fs';
2
+ import { join } from 'path';
3
+ import CDN_MAP from 'scripts/build-cdn-map.json';
4
+
5
+
6
+ interface ExportConditions {
7
+
8
+ [key: string]: string | undefined;
9
+
10
+ import?: string;
11
+ types?: string;
12
+ browser?: string;
13
+ entrypoint?: string;
14
+ }
15
+
16
+ interface DependencyMap {
17
+ [packageName: string]: string;
18
+ }
19
+
20
+ interface PackageManifest {
21
+ version: string;
22
+ exports?: Record<string, ExportConditions>;
23
+ dependencies?: DependencyMap;
24
+ devDependencies?: DependencyMap;
25
+ peerDependencies?: DependencyMap;
26
+ }
27
+
28
+ function getManifest(packageIdentifier?: string): PackageManifest {
29
+
30
+ const manifestPath = packageIdentifier
31
+ ? join('node_modules', packageIdentifier, 'package.json')
32
+ : 'package.json';
33
+
34
+ let manifest: PackageManifest;
35
+ try {
36
+ manifest = JSON.parse(readFileSync(manifestPath, 'utf-8'));
37
+ } catch {
38
+ if (packageIdentifier)
39
+ throw new Error("[build-cdn] Could not read manifest for '" + packageIdentifier + "' at '" + manifestPath + "'. Is it installed?");
40
+ else
41
+ throw new Error("[build-cdn] Could not read package manifest at '" + manifestPath + "'.");
42
+ }
43
+
44
+ return manifest;
45
+
46
+ }
47
+
48
+ function getManifestEntrypoints(packageManifest: PackageManifest): string[] {
49
+
50
+ const exports = packageManifest.exports;
51
+ if (!exports) throw new Error('[build-cdn] No exports field found in package.json.');
52
+
53
+ const entrypoints = Object.entries(exports)
54
+ .map(([key, conditions]) => {
55
+ if (!conditions.entrypoint) throw new Error(`[build-cdn] Export '${key}' does not have an 'entrypoint' condition.`);
56
+ return conditions.entrypoint;
57
+ });
58
+
59
+ return entrypoints;
60
+
61
+ }
62
+
63
+ function getPackageVersion(manifest: PackageManifest, packageIdentifier?: string): string {
64
+
65
+ let version: string | undefined;
66
+ if (packageIdentifier) {
67
+
68
+ const dependencies = {
69
+ ...manifest.dependencies,
70
+ ...manifest.devDependencies,
71
+ ...manifest.peerDependencies,
72
+ };
73
+
74
+ version = dependencies[packageIdentifier];
75
+ if (!version) throw new Error(`[build-cdn] Package '${packageIdentifier}' is not listed in dependencies.`);
76
+
77
+ }
78
+ else {
79
+ if (!manifest.version) throw new Error('[build-cdn] Package manifest does not contain a version field.');
80
+ version = manifest.version;
81
+ }
82
+
83
+ return version;
84
+
85
+ }
86
+
87
+ function resolveCdnUrl(importSpecifier: string, urlTemplate: string): string {
88
+ const manifest = getManifest();
89
+ const version = getPackageVersion(manifest, importSpecifier);
90
+ return urlTemplate.replace('<VERSION>', version);
91
+ }
92
+
93
+ const cdnRewritePlugin = {
94
+ name: 'cdn-rewrite',
95
+ setup(build: any) {
96
+
97
+ const resolved = new Map<string, string>();
98
+ for (const [importSpecifier, urlTemplate] of Object.entries(CDN_MAP) as [string, string][]) {
99
+ const url = resolveCdnUrl(importSpecifier, urlTemplate);
100
+ resolved.set(importSpecifier, url);
101
+ console.log(`[cdn-rewrite] '${importSpecifier}' → '${url}'`);
102
+ }
103
+
104
+ build.onResolve({ filter: /.*/ }, (args: any) => {
105
+ const url = resolved.get(args.path);
106
+ if (url) return { path: url, external: true };
107
+ });
108
+
109
+ },
110
+ };
111
+
112
+
113
+ const entrypoints = getManifestEntrypoints(getManifest());
114
+ console.log('[build-cdn] Entrypoints:', entrypoints);
115
+
116
+ let buildResult;
117
+
118
+ console.log('[build-cdn] Starting ESM CDN bundle build...');
119
+ buildResult = await Bun.build({
120
+ entrypoints,
121
+ outdir: 'dist',
122
+ naming: '[dir]/[name].bundle.[ext]',
123
+ target: 'browser',
124
+ format: 'esm',
125
+ minify: true,
126
+ sourcemap: 'external',
127
+ plugins: [cdnRewritePlugin],
128
+ });
129
+
130
+ if (!buildResult.success) {
131
+ console.error('[build-cdn] Build failed:');
132
+ for (const message of buildResult.logs) {
133
+ console.error(message);
134
+ }
135
+ process.exit(1);
136
+ }
137
+ console.log('[build-cdn] ESM CDN bundle build completed successfully.');
138
+
139
+ console.log('[build-cdn] Starting IIFE CDN bundle build...');
140
+ buildResult = await Bun.build({
141
+ entrypoints,
142
+ outdir: 'dist',
143
+ naming: '[dir]/[name].iife.[ext]',
144
+ target: 'browser',
145
+ format: 'iife',
146
+ minify: true,
147
+ sourcemap: 'external',
148
+ plugins: [cdnRewritePlugin],
149
+ });
150
+
151
+ if (!buildResult.success) {
152
+ console.error('[build-cdn] Build failed:');
153
+ for (const message of buildResult.logs) {
154
+ console.error(message);
155
+ }
156
+ process.exit(1);
157
+ }
158
+ console.log('[build-cdn] IIFE CDN bundle build completed successfully.');
@@ -0,0 +1,25 @@
1
+ import { execSync } from 'child_process';
2
+ import { writeFileSync } from 'fs';
3
+ import { join } from 'path';
4
+
5
+
6
+ const BUILD_INFO_FILE = join('src', 'buildinfo.ts');
7
+ const GIT_COMMAND = 'git rev-parse --short HEAD';
8
+
9
+ const version = process.env.npm_package_version ?? '0.0.0';
10
+
11
+ let gitHash = '';
12
+ try {
13
+ gitHash = execSync(GIT_COMMAND, { stdio: ['ignore', 'pipe', 'ignore'] })
14
+ .toString()
15
+ .trim();
16
+ } catch { }
17
+
18
+ const buildInfo = gitHash ? `${version}+${gitHash}` : version;
19
+
20
+ writeFileSync(
21
+ BUILD_INFO_FILE,
22
+ `// auto-generated by scripts/buildinfo.ts\nexport const buildInfo = '${buildInfo}';\n`
23
+ );
24
+
25
+ console.log(`'${BUILD_INFO_FILE}' has been updated with build info: ${buildInfo}`);
@@ -0,0 +1,2 @@
1
+ // auto-generated by scripts/buildinfo.ts
2
+ export const buildInfo = '-';
@@ -0,0 +1,5 @@
1
+ const start = performance.now();
2
+
3
+ // dev code
4
+
5
+ console.log(`${(performance.now() - start).toFixed(3)}ms`);
File without changes
@@ -0,0 +1,20 @@
1
+ import { describe, it, expect } from 'bun:test';
2
+ import { buildInfo } from '@/buildinfo';
3
+
4
+
5
+ describe('buildInfo', () => {
6
+
7
+ it('should follow semantic versioning format with optional commit hash', () => {
8
+ expect(buildInfo).toMatch(/^\d+\.\d+\.\d+(\+[0-9a-f]+)?$/);
9
+ });
10
+
11
+ it('should not contain whitespace', () => {
12
+ expect(buildInfo).not.toMatch(/\s/);
13
+ });
14
+
15
+ it('should not be empty or dash', () => {
16
+ expect(buildInfo.length).toBeGreaterThan(0);
17
+ expect(buildInfo).not.toBe('-');
18
+ });
19
+
20
+ });
@@ -0,0 +1,18 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "module": "nodenext",
5
+ "moduleResolution": "nodenext",
6
+ "emitDeclarationOnly": false,
7
+ },
8
+ "include": [
9
+ "src/**/*.ts"
10
+ ],
11
+ "exclude": [
12
+ "src/dev.ts",
13
+ "node_modules",
14
+ "dist",
15
+ "tests",
16
+ "scripts"
17
+ ]
18
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "lib": [
6
+ "ES2022",
7
+ "DOM"
8
+ ],
9
+ "moduleResolution": "bundler",
10
+ "strict": true,
11
+ "esModuleInterop": true,
12
+ "skipLibCheck": true,
13
+ "forceConsistentCasingInFileNames": true,
14
+ "resolveJsonModule": true,
15
+ "declaration": true,
16
+ "declarationMap": true,
17
+ "emitDeclarationOnly": true,
18
+ "outDir": "./dist",
19
+ "baseUrl": ".",
20
+ "paths": {
21
+ "@/*": [
22
+ "src/*"
23
+ ]
24
+ }
25
+ },
26
+ "include": [
27
+ "src/**/*.ts",
28
+ "tests/**/*.ts",
29
+ "scripts/**/*.ts"
30
+ ],
31
+ "exclude": [
32
+ "node_modules",
33
+ "dist"
34
+ ]
35
+ }
package/CHANGELOG.md DELETED
@@ -1,46 +0,0 @@
1
- # Version 0
2
-
3
- ## next
4
-
5
- 1. Updated `scripts/buildinfo.ts` to use `join` from `path` module for better cross-platform compatibility.
6
- 2. Added `scripts/build-cdn.ts` to generate a bundled version of the library for CDN usage.
7
- 3. Added `scripts/build-cdn-map.json` to configure import path rewrites for the CDN build.
8
- 4. Cleaned up legacy fields `main`, `module`, and `types` from `package.json` to rely solely on the `exports` field for module resolution.
9
- 5. Added `browser` condition to the `exports` field in `package.json` to specify the bundled version for CDN usage.
10
- 6. Added `src/dev.ts` as a development entry point for testing and experimentation during development.
11
- 7. Added QoL `clean` and `test` scripts to `package.json`.
12
- 8. Updated `build` workflow in `package.json`. Now it runs `build:lib` to create JavaScript and declaration files, then runs `build:cdn` to create the bundled version for CDN, and finally runs `build:assets` as a placeholder for any future asset build steps.
13
- 9. Added `description` metadata field to `package.json`.
14
- 10. Updated `tsconfig.json` and `tsconfig.build.json` with opiniated settings for better development, build, and publishing experience.
15
- 11. Added documentation for custom scripts and rationale for the selected values in `tsconfig.json`, `tsconfig.build.json`, and `package.json`.
16
- 12. Updated Quick Start instructions to reflect the new scripts and workflow.
17
- 13. Renamed `README.md` and `CHANGELOG.md` to `README.md.template` and `CHANGELOG.md.template` respectively, and added a `bun-create` configuration in `package.json` to rename them back during project creation.
18
- 14. Added `gitignore` (note the missing dot) to the template to ensure that generated projects have a proper `.gitignore` file.
19
-
20
- ## 0.2.0
21
-
22
- 1. Added `tests/` directory for unit tests using Bun's built-in test runner.
23
- 2. Updated `tsconfig.json` to include `tests/` in the `include` array to allow TypeScript to recognize test files during development, while still excluding them from the build output using `tsconfig.build.json`.
24
- 3. Updated `tsconfig.build.json` to exclude `tests/` to ensure that test files are not included in the build output.
25
- 4. Updated `tsconfig.json` to include `baseUrl` and `paths` for better module resolution and cleaner import statements in the source code.
26
-
27
- ## 0.1.4
28
-
29
- 1. Introduced `tsconfig.build.json` to separate build-specific TypeScript configuration from development configuration, allowing for more tailored settings for each use case.
30
- 2. Updated scripts in `package.json` to utilize `tsconfig.build.json` for the build process, ensuring that the build is optimized and does not include unnecessary files or settings meant for development.
31
-
32
- ## 0.1.3
33
-
34
- 1. Added `--no-git` to `bun create` command in Quick Start instructions to allow users to choose when to initialize git repository.
35
-
36
- ## 0.1.2
37
-
38
- 1. Added `--no-install` to `bun create` command in Quick Start instructions to allow users to choose when to install dependencies.
39
-
40
- ## 0.1.1
41
-
42
- 1. Fixed github user in Quick Start instructions.
43
-
44
- ## 0.1.0
45
-
46
- 1. First version of the template.
@@ -1,59 +0,0 @@
1
- # Introduction
2
-
3
- *&lt;INTRO TEXT&gt;*
4
-
5
- ## Table of Contents
6
-
7
- 1. [Quick Start](#quick-start)
8
- 2. [Documentation](#documentation)
9
- 3. [DevOps](#devops)
10
- 1. [Change Management](#change-management)
11
- 2. [Publish](#publish)
12
-
13
- # Quick Start
14
-
15
- *&lt;QUICK START INSTRUCTIONS&gt;*
16
-
17
- # Documentation
18
-
19
- *&lt;DOCUMENTATION&gt;*
20
-
21
- # DevOps
22
-
23
- ## Change Management
24
-
25
- 1. Create a new branch for the change.
26
- 2. Make the changes and commit them to the branch.
27
- 3. Bump the version in [`package.json`](package.json).
28
- 4. Add an entry for the new version in [`CHANGELOG.md`](CHANGELOG.md).
29
- 5. Pull request the branch.
30
-
31
- ## Publish
32
-
33
- ### bun
34
-
35
- ```bash
36
- # placeholder:
37
- # <SCOPE_WITHOUT_AT: <SCOPE_WITHOUT_AT>
38
- # <REGISTRY_URL: <REGISTRY_URL>
39
- # <BUN_PUBLISH_AUTH_TOKEN: <BUN_PUBLISH_AUTH_TOKEN>
40
- ```
41
-
42
- `bunfig.toml`:
43
-
44
- ```toml
45
- [install.scopes]
46
- <SCOPE_WITHOUT_AT> = { url = "<REGISTRY_URL>", token = "$BUN_PUBLISH_AUTH_TOKEN" }
47
- ```
48
-
49
- ```powershell
50
- $env:BUN_PUBLISH_AUTH_TOKEN = "<BUN_PUBLISH_AUTH_TOKEN>"
51
- bun publish
52
- ```
53
-
54
- ### npm
55
-
56
- ```powershell
57
- npm login --registry https://registry.npmjs.org/
58
- npm publish --registry https://registry.npmjs.org/ --access public
59
- ```
package/gitignore DELETED
@@ -1,2 +0,0 @@
1
- dist
2
- node_modules
package/src/buildinfo.ts DELETED
@@ -1,2 +0,0 @@
1
- // auto-generated by scripts/buildinfo.ts
2
- export const buildInfo = '0.0.12+ac7caf3';
File without changes
File without changes
File without changes
File without changes
File without changes