@temir.ra/create-template 0.5.4 → 0.5.5
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 +15 -4
- package/dist/CHANGELOG.md +4 -0
- package/dist/buildinfo.txt +1 -1
- package/dist/template/README.md +76 -4
- package/dist/template/package.json +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,7 +8,8 @@ This template scaffolds a package that is itself a template for other packages.
|
|
|
8
8
|
2. [Documentation](#documentation)
|
|
9
9
|
3. [DevOps](#devops)
|
|
10
10
|
1. [Change Management](#change-management)
|
|
11
|
-
2. [
|
|
11
|
+
2. [Registry](#registry)
|
|
12
|
+
3. [CI/CD Workflows](#cicd-workflows)
|
|
12
13
|
|
|
13
14
|
# Quick Start
|
|
14
15
|
|
|
@@ -47,6 +48,16 @@ npm run tests
|
|
|
47
48
|
npx tsx dist/cli.bundle.js -- example/
|
|
48
49
|
```
|
|
49
50
|
|
|
51
|
+
```bash
|
|
52
|
+
git fetch upstream
|
|
53
|
+
git fetch origin
|
|
54
|
+
git fetch . upstream/main:origin/main
|
|
55
|
+
git fetch . origin/main:main
|
|
56
|
+
git push origin main
|
|
57
|
+
git merge --ff-only main
|
|
58
|
+
git push
|
|
59
|
+
```
|
|
60
|
+
|
|
50
61
|
## Change Management
|
|
51
62
|
|
|
52
63
|
1. Create a new branch for the change.
|
|
@@ -57,15 +68,15 @@ npx tsx dist/cli.bundle.js -- example/
|
|
|
57
68
|
6. Ensure package artifacts are current.
|
|
58
69
|
7. Publish.
|
|
59
70
|
|
|
60
|
-
##
|
|
71
|
+
## Registry
|
|
61
72
|
|
|
62
|
-
|
|
73
|
+
`.npmrc`:
|
|
63
74
|
|
|
64
75
|
```ini
|
|
65
76
|
@temir.ra:registry=https://registry.npmjs.org/
|
|
66
77
|
```
|
|
67
78
|
|
|
68
|
-
|
|
79
|
+
`bunfig.toml`:
|
|
69
80
|
|
|
70
81
|
```toml
|
|
71
82
|
[install.scopes]
|
package/dist/CHANGELOG.md
CHANGED
package/dist/buildinfo.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.5.
|
|
1
|
+
0.5.5+e0b94dd
|
package/dist/template/README.md
CHANGED
|
@@ -8,7 +8,8 @@ This template scaffolds a ...
|
|
|
8
8
|
2. [Documentation](#documentation)
|
|
9
9
|
3. [DevOps](#devops)
|
|
10
10
|
1. [Change Management](#change-management)
|
|
11
|
-
2. [
|
|
11
|
+
2. [Registry](#registry)
|
|
12
|
+
3. [CI/CD Workflows](#cicd-workflows)
|
|
12
13
|
|
|
13
14
|
# Quick Start
|
|
14
15
|
|
|
@@ -47,6 +48,16 @@ npm run tests
|
|
|
47
48
|
npx tsx dist/cli.bundle.js -- example/
|
|
48
49
|
```
|
|
49
50
|
|
|
51
|
+
```bash
|
|
52
|
+
git fetch upstream
|
|
53
|
+
git fetch origin
|
|
54
|
+
git fetch . upstream/main:origin/main
|
|
55
|
+
git fetch . origin/main:main
|
|
56
|
+
git push origin main
|
|
57
|
+
git merge --ff-only main
|
|
58
|
+
git push
|
|
59
|
+
```
|
|
60
|
+
|
|
50
61
|
## Change Management
|
|
51
62
|
|
|
52
63
|
1. Create a new branch for the change.
|
|
@@ -57,7 +68,7 @@ npx tsx dist/cli.bundle.js -- example/
|
|
|
57
68
|
6. Ensure package artifacts are current.
|
|
58
69
|
7. Publish.
|
|
59
70
|
|
|
60
|
-
##
|
|
71
|
+
## Registry
|
|
61
72
|
|
|
62
73
|
```bash
|
|
63
74
|
# placeholder:
|
|
@@ -69,14 +80,14 @@ npx tsx dist/cli.bundle.js -- example/
|
|
|
69
80
|
# <REGISTRY_AUTH_TOKEN_ENV_VAR: <REGISTRY_AUTH_TOKEN_ENV_VAR>
|
|
70
81
|
```
|
|
71
82
|
|
|
72
|
-
|
|
83
|
+
`.npmrc`:
|
|
73
84
|
|
|
74
85
|
```ini
|
|
75
86
|
@<SCOPE_WITHOUT_AT>:registry=https://<REGISTRY_ORIGIN_AND_PATH>
|
|
76
87
|
//<REGISTRY_ORIGIN_AND_PATH>:_authToken=${<REGISTRY_AUTH_TOKEN_ENV_VAR>}
|
|
77
88
|
```
|
|
78
89
|
|
|
79
|
-
|
|
90
|
+
`bunfig.toml`:
|
|
80
91
|
|
|
81
92
|
```toml
|
|
82
93
|
[install.scopes]
|
|
@@ -92,3 +103,64 @@ export <REGISTRY_AUTH_TOKEN_ENV_VAR>=<AUTH_TOKEN>
|
|
|
92
103
|
$env:<REGISTRY_AUTH_TOKEN_ENV_VAR> = "<AUTH_TOKEN>"
|
|
93
104
|
npm publish
|
|
94
105
|
```
|
|
106
|
+
|
|
107
|
+
## CI/CD Workflows
|
|
108
|
+
|
|
109
|
+
## Build and Publish to a custom registry
|
|
110
|
+
|
|
111
|
+
⚠️ `.npmrc` configuring the custom registry and its authentication token must be present in the repository for the workflow to work.
|
|
112
|
+
|
|
113
|
+
|Parameter|Type|Description|
|
|
114
|
+
|-----|-----|-----|
|
|
115
|
+
|`RUNNER_LABEL`|Variable|The label of the runner to use for the workflow.|
|
|
116
|
+
|`ACCESS_TOKEN`|Secret|The authentication token for the custom registry.|
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# placeholder:
|
|
120
|
+
# <REGISTRY_AUTH_TOKEN_ENV_VAR: <REGISTRY_AUTH_TOKEN_ENV_VAR>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
`.github/workflows/build-publish.yml`:
|
|
124
|
+
|
|
125
|
+
```yaml
|
|
126
|
+
name: Build and Publish
|
|
127
|
+
|
|
128
|
+
on:
|
|
129
|
+
push:
|
|
130
|
+
branches:
|
|
131
|
+
- main
|
|
132
|
+
|
|
133
|
+
jobs:
|
|
134
|
+
publish:
|
|
135
|
+
runs-on: ${{ vars.RUNNER_LABEL }}
|
|
136
|
+
steps:
|
|
137
|
+
- uses: actions/checkout@v4
|
|
138
|
+
|
|
139
|
+
- name: Install
|
|
140
|
+
env:
|
|
141
|
+
<REGISTRY_AUTH_TOKEN_ENV_VAR>: ${{ secrets.ACCESS_TOKEN }}
|
|
142
|
+
# run: npm ci
|
|
143
|
+
run: npm install
|
|
144
|
+
|
|
145
|
+
- name: Build
|
|
146
|
+
run: npm run build
|
|
147
|
+
|
|
148
|
+
- name: Test
|
|
149
|
+
run: npm run tests
|
|
150
|
+
|
|
151
|
+
- name: Publish
|
|
152
|
+
env:
|
|
153
|
+
<REGISTRY_AUTH_TOKEN_ENV_VAR>: ${{ secrets.ACCESS_TOKEN }}
|
|
154
|
+
run: |
|
|
155
|
+
PKG_NAME=$(node -p "require('./package.json').name")
|
|
156
|
+
PKG_VERSION=$(node -p "require('./package.json').version")
|
|
157
|
+
NPM_TAG="latest"
|
|
158
|
+
if echo "$PKG_VERSION" | grep -q -- '-'; then
|
|
159
|
+
NPM_TAG="next"
|
|
160
|
+
fi
|
|
161
|
+
if npm view "$PKG_NAME@$PKG_VERSION" version >/dev/null 2>&1; then
|
|
162
|
+
echo "$PKG_NAME@$PKG_VERSION already published, skipping."
|
|
163
|
+
else
|
|
164
|
+
npm publish --tag "$NPM_TAG"
|
|
165
|
+
fi
|
|
166
|
+
```
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"clean:dist": "rm -rf dist/",
|
|
34
34
|
"clean:tsbuildinfo": "rm -f tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo",
|
|
35
35
|
"clean": "npm run clean:dist && npm run clean:tsbuildinfo",
|
|
36
|
-
"tests": "node --import tsx --test tests/**/*.test.ts",
|
|
36
|
+
"tests": "node --import tsx --test \"tests/**/*.test.ts\"",
|
|
37
37
|
"prebuild": "npm run buildinfo",
|
|
38
38
|
"build": "npm run build:bundle",
|
|
39
39
|
"build:bundle": "tsx scripts/build-bundle.ts -- --omit-iife"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temir.ra/create-template",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"description": "A template for a template package.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"keywords": [
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"clean:dist": "rm -rf dist/",
|
|
34
34
|
"clean:tsbuildinfo": "rm -f tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo",
|
|
35
35
|
"clean": "npm run clean:dist && npm run clean:tsbuildinfo",
|
|
36
|
-
"tests": "node --import tsx --test tests/**/*.test.ts",
|
|
36
|
+
"tests": "node --import tsx --test \"tests/**/*.test.ts\"",
|
|
37
37
|
"prebuild": "npm run buildinfo",
|
|
38
38
|
"build": "npm run build:bundle",
|
|
39
39
|
"build:bundle": "tsx scripts/build-bundle.ts -- --omit-iife"
|