@doikayt/typescript-build-config 0.1.21 → 0.1.22

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/README.md CHANGED
@@ -5,6 +5,7 @@ Shared build configuration presets for TypeScript-based projects.
5
5
  <!-- TOC:START -->
6
6
  - [@doikayt/typescript-build-config](#doikayttypescript-build-config)
7
7
  - [Purpose](#purpose)
8
+ - [Quick start](#quick-start)
8
9
  - [Design Goals](#design-goals)
9
10
  - [What each component is for](#what-each-component-is-for)
10
11
  - [Installation](#installation)
@@ -41,6 +42,40 @@ The plugin encapsulates common build **policy** and release **workflow logic**
41
42
  via the pipeline files it installs into each consumer repo and the canonical release process in
42
43
  [docs/RELEASE-PROCESS.md](docs/RELEASE-PROCESS.md).
43
44
 
45
+ ## Quick start
46
+
47
+ From a fresh machine to a pushed, scaffolded repo. Steps are minimal here — each
48
+ links to the section that explains _what_ and _why_.
49
+
50
+ **1. One-time machine setup.** Clone this base repo and install the shared team
51
+ [shell aliases](#team-shell-aliases):
52
+
53
+ ```bash
54
+ git clone git@github.com:doikayt/typescript-build-config.git
55
+ cd typescript-build-config
56
+ ./shell-assets/install.sh # adds `source shell-assets/aliases.sh` to your rc (idempotent)
57
+ exec $SHELL # reload
58
+ ```
59
+
60
+ **2. Create a new project.** One command creates the GitHub repo, scaffolds it
61
+ (build config + a runnable demo), and pushes it — choose `lib` (published) or
62
+ `app` (private, the default); see [library vs app](#usage) and
63
+ [Packaging concepts](docs/packaging-concepts.md):
64
+
65
+ ```bash
66
+ dk-scaffold my-project lib
67
+ ```
68
+
69
+ Or do it by hand / in an **existing** project — the same steps `dk-scaffold`
70
+ runs ([Installation](#installation) and [Usage](#usage) explain each):
71
+
72
+ ```bash
73
+ npx @doikayt/typescript-build-config new # npm init -y + @doikayt scope
74
+ npm install --save-dev @doikayt/typescript-build-config # postinstall seeds configs + pipeline
75
+ npx @doikayt/typescript-build-config init # scripts, deps, publish config, demo
76
+ npm install # fetch declared devDependencies
77
+ ```
78
+
44
79
  ## Design Goals
45
80
 
46
81
  The package housed in this repo is designed to be 'upstream-most' -- i.e., all other
@@ -80,11 +115,13 @@ is _why_.)
80
115
  | **Convention checks** — postinstall warns on missing `ci` / `update-all-format` | An install-time nudge toward the shared command surface | Consistency |
81
116
  | **`ci` gate** — `release.yml` runs `npm run ci` | Fail-closed enforcement: a repo that ignores the convention cannot release | Consistency (hard teeth) |
82
117
  | **Policy doc** — `docs/RELEASE-PROCESS.md`, linked never copied | One canonical release policy, impossible to drift | Consistency |
83
- | **Assets** — `assets/*` seeded into `docs/assets/` | Shared brand logos with no per-repo copies to maintain | Minimal setup |
118
+ | **Assets** — `image-assets/*` seeded into `docs/assets/` | Shared brand logos with no per-repo copies to maintain | Minimal setup |
119
+ | **Shell aliases** — `shell-assets/aliases.sh`, cloned + sourced (never shipped to npm) | One standard way for the team to create and scaffold repos (`mkrepo`, `dk-*`) | Consistency |
84
120
 
85
- The two goals map onto two lifecycle phases — **delivery** (getting canonical
86
- artifacts into a consuming repo) and **enforcement** (keeping that repo conformant over
87
- time). Each has its own top-level section below.
121
+ The two goals map onto two lifecycle phases — **[delivery](#delivery-model)**
122
+ (getting canonical artifacts into a consuming repo) and
123
+ **[enforcement](#enforcement-model)** (keeping that repo conformant over time).
124
+ Each has its own top-level section below.
88
125
 
89
126
  ## Installation
90
127
 
@@ -240,7 +277,7 @@ versions of these tools may produce peer dependency conflicts.
240
277
  });
241
278
  ```
242
279
 
243
- - Brand assets (`assets/doikayt-logo.png`, `assets/doikayt-logo.svg`) — shared logos for use
280
+ - Brand assets (`image-assets/doikayt-logo.png`, `image-assets/doikayt-logo.svg`) — shared logos for use
244
281
  across all `@doikayt` project READMEs and documentation
245
282
 
246
283
  ## Delivery Model
@@ -268,7 +305,7 @@ components.
268
305
  │ presets eslint prettier tsconfig playwright│
269
306
  │ stubs src/top-level/* │
270
307
  │ pipeline src/pipeline/* │
271
- │ assets assets/* │
308
+ │ assets image-assets/* │
272
309
  │ policy docs/RELEASE-PROCESS.md │
273
310
  └─────────┬───────────────┬───────────────┬───────┘
274
311
  │ │ │
@@ -320,6 +357,16 @@ components.
320
357
  their own contributor docs (as the consumer box shows) — never copied, so it cannot
321
358
  drift.
322
359
 
360
+ **Beyond consumer repos — the shell aliases.** The five components above all reach
361
+ a _consuming repo_ through npm (channels 1–3). The team
362
+ [shell aliases](#team-shell-aliases) are the exception: they target the
363
+ _developer's machine_, not a repo, through a fourth channel — **cloned and
364
+ sourced** (`git clone` this repo + `source shell-assets/aliases.sh`, via
365
+ `shell-assets/install.sh`). npm never touches them and they never land in a consumer's
366
+ `package.json` or tree. Same goal (a standard way to create repos), different
367
+ destination — which is why they sit outside the five-components / three-channels
368
+ model rather than as a sixth row in it.
369
+
323
370
  ## Enforcement Model
324
371
 
325
372
  _Phase 2 of 2: keeping a repo **conformant** over time, once delivery has seeded
@@ -495,21 +542,9 @@ release job until one is committed.
495
542
 
496
543
  ## Team shell aliases
497
544
 
498
- This repo doubles as the team's base setup. After cloning it, install the shared
499
- shell aliases — a **required** onboarding step, so everyone creates and scaffolds
500
- repos the same way:
501
-
502
- ```bash
503
- git clone git@github.com:doikayt/typescript-build-config.git
504
- cd typescript-build-config
505
- ./shell/install.sh # adds a `source` line to ~/.zshrc / ~/.bashrc (idempotent)
506
- exec $SHELL # reload — or: source shell/aliases.sh
507
- ```
508
-
509
- Manual alternative: add `source <clone-path>/shell/aliases.sh` to your shell rc.
510
-
511
- Aliases provided ([`shell/aliases.sh`](shell/aliases.sh)) — require `gh`
512
- (authenticated) and `node`/`npm`:
545
+ Installed by [Quick start](#quick-start) step 1 (or manually: add
546
+ `source <clone-path>/shell-assets/aliases.sh` to your shell rc). They require `gh`
547
+ (authenticated) and `node`/`npm`.
513
548
 
514
549
  | Alias | What it does |
515
550
  | --- | --- |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doikayt/typescript-build-config",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "Shared build configuration for TypeScript projects — ESLint, Prettier, tsconfig, and Playwright presets",
5
5
  "_comments": {
6
6
  "exports": "This block lists the config files that will be extended by files in in src/toplevel - which are copied to consuming project root folder. An example: eslint.config.js imports from '@doikayt/typescript-build-config/eslint'.",
@@ -21,7 +21,7 @@
21
21
  "files": [
22
22
  "src/",
23
23
  "src/top-level/.gitignore",
24
- "assets/"
24
+ "image-assets/"
25
25
  ],
26
26
  "scripts": {
27
27
  "prepack": "echo no build step required",
@@ -15,9 +15,19 @@ const PREFIX = "[@doikayt/typescript-build-config]";
15
15
  console.log(`${PREFIX} Running postinstall...`);
16
16
 
17
17
  const projectRoot = process.env.INIT_CWD ?? process.cwd();
18
- const projectPkg = JSON.parse(
19
- readFileSync(resolve(projectRoot, "package.json"), "utf8"),
20
- );
18
+ const projectPkgPath = resolve(projectRoot, "package.json");
19
+
20
+ // Installed via `npx @doikayt/... new` into a bare dir (or otherwise before a
21
+ // consuming project has a package.json) — nothing to configure. Postinstall is
22
+ // warn-only, so no-op instead of crashing.
23
+ if (!existsSync(projectPkgPath)) {
24
+ console.log(
25
+ `${PREFIX} No package.json in ${projectRoot} — nothing to configure. Skipping.`,
26
+ );
27
+ process.exit(0);
28
+ }
29
+
30
+ const projectPkg = JSON.parse(readFileSync(projectPkgPath, "utf8"));
21
31
 
22
32
  if (projectPkg.name === "@doikayt/typescript-build-config") {
23
33
  console.log(`${PREFIX} Self-install detected — postinstall is a no-op.`);
@@ -101,7 +111,7 @@ for (const { src, dest } of pipelineFiles) {
101
111
 
102
112
  // --- Asset files: seeded into docs/assets/, same per-file copy/warn as pipeline ---
103
113
 
104
- const assetDir = new URL("../assets", import.meta.url).pathname;
114
+ const assetDir = new URL("../image-assets", import.meta.url).pathname;
105
115
 
106
116
  const assetFiles = [
107
117
  { src: "doikayt-logo.png", dest: "docs/assets/doikayt-logo.png" },
@@ -125,7 +135,7 @@ for (const { src, dest } of assetFiles) {
125
135
 
126
136
  console.warn(
127
137
  `${PREFIX} WARNING: ${dest} differs from canonical version — skipping. ` +
128
- `To resync: cp node_modules/@doikayt/typescript-build-config/assets/${src} ${dest}`,
138
+ `To resync: cp node_modules/@doikayt/typescript-build-config/image-assets/${src} ${dest}`,
129
139
  );
130
140
  }
131
141
 
File without changes
File without changes
File without changes