@featherk/icons 0.15.8 → 0.16.0
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 -3
- package/dist/docs-manifest.d.ts +1 -0
- package/dist/docs-manifest.js +7 -5
- package/dist/fontawesome/build.cjs +1 -2
- package/dist/fontawesome/build.d.ts +1 -1
- package/dist/fontawesome/build.mjs +2 -3
- package/dist/fontawesome/catalog.cjs +0 -13
- package/dist/fontawesome/catalog.d.ts +0 -8
- package/dist/fontawesome/catalog.mjs +0 -13
- package/dist/fontawesome/chunks/{generate-BBurrhLv.cjs → generate-B_FxftR7.cjs} +12 -1
- package/dist/fontawesome/chunks/{generate-Zq9q2YZD.mjs → generate-DF9R65sV.mjs} +13 -2
- package/dist/fontawesome/chunks/manifest-CSRIDvaR.mjs +56 -0
- package/dist/fontawesome/chunks/manifest-Yjw62jxG.cjs +55 -0
- package/dist/fontawesome/cli.cjs +23 -26
- package/dist/fontawesome/cli.mjs +23 -26
- package/dist/fontawesome/generate.d.ts +7 -0
- package/dist/fontawesome/manifest.d.ts +36 -0
- package/dist/fontawesome/setup.cjs +185 -180
- package/dist/fontawesome/setup.d.ts +2 -2
- package/dist/fontawesome/setup.mjs +186 -181
- package/dist/fontawesome/vite.cjs +64 -28
- package/dist/fontawesome/vite.d.ts +26 -5
- package/dist/fontawesome/vite.mjs +65 -29
- package/docs/ICONS.md +1 -1
- package/docs/fontawesome/CreateFontAwesomeManifest.md +1 -1
- package/docs/fontawesome/FontAwesome.md +48 -44
- package/docs/fontawesome/FontAwesomeCLI.md +14 -19
- package/docs/fontawesome/FontAwesomeDeveloperSetup.md +134 -0
- package/docs/fontawesome/LICENSING.md +107 -66
- package/package.json +1 -1
- package/dist/fontawesome/chunks/manifest-BB3q10t1.mjs +0 -20
- package/dist/fontawesome/chunks/manifest-C15Xa22L.cjs +0 -19
|
@@ -20,15 +20,15 @@ The steps below are for Dev after UX/Design has selected the desired Pro variant
|
|
|
20
20
|
|
|
21
21
|
1. Confirm entitlement, Creator coverage, and approved releases with the license owner.
|
|
22
22
|
2. Dev obtains an authorized **Pro Package Token** from the Font Awesome account and supplies it privately as `FONTAWESOME_PACKAGE_TOKEN`.
|
|
23
|
-
3. Dev
|
|
24
|
-
4. Dev
|
|
23
|
+
3. Dev runs `featherk-fontawesome-setup --manifest fontawesome.keys.json`, which pins Free packages into the application and Pro packages into the private `fontawesome-pro-sources/` project at their exact catalog versions. See [Consuming Applications](#consuming-applications).
|
|
24
|
+
4. Dev builds with the application's normal scripts; wherever `fontawesome-pro-sources/` is installed, the builds include the Pro icons.
|
|
25
25
|
5. Dev preserves upstream notices and verifies publication/deployment boundaries before distribution.
|
|
26
26
|
|
|
27
27
|
A package token is not a Kit code, account password, or Kendo license key. Never paste it into chat, screenshots, source files, command arguments, or logs. Follow the organization's approved token issuance/rotation process; do not share account passwords.
|
|
28
28
|
|
|
29
29
|
## This FeatherK Repository
|
|
30
30
|
|
|
31
|
-
Normal root installation/build, Free demos, tests, and public package publishing require no Pro token. `demos/pro` is a separate private source project, not a root workspace. It requests exact `@fortawesome/pro-regular-svg-icons@7.0.0` and `@fortawesome/pro-light-svg-icons@7.0.0` packages; no paid dependency is added to the normal demo workspace or public icons package.
|
|
31
|
+
Normal root installation/build, Free demos, tests, and public package publishing require no Pro token. `demos/fontawesome-pro-sources` is a separate private source project, not a root workspace; it is the same [default layout](#default-isolated-pro-sources) every consuming application uses. It requests exact `@fortawesome/pro-regular-svg-icons@7.0.0` and `@fortawesome/pro-light-svg-icons@7.0.0` packages; no paid dependency is added to the normal demo workspace or public icons package.
|
|
32
32
|
|
|
33
33
|
The committed source-project npm configuration contains only a placeholder:
|
|
34
34
|
|
|
@@ -44,21 +44,21 @@ From the repository root, after confirming Steps 1-2:
|
|
|
44
44
|
```sh
|
|
45
45
|
# The Font Awesome commands run from the built package; build it first.
|
|
46
46
|
npm run build --workspace=@featherk/icons
|
|
47
|
-
# Step 3: Authenticated installation runs only inside demos/pro.
|
|
47
|
+
# Step 3: Authenticated installation runs only inside demos/fontawesome-pro-sources.
|
|
48
48
|
npm run setup:fontawesome:pro --workspace=@featherk/demos
|
|
49
|
-
# Step 4: Start the
|
|
50
|
-
npm run dev
|
|
49
|
+
# Step 4: Start the demo; with the sources installed, the Pro page renders.
|
|
50
|
+
npm run dev --workspace=@featherk/demos
|
|
51
51
|
# Step 5: Build the application and preserve emitted notices.
|
|
52
|
-
npm run build
|
|
52
|
+
npm run build --workspace=@featherk/demos
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
`setup:fontawesome:pro` runs `featherk-fontawesome-setup` without arguments, which installs `demos/fontawesome-pro-sources` from its committed lockfile with `npm ci`. The installer checks for the token without printing it. Review and commit dependency/integrity metadata for reproducible CI, ensuring it contains no credentials. Source `node_modules` and application artifacts remain ignored. No paid installation has been performed as part of implementing this setup.
|
|
56
56
|
|
|
57
57
|
The UX-approved Pro manifest requests Regular Rocket, Light Feather, and Light Heart. These pins are requested examples, not verified downloads. If entitlement, releases, or exports are unavailable, Dev must stop installation/generation and return to UX/Design for approval before changing the manifest or dependencies; never substitute silently.
|
|
58
58
|
|
|
59
|
-
The
|
|
59
|
+
The demo has no separate Pro scripts: its normal `dev` and `build` include the Pro icons once `demos/fontawesome-pro-sources` is installed, and only the Free icons otherwise. `demos/turbo.json` adds `fontawesome-pro-sources/node_modules/.package-lock.json`, which npm writes on install, to the build's cache inputs, so the root Turborepo build never replays a Free build where Pro sources are installed, or the reverse. Do not put paid outputs into shared or remote caches.
|
|
60
60
|
|
|
61
|
-
`
|
|
61
|
+
The demo's plugin options are `{ manifest: "fontawesome.keys.json" }`. With the sources installed, the plugin resolves licensed packages from `fontawesome-pro-sources/` while output guards remain relative to the demo project; Node resolution also finds already installed Free packages in parent workspace directories. Without them, it does not read that directory.
|
|
62
62
|
|
|
63
63
|
Routes are `/icons/fontawesome/free` and `/icons/fontawesome/pro`; `/icons/fontawesome` redirects to Free. The Pro page shows an unavailable state without a licensed profile, never fabricated artwork. Enabling the profile with missing/invalid sources fails the build rather than hiding an error.
|
|
64
64
|
|
|
@@ -77,7 +77,7 @@ setup_status=$?
|
|
|
77
77
|
unset fa_token
|
|
78
78
|
# Step 4: Start only after successful installation.
|
|
79
79
|
if [[ $setup_status -eq 0 ]]; then
|
|
80
|
-
npm run dev
|
|
80
|
+
npm run dev --workspace=@featherk/demos
|
|
81
81
|
fi
|
|
82
82
|
```
|
|
83
83
|
|
|
@@ -96,7 +96,7 @@ try {
|
|
|
96
96
|
Remove-Item Env:FONTAWESOME_PACKAGE_TOKEN -ErrorAction SilentlyContinue
|
|
97
97
|
}
|
|
98
98
|
# Step 4: Start only after successful installation.
|
|
99
|
-
npm run dev
|
|
99
|
+
npm run dev --workspace=@featherk/demos
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
Do not continue after an install error. `401`/`403` can indicate invalid/revoked credentials or insufficient entitlement. Inspect status codes without printing token/config contents. Missing releases/exports need a source/approval review, not an unpinned upgrade.
|
|
@@ -105,11 +105,11 @@ Do not continue after an install error. `401`/`403` can indicate invalid/revoked
|
|
|
105
105
|
|
|
106
106
|
Consumers need their own covered access or an enterprise agreement that actually covers them. The public FeatherK package grants no Pro rights.
|
|
107
107
|
|
|
108
|
-
`@featherk/icons` provides `featherk-fontawesome-setup` for consumer setup. Run it through `npx` or an npm script from the application root,
|
|
108
|
+
`@featherk/icons` provides `featherk-fontawesome-setup` for consumer setup. Run it through `npx` or an npm script from the application root, on a developer machine. It reads the UX-provided keys-only manifest, the same file the Vite plugin and CLI use (a `free` array of catalog keys plus an optional `pro` array), and pins each package to the exact catalog version.
|
|
109
109
|
|
|
110
|
-
###
|
|
110
|
+
### Default: Isolated Pro Sources
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
Every application uses this layout unless it has a specific reason not to:
|
|
113
113
|
|
|
114
114
|
```sh
|
|
115
115
|
npx featherk-fontawesome-setup --manifest fontawesome.keys.json
|
|
@@ -117,22 +117,78 @@ npx featherk-fontawesome-setup --manifest fontawesome.keys.json
|
|
|
117
117
|
|
|
118
118
|
The command:
|
|
119
119
|
|
|
120
|
-
1.
|
|
120
|
+
1. Installs the exact Free pins into the application's `devDependencies` from public npm. This step needs no token.
|
|
121
|
+
2. Writes the exact Pro pins into `fontawesome-pro-sources/`, a private source project next to the application's `package.json`, then installs it with the token from `FONTAWESOME_PACKAGE_TOKEN` or a hidden prompt. The project contains a `package.json`, a `.gitignore` for its `node_modules`, and an `.npmrc` with only the token placeholder:
|
|
121
122
|
|
|
122
123
|
```ini
|
|
123
124
|
@fortawesome:registry=https://npm.fontawesome.com/
|
|
124
125
|
//npm.fontawesome.com/:_authToken=${FONTAWESOME_PACKAGE_TOKEN}
|
|
125
126
|
```
|
|
126
127
|
|
|
127
|
-
|
|
128
|
+
Commit `package.json`, `package-lock.json`, and `fontawesome-pro-sources/`, including its `package-lock.json`. Configure the Vite plugin with `featherkFontAwesome({ manifest: "fontawesome.keys.json" })`.
|
|
128
129
|
|
|
129
|
-
|
|
130
|
+
The directory name `fontawesome-pro-sources` is fixed, so every team's setup looks the same. The plugin and CLI find the directory themselves, and installing it is what turns Pro icons on. The application's normal `dev` and `build` scripts need no changes:
|
|
130
131
|
|
|
131
|
-
|
|
132
|
+
- **Where `fontawesome-pro-sources/` is installed** (its `node_modules` exists), builds generate the `free` and `pro` keys, resolving Pro packages from it.
|
|
133
|
+
- **Where it is not installed**, builds generate the `free` keys alone and never read it. If a job should have installed it and didn't, code that uses a Pro key fails type checking, because the generated key union then contains only Free keys.
|
|
134
|
+
|
|
135
|
+
The application's own `npm ci` never needs the token, so developers and CI jobs without Pro access can still install it and build Free-only. Only installing `fontawesome-pro-sources/` needs Pro access, and everyone who does, or who builds where it is installed, needs an applicable seat.
|
|
136
|
+
|
|
137
|
+
A build cache keyed on tracked files, such as Turborepo's, must also key on whether the sources are installed, or it can replay a Free build where Pro is expected. Add the install marker that npm writes to the build's inputs, for example in Turborepo:
|
|
138
|
+
|
|
139
|
+
```json
|
|
140
|
+
"inputs": ["$TURBO_DEFAULT$", "fontawesome-pro-sources/node_modules/.package-lock.json"]
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Keep builds that include Pro icons out of shared or remote caches.
|
|
144
|
+
|
|
145
|
+
After changing the manifest, rerun the same command. It updates both sets of pins; when the Pro pins change, it removes the stale `fontawesome-pro-sources/package-lock.json` and the install regenerates it. Review and commit the result.
|
|
146
|
+
|
|
147
|
+
On a fresh clone and in CI, run the application's normal `npm ci`, then install the source project from its committed lockfile:
|
|
148
|
+
|
|
149
|
+
```sh
|
|
150
|
+
npx featherk-fontawesome-setup
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Without arguments, the command runs `npm ci` in `fontawesome-pro-sources/` with the token, skipping lifecycle scripts and ignoring npm workspace settings. In CI it requires the committed lockfile. See [CI and Deployment](#ci-and-deployment).
|
|
154
|
+
|
|
155
|
+
### Setup Safety Checks
|
|
156
|
+
|
|
157
|
+
Before supplying the token, the command checks the `.npmrc` it will install with: the application's for `--pro-in-app`, and `fontawesome-pro-sources/.npmrc` for the default layout. It refuses any of the following:
|
|
158
|
+
|
|
159
|
+
- a `@fortawesome` registry other than `https://npm.fontawesome.com/`
|
|
160
|
+
- any reference to `FONTAWESOME_PACKAGE_TOKEN` outside `//npm.fontawesome.com/:_authToken`
|
|
161
|
+
- any other `npm.fontawesome.com` credential, including a literal token
|
|
162
|
+
|
|
163
|
+
It also pins the Font Awesome registry on the npm command line, which overrides other npm configuration, so the token can only be sent to Font Awesome. It installs with `--ignore-scripts`, so lifecycle scripts never run while the token is present, passes the token only to that npm process, and never prints it. Setup with `--manifest` changes `package.json`, so it refuses to run in CI.
|
|
164
|
+
|
|
165
|
+
The layouts cannot be mixed in one application. The default setup refuses an application whose `.npmrc` already routes `@fortawesome` to the Pro registry, and `--pro-in-app` refuses an application that has `fontawesome-pro-sources/`.
|
|
166
|
+
|
|
167
|
+
### Exception: Free Only
|
|
168
|
+
|
|
169
|
+
For an application that will use only Free icons:
|
|
170
|
+
|
|
171
|
+
```sh
|
|
172
|
+
npx featherk-fontawesome-setup --manifest fontawesome.keys.json --free-only
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Free packages come from public npm. The command needs no token or CI configuration and creates no source project. The default command behaves the same way for a manifest without Pro keys; `--free-only` also guarantees it, failing if the manifest contains Pro keys, if `fontawesome-pro-sources/` exists, or if `.npmrc` routes `@fortawesome` to a registry. Configure the Vite plugin with `{ manifest: "fontawesome.keys.json" }`. To add Pro later, add the keys to the manifest and rerun without `--free-only`.
|
|
176
|
+
|
|
177
|
+
### Exception: Pro in the Application
|
|
178
|
+
|
|
179
|
+
Use this only when an isolated source project is not an option, for example when the application's toolchain cannot resolve packages from the separate `fontawesome-pro-sources/` project:
|
|
180
|
+
|
|
181
|
+
```sh
|
|
182
|
+
npx featherk-fontawesome-setup --manifest fontawesome.keys.json --pro-in-app
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
The command adds the two Font Awesome lines shown above to the application's own `.npmrc`, creating it if needed (existing settings are kept, and the lines are not duplicated on later runs), then installs the exact Free and Pro pins into the application's `devDependencies` with the token. Commit `.npmrc`, `package.json`, and `package-lock.json`, and configure the Vite plugin with `{ manifest: "fontawesome.keys.json" }`. Without `fontawesome-pro-sources/`, every build includes the Pro keys.
|
|
186
|
+
|
|
187
|
+
The cost is that the scope line routes **all** `@fortawesome` packages, Free included, to the Font Awesome registry. Every install of the application, by every developer and CI job, then needs `FONTAWESOME_PACKAGE_TOKEN` and an applicable seat.
|
|
132
188
|
|
|
133
189
|
#### Token-Scoped Installs
|
|
134
190
|
|
|
135
|
-
`npm ci` runs lifecycle scripts from the application and every dependency, and later build tools run arbitrary Node code. Any of them can read a token in their environment. Log masking and Vite's `VITE_` client-variable filter do not prevent this. Do not export the token persistently or for a whole CI build.
|
|
191
|
+
`npm ci` runs lifecycle scripts from the application and every dependency, and later build tools run arbitrary Node code. Any of them can read a token in their environment. Log masking and Vite's `VITE_` client-variable filter do not prevent this. Do not export the token persistently or for a whole CI build. In a Pro-in-the-application setup, give it only to an install that skips scripts, then run anything that needs scripts without it:
|
|
136
192
|
|
|
137
193
|
1. With the token: `npm ci --ignore-scripts`.
|
|
138
194
|
2. Without the token, run any install scripts the application needs:
|
|
@@ -165,49 +221,20 @@ try {
|
|
|
165
221
|
npm rebuild
|
|
166
222
|
```
|
|
167
223
|
|
|
168
|
-
The
|
|
224
|
+
The default layout needs none of this: the application's `npm ci` has no token, and `featherk-fontawesome-setup` already installs the source project with `--ignore-scripts`.
|
|
169
225
|
|
|
170
|
-
|
|
226
|
+
### Generation and Licensing Boundaries
|
|
171
227
|
|
|
172
|
-
|
|
173
|
-
- any reference to `FONTAWESOME_PACKAGE_TOKEN` outside `//npm.fontawesome.com/:_authToken`
|
|
174
|
-
- any other `npm.fontawesome.com` credential, including a literal token
|
|
228
|
+
Keep Pro keys in the manifest's `pro` group. Public or uncredentialed builds must not include paid inputs: run them where `fontawesome-pro-sources/` is not installed.
|
|
175
229
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
### Exception: Free Only
|
|
179
|
-
|
|
180
|
-
For an application that will use only Free icons:
|
|
181
|
-
|
|
182
|
-
```sh
|
|
183
|
-
npx featherk-fontawesome-setup --manifest fontawesome.keys.json --free-only
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
Free packages come from public npm. The command writes no `.npmrc` lines and needs no token or CI configuration. It fails if the manifest contains Pro keys, or if `.npmrc` already routes `@fortawesome` to a registry. Leave `allowPro` unset.
|
|
187
|
-
|
|
188
|
-
Free-only is a per-application choice, not a per-developer one. In a Free and Pro application, the lockfile resolves Free packages through the Font Awesome registry, so a developer without the token cannot install that application. To move a Free-only application to Pro later, add the Pro keys to the manifest and rerun the command without `--free-only`, then add the CI token parameter.
|
|
189
|
-
|
|
190
|
-
### Optional Pro: Isolated Source Project
|
|
191
|
-
|
|
192
|
-
Some projects must keep Pro optional so normal installs never need a token. FeatherK's own demos work this way. They install Pro packages into a separate private project and pass `sourceRoot` to the Vite plugin only in an authorized profile, for example `featherkFontAwesome({ keys, allowPro: true, sourceRoot: "pro" })`. The same command supports this layout:
|
|
193
|
-
|
|
194
|
-
```sh
|
|
195
|
-
# Scaffold .npmrc (token placeholder only), package.json with exact Pro pins, and .gitignore.
|
|
196
|
-
npx featherk-fontawesome-setup --source-root fontawesome-pro-sources --init --manifest fontawesome.keys.json
|
|
197
|
-
# Install with the token; this creates fontawesome-pro-sources/package-lock.json.
|
|
198
|
-
npx featherk-fontawesome-setup --source-root fontawesome-pro-sources
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
Commit the scaffolded files and the lockfile. `--init` pins only Pro keys, because Free packages belong in the application's own `devDependencies`. It refuses to overwrite existing files unless you pass `--force`, and it needs no token. When `--init --force` changes the dependencies, for example by adding a Pro package, it removes the now-stale `package-lock.json`. The next install then regenerates it with `npm install`; review and commit the new lockfile. After editing the source project's `package.json` by hand, run the install with `--refresh-lock` to update the lockfile. Later runs use `npm ci` in the source project and remove npm workspace settings, so `--workspace` invocations target only that project. In CI, `--init` and `--refresh-lock` are refused and the lockfile is required. The application's own `npm ci` needs no token. CI adds a separate token-scoped install step for the source project before the Pro build.
|
|
202
|
-
|
|
203
|
-
Keep Pro keys in the manifest's `pro` group and include them only in the authorized profile. Optional profiles must not silently include paid inputs in public/uncredentialed builds. The `dev:pro`/`build:pro` profile scripts above are repository demo helpers.
|
|
204
|
-
|
|
205
|
-
For non-Vite applications or declaration generation before a standalone type check, follow [CLI and non-Vite setup](FontAwesomeCLI.md). Registry authentication still belongs to the authorized package installation environment; the generator and browser never receive the token. The `allowPro` option prevents accidental selection; it does not verify license entitlement. Follow the [generated-output ignore guidance](FontAwesome.md#generated-output-and-source-checks): exclude generated files from ESLint/Prettier/Git while retaining TypeScript checks.
|
|
230
|
+
For non-Vite applications or declaration generation before a standalone type check, follow [CLI and non-Vite setup](FontAwesomeCLI.md). Registry authentication still belongs to the authorized package installation environment; the generator and browser never receive the token. Listing a key under `pro`, and installing `fontawesome-pro-sources/` only where Pro is wanted, prevent accidental selection; they do not verify license entitlement. Follow the [generated-output ignore guidance](FontAwesome.md#generated-output-and-source-checks): exclude generated files from ESLint/Prettier/Git while retaining TypeScript checks.
|
|
206
231
|
|
|
207
232
|
## CI and Deployment
|
|
208
233
|
|
|
209
234
|
FeatherK and `feather-k-<demo-name>` repositories use GitHub Actions. TeamCity applies only to enterprise apps using that platform.
|
|
210
235
|
|
|
236
|
+
In the default layout, a Pro build has three steps: the application's normal `npm ci` without the token, a token-scoped `npx featherk-fontawesome-setup` that installs `fontawesome-pro-sources/` from its lockfile, and the application's normal build without the token. Builds that don't need Pro icons skip the middle step and come out Free-only.
|
|
237
|
+
|
|
211
238
|
Use a dedicated trusted Actions job with a protected Environment and approval/branch rules. Supply the token only to source installation, not public publishing or client compilation. After checkout and Node/root dependency setup:
|
|
212
239
|
|
|
213
240
|
```yaml
|
|
@@ -217,39 +244,53 @@ Use a dedicated trusted Actions job with a protected Environment and approval/br
|
|
|
217
244
|
NPM_CONFIG_CACHE: ${{ runner.temp }}/fontawesome-pro-cache
|
|
218
245
|
run: npm run setup:fontawesome:pro --workspace=@featherk/demos
|
|
219
246
|
- name: Build licensed demo application
|
|
220
|
-
run: npm run build
|
|
247
|
+
run: npm run build --workspace=@featherk/demos
|
|
221
248
|
```
|
|
222
249
|
|
|
223
|
-
In CI, detected from `CI`, `TEAMCITY_VERSION`, or `GITHUB_ACTIONS`, the setup command refuses
|
|
250
|
+
In CI, detected from `CI`, `TEAMCITY_VERSION`, or `GITHUB_ACTIONS`, the setup command refuses `--manifest` setup, and the source-project install requires the committed `package-lock.json`. Unattended jobs therefore only run a locked `npm ci` and never resolve new versions. In every layout, supply the token only to the install step that skips lifecycle scripts, never to the whole job. With no token and no interactive terminal, the command fails instead of prompting.
|
|
224
251
|
|
|
225
252
|
Configure the protected Environment separately; this fragment grants no license rights. Restrict paid caches/archives/artifacts, and never execute untrusted PR code with the token, including via `pull_request_target`. Normal public FeatherK publishing must not receive Pro credentials or use the licensed profile.
|
|
226
253
|
|
|
227
254
|
### TeamCity
|
|
228
255
|
|
|
229
|
-
Do not define the token as an `env.` parameter. TeamCity passes `env.` parameters to every step in the build, so build tools and lifecycle scripts could read the token. Instead, scope it to
|
|
256
|
+
Do not define the token as an `env.` parameter. TeamCity passes `env.` parameters to every step in the build, so build tools and lifecycle scripts could read the token. Instead, scope it to one install step:
|
|
230
257
|
|
|
231
258
|
1. In the build configuration, add a parameter named `fontawesome.package.token` with type **Password**. Use no `env.` prefix, so TeamCity does not export it to the steps' environment.
|
|
232
|
-
2.
|
|
259
|
+
2. Add a Command Line step that sets the variable for one command only. Each Command Line step runs in its own process, so the variable does not carry into later steps.
|
|
233
260
|
|
|
234
|
-
|
|
261
|
+
For the [default layout](#default-isolated-pro-sources), leave the application's existing `npm ci` step unchanged and add this step after it:
|
|
235
262
|
|
|
236
263
|
```sh
|
|
237
|
-
|
|
264
|
+
# Linux agent
|
|
265
|
+
FONTAWESOME_PACKAGE_TOKEN='%fontawesome.package.token%' npx featherk-fontawesome-setup
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
```bat
|
|
269
|
+
rem Windows agent
|
|
270
|
+
set "FONTAWESOME_PACKAGE_TOKEN=%fontawesome.package.token%"
|
|
271
|
+
npx featherk-fontawesome-setup
|
|
238
272
|
```
|
|
239
273
|
|
|
240
|
-
|
|
274
|
+
Leave the build step unchanged: with the sources installed, the normal build includes the Pro icons.
|
|
275
|
+
|
|
276
|
+
For [Pro in the application](#exception-pro-in-the-application), change the existing install step instead:
|
|
277
|
+
|
|
278
|
+
```sh
|
|
279
|
+
# Linux agent
|
|
280
|
+
FONTAWESOME_PACKAGE_TOKEN='%fontawesome.package.token%' npm ci --ignore-scripts
|
|
281
|
+
```
|
|
241
282
|
|
|
242
283
|
```bat
|
|
284
|
+
rem Windows agent
|
|
243
285
|
set "FONTAWESOME_PACKAGE_TOKEN=%fontawesome.package.token%"
|
|
244
286
|
npm ci --ignore-scripts
|
|
245
287
|
```
|
|
246
288
|
|
|
247
|
-
|
|
248
|
-
4. Leave the build, test, and deploy steps unchanged. They never reference the parameter.
|
|
289
|
+
If the application or its dependencies need install scripts, add a step without the token. Use `npm rebuild` for dependency scripts, which follows `allowScripts` approvals on npm 12 and later. Run the application's own scripts explicitly, for example `npm run prepare --if-present`, because `npm rebuild` does not run them. See [Token-Scoped Installs](#token-scoped-installs).
|
|
249
290
|
|
|
250
|
-
|
|
291
|
+
3. Leave the build, test, and deploy steps free of the parameter. They never reference it.
|
|
251
292
|
|
|
252
|
-
|
|
293
|
+
Password parameters are masked in build logs, but masking does not stop code running in a step from reading the value. TeamCity also writes the step script, with the substituted value, to a temporary file on the agent. Limit the parameter to trusted build configurations and agents, and never run untrusted pull-request code in a build that defines it. Build agents must be able to reach `npm.fontawesome.com`. [Free-only](#exception-free-only) applications need no TeamCity configuration.
|
|
253
294
|
|
|
254
295
|
Tokens do not expand Creator seats.
|
|
255
296
|
|
package/package.json
CHANGED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { readFile } from "node:fs/promises";
|
|
2
|
-
const isKeyList = (value) => Array.isArray(value) && value.every((key) => typeof key === "string");
|
|
3
|
-
function parseFontAwesomeManifest(manifest) {
|
|
4
|
-
if (!manifest || typeof manifest !== "object" || Array.isArray(manifest)) {
|
|
5
|
-
throw new Error("Font Awesome manifest must be a JSON object");
|
|
6
|
-
}
|
|
7
|
-
const { free, pro } = manifest;
|
|
8
|
-
if (!isKeyList(free) || pro !== void 0 && !isKeyList(pro)) {
|
|
9
|
-
throw new Error(
|
|
10
|
-
'Font Awesome manifest must contain "free" and optional "pro" key arrays'
|
|
11
|
-
);
|
|
12
|
-
}
|
|
13
|
-
return { free, pro: pro ?? [] };
|
|
14
|
-
}
|
|
15
|
-
async function readFontAwesomeManifest(path) {
|
|
16
|
-
return parseFontAwesomeManifest(JSON.parse(await readFile(path, "utf8")));
|
|
17
|
-
}
|
|
18
|
-
export {
|
|
19
|
-
readFontAwesomeManifest as r
|
|
20
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const promises = require("node:fs/promises");
|
|
3
|
-
const isKeyList = (value) => Array.isArray(value) && value.every((key) => typeof key === "string");
|
|
4
|
-
function parseFontAwesomeManifest(manifest) {
|
|
5
|
-
if (!manifest || typeof manifest !== "object" || Array.isArray(manifest)) {
|
|
6
|
-
throw new Error("Font Awesome manifest must be a JSON object");
|
|
7
|
-
}
|
|
8
|
-
const { free, pro } = manifest;
|
|
9
|
-
if (!isKeyList(free) || pro !== void 0 && !isKeyList(pro)) {
|
|
10
|
-
throw new Error(
|
|
11
|
-
'Font Awesome manifest must contain "free" and optional "pro" key arrays'
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
return { free, pro: pro ?? [] };
|
|
15
|
-
}
|
|
16
|
-
async function readFontAwesomeManifest(path) {
|
|
17
|
-
return parseFontAwesomeManifest(JSON.parse(await promises.readFile(path, "utf8")));
|
|
18
|
-
}
|
|
19
|
-
exports.readFontAwesomeManifest = readFontAwesomeManifest;
|