pixitoons 1.0.0 → 1.0.1
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 +7 -0
- package/README.md +13 -10
- package/package.json +1 -1
- package/src/version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
Every release is a git tag (vX.Y.Z) with a GitHub release that cannot change after it is published. What each
|
|
4
4
|
number means is in README.md ("Versions").
|
|
5
5
|
|
|
6
|
+
## 1.0.1
|
|
7
|
+
|
|
8
|
+
No avatar changes: every seed gives the same avatar as in 1.0.0.
|
|
9
|
+
|
|
10
|
+
- On npm: `npm install pixitoons`. The Release workflow now publishes every release to npm as well.
|
|
11
|
+
- The tests check that the repository stays under the 50 MB that jsDelivr serves from a GitHub tag (20 MB per file).
|
|
12
|
+
|
|
6
13
|
## 1.0.0
|
|
7
14
|
|
|
8
15
|
First release.
|
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ composed in the browser from layered images, so there is no server to run and no
|
|
|
13
13
|
```html
|
|
14
14
|
<img id="me" width="128" height="128" alt="">
|
|
15
15
|
<script type="module">
|
|
16
|
-
import { createAvatars } from 'https://cdn.jsdelivr.net/gh/pixitoons/pixitoons@v1.0.
|
|
16
|
+
import { createAvatars } from 'https://cdn.jsdelivr.net/gh/pixitoons/pixitoons@v1.0.1/src/index.js';
|
|
17
17
|
|
|
18
18
|
const avatars = await createAvatars();
|
|
19
19
|
document.getElementById('me').src = await avatars.toURL('dana', { size: 256 });
|
|
@@ -23,9 +23,11 @@ composed in the browser from layered images, so there is no server to run and no
|
|
|
23
23
|
## Install in a project
|
|
24
24
|
|
|
25
25
|
```sh
|
|
26
|
-
npm install
|
|
26
|
+
npm install pixitoons
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
+
Or straight from a GitHub release: `npm install github:pixitoons/pixitoons#v1.0.1`.
|
|
30
|
+
|
|
29
31
|
```js
|
|
30
32
|
import { createAvatars } from 'pixitoons';
|
|
31
33
|
|
|
@@ -100,18 +102,18 @@ Types are in `index.d.ts`.
|
|
|
100
102
|
## Where the avatar files come from
|
|
101
103
|
|
|
102
104
|
By default from jsDelivr, at the GitHub release of the installed version:
|
|
103
|
-
`https://cdn.jsdelivr.net/gh/pixitoons/pixitoons@v1.0.
|
|
105
|
+
`https://cdn.jsdelivr.net/gh/pixitoons/pixitoons@v1.0.1/assets/`. A release cannot change after it is published, so
|
|
104
106
|
the code and the images of a version always belong together, and a site sees a new look only when it moves to a new
|
|
105
107
|
version itself.
|
|
106
108
|
|
|
107
109
|
To serve the files from your own site:
|
|
108
110
|
|
|
109
111
|
```sh
|
|
110
|
-
npx pixitoons copy-assets public/pixitoons # copies them to public/pixitoons/1.0.
|
|
112
|
+
npx pixitoons copy-assets public/pixitoons # copies them to public/pixitoons/1.0.1/ and checks every file
|
|
111
113
|
```
|
|
112
114
|
|
|
113
115
|
```js
|
|
114
|
-
const avatars = await createAvatars({ base: '/pixitoons/1.0.
|
|
116
|
+
const avatars = await createAvatars({ base: '/pixitoons/1.0.1/' });
|
|
115
117
|
```
|
|
116
118
|
|
|
117
119
|
`createAvatars` refuses files of another version with a message, so copy them again after an update.
|
|
@@ -156,16 +158,17 @@ that changes it is marked with a warning, and a release that changes it without
|
|
|
156
158
|
|
|
157
159
|
### Publishing to npm
|
|
158
160
|
|
|
159
|
-
The Release workflow
|
|
161
|
+
The Release workflow publishes every release to npm as well, with npm's trusted publishing (no token). It was set up
|
|
162
|
+
once, like this:
|
|
160
163
|
|
|
161
164
|
1. An npm account with two-factor authentication.
|
|
162
|
-
2. The first version by hand, from the
|
|
163
|
-
|
|
165
|
+
2. The first version by hand, from the package file of the GitHub release: `npm login`, then
|
|
166
|
+
`npm publish pixitoons-<version>.tgz --access public`, in a terminal window (npm asks for the second factor only
|
|
167
|
+
there).
|
|
168
|
+
3. On npmjs.com, the package's settings: a trusted publisher for GitHub Actions, organization `pixitoons`,
|
|
164
169
|
repository `pixitoons`, workflow `release.yml`, allowed to publish.
|
|
165
170
|
4. On GitHub, the repository's settings: Secrets and variables, Actions, Variables: `NPM_PUBLISH` = `true`.
|
|
166
171
|
|
|
167
|
-
After that, `npm install pixitoons` works, and every release reaches npm by itself.
|
|
168
|
-
|
|
169
172
|
## How the avatars are made
|
|
170
173
|
|
|
171
174
|
Every part (face, expression, hair, beard, glasses, headwear, clothing) was drawn once by an image model as an edit of
|
package/package.json
CHANGED
package/src/version.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// Written by scripts/sync-version.mjs, which `npm version` runs: the version of this package and the build of the
|
|
2
2
|
// avatar files in assets/ that it was released with. Do not edit by hand.
|
|
3
|
-
export const VERSION = '1.0.
|
|
3
|
+
export const VERSION = '1.0.1';
|
|
4
4
|
export const BUILD = '7990918ff2da';
|