react-native-nano-icons 1.0.1 → 1.1.0-beta.2

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 (138) hide show
  1. package/README.md +139 -21
  2. package/android/src/main/java/com/nanoicons/NanoIconFonts.kt +15 -0
  3. package/android/src/main/java/com/nanoicons/NanoIconView.kt +27 -4
  4. package/android/src/main/java/com/nanoicons/NanoIconViewManager.kt +7 -0
  5. package/android/src/main/java/com/nanoicons/NanoIconsFontLoaderModule.kt +3 -0
  6. package/common/cpp/react/renderer/components/RNNanoIconsSpec/NanoIconProps.cpp +6 -1
  7. package/common/cpp/react/renderer/components/RNNanoIconsSpec/NanoIconProps.h +4 -2
  8. package/ios/NanoIconView.mm +34 -44
  9. package/ios/NanoIconsFontLoader.mm +5 -0
  10. package/lib/commonjs/cli/build.d.ts +26 -0
  11. package/lib/commonjs/cli/build.js +174 -64
  12. package/lib/commonjs/cli/buildSymbols.d.ts +30 -1
  13. package/lib/commonjs/cli/buildSymbols.js +120 -42
  14. package/lib/commonjs/cli/expoConfig.d.ts +11 -0
  15. package/lib/commonjs/cli/expoConfig.js +28 -9
  16. package/lib/commonjs/cli/fingerprint.d.ts +15 -0
  17. package/lib/commonjs/cli/fingerprint.js +42 -0
  18. package/lib/commonjs/cli/index.d.ts +2 -2
  19. package/lib/commonjs/cli/index.js +3 -1
  20. package/lib/commonjs/cli/link.d.ts +4 -0
  21. package/lib/commonjs/cli/link.js +38 -1
  22. package/lib/commonjs/cli/sameOutputs.d.ts +5 -0
  23. package/lib/commonjs/cli/sameOutputs.js +45 -0
  24. package/lib/commonjs/index.node.js +1 -1
  25. package/lib/commonjs/plugin/src/buildFonts.d.ts +3 -2
  26. package/lib/commonjs/plugin/src/buildFonts.js +11 -3
  27. package/lib/commonjs/plugin/src/buildSymbols.d.ts +2 -2
  28. package/lib/commonjs/plugin/src/buildSymbols.js +10 -3
  29. package/lib/commonjs/plugin/src/frozen.d.ts +3 -0
  30. package/lib/commonjs/plugin/src/frozen.js +18 -0
  31. package/lib/commonjs/plugin/src/index.js +3 -3
  32. package/lib/commonjs/plugin/src/types.d.ts +22 -1
  33. package/lib/commonjs/plugin/src/withNanoIconsDrawableLinking.d.ts +1 -1
  34. package/lib/commonjs/plugin/src/withNanoIconsDrawableLinking.js +2 -2
  35. package/lib/commonjs/plugin/src/withNanoIconsFontLinking.d.ts +3 -3
  36. package/lib/commonjs/plugin/src/withNanoIconsFontLinking.js +8 -8
  37. package/lib/commonjs/plugin/src/withNanoIconsSymbolLinking.d.ts +1 -1
  38. package/lib/commonjs/plugin/src/withNanoIconsSymbolLinking.js +2 -2
  39. package/lib/commonjs/scripts/cli.js +31 -2
  40. package/lib/commonjs/src/core/flatten/dom.js +40 -5
  41. package/lib/commonjs/src/core/flatten/element.js +2 -1
  42. package/lib/commonjs/src/core/flatten/stages/collapse.js +12 -0
  43. package/lib/commonjs/src/core/font/compile.d.ts +0 -1
  44. package/lib/commonjs/src/core/font/compile.js +2 -8
  45. package/lib/commonjs/src/core/glyph/merge.d.ts +2 -1
  46. package/lib/commonjs/src/core/glyph/merge.js +27 -36
  47. package/lib/commonjs/src/core/glyph/parse.d.ts +1 -2
  48. package/lib/commonjs/src/core/glyph/parse.js +31 -18
  49. package/lib/commonjs/src/core/glyph/placement.d.ts +1 -0
  50. package/lib/commonjs/src/core/glyph/placement.js +9 -3
  51. package/lib/commonjs/src/core/pathkit/types.d.ts +1 -0
  52. package/lib/commonjs/src/core/pathkit/winding.d.ts +14 -3
  53. package/lib/commonjs/src/core/pathkit/winding.js +434 -7
  54. package/lib/commonjs/src/core/pipeline/config.d.ts +1 -0
  55. package/lib/commonjs/src/core/pipeline/prepare.d.ts +1 -1
  56. package/lib/commonjs/src/core/pipeline/prepare.js +4 -16
  57. package/lib/commonjs/src/core/pipeline/prepareIcon.d.ts +1 -0
  58. package/lib/commonjs/src/core/pipeline/prepareIcon.js +3 -1
  59. package/lib/commonjs/src/core/pipeline/prepareSymbol.d.ts +2 -0
  60. package/lib/commonjs/src/core/pipeline/prepareSymbol.js +15 -3
  61. package/lib/commonjs/src/core/pipeline/preparedSvgCache.js +2 -2
  62. package/lib/commonjs/src/core/pipeline/runFontPipeline.js +20 -12
  63. package/lib/commonjs/src/core/pipeline/runSymbolPipeline.d.ts +2 -0
  64. package/lib/commonjs/src/core/pipeline/runSymbolPipeline.js +2 -0
  65. package/lib/commonjs/src/core/symbols/contents.d.ts +1 -1
  66. package/lib/commonjs/src/core/symbols/contents.js +6 -2
  67. package/lib/commonjs/src/core/symbols/knockout.js +4 -3
  68. package/lib/commonjs/src/core/symbols/layers.d.ts +1 -0
  69. package/lib/commonjs/src/core/symbols/layers.js +133 -92
  70. package/lib/commonjs/src/core/symbols/template.d.ts +8 -3
  71. package/lib/commonjs/src/core/symbols/template.js +23 -8
  72. package/lib/commonjs/src/core/symbols/vectorDrawable.d.ts +8 -0
  73. package/lib/commonjs/src/core/symbols/vectorDrawable.js +28 -2
  74. package/lib/commonjs/src/utils/fingerPrint.d.ts +3 -0
  75. package/lib/commonjs/src/utils/fingerPrint.js +5 -1
  76. package/lib/commonjs/src/utils/fontIdentity.d.ts +1 -1
  77. package/lib/commonjs/src/utils/fontIdentity.js +2 -2
  78. package/lib/module/createNanoIconsSet.js +0 -1
  79. package/lib/module/createNanoIconsSet.native.js +22 -18
  80. package/lib/module/createNanoIconsSet.shared.js +32 -18
  81. package/lib/module/createNanoIconsSet.web.js +103 -61
  82. package/lib/module/devServerFont.js +1 -1
  83. package/lib/module/devServerFont.web.js +3 -5
  84. package/lib/module/fontIntegrity.js +20 -38
  85. package/lib/module/fontIntegrity.web.js +48 -0
  86. package/lib/module/fontIntegrityStore.js +65 -0
  87. package/lib/module/index.js +1 -1
  88. package/lib/module/index.node.js +1 -1
  89. package/lib/module/index.web.js +4 -0
  90. package/lib/module/loadDynamicFont.js +3 -15
  91. package/lib/module/specs/NanoIconViewNativeComponent.ts +2 -1
  92. package/lib/module/utils/fingerPrint.js +4 -3
  93. package/lib/module/utils/fontIdentity.js +2 -2
  94. package/lib/module/utils/fontScale.js +10 -2
  95. package/lib/module/utils/glyphRuntime.js +13 -0
  96. package/lib/module/utils/iconAccessibility.js +26 -0
  97. package/lib/module/utils/iconPropsEqual.js +27 -0
  98. package/lib/module/utils/webCss.js +26 -0
  99. package/lib/module/utils/webStyle.js +86 -0
  100. package/lib/module/webFont.js +33 -0
  101. package/lib/typescript/src/const/codegenPrimitives.d.ts +1 -0
  102. package/lib/typescript/src/core/glyph/merge.d.ts +2 -1
  103. package/lib/typescript/src/core/glyph/parse.d.ts +1 -2
  104. package/lib/typescript/src/core/glyph/placement.d.ts +1 -0
  105. package/lib/typescript/src/core/pathkit/types.d.ts +1 -0
  106. package/lib/typescript/src/core/pathkit/winding.d.ts +14 -3
  107. package/lib/typescript/src/core/symbols/contents.d.ts +1 -1
  108. package/lib/typescript/src/core/symbols/layers.d.ts +1 -0
  109. package/lib/typescript/src/core/symbols/template.d.ts +8 -3
  110. package/lib/typescript/src/core/symbols/vectorDrawable.d.ts +8 -0
  111. package/lib/typescript/src/createNanoIconsSet.d.ts +0 -1
  112. package/lib/typescript/src/createNanoIconsSet.native.d.ts +0 -2
  113. package/lib/typescript/src/createNanoIconsSet.shared.d.ts +1 -3
  114. package/lib/typescript/src/createNanoIconsSet.web.d.ts +1 -2
  115. package/lib/typescript/src/fontIntegrity.d.ts +2 -14
  116. package/lib/typescript/src/fontIntegrity.web.d.ts +7 -0
  117. package/lib/typescript/src/fontIntegrityStore.d.ts +19 -0
  118. package/lib/typescript/src/index.d.ts +2 -1
  119. package/lib/typescript/src/index.web.d.ts +5 -0
  120. package/lib/typescript/src/loadDynamicFont.d.ts +0 -1
  121. package/lib/typescript/src/specs/NanoIconViewNativeComponent.d.ts +2 -1
  122. package/lib/typescript/src/specs/NativeNanoIconsFontLoader.d.ts +1 -0
  123. package/lib/typescript/src/types.d.ts +37 -9
  124. package/lib/typescript/src/utils/fingerPrint.d.ts +3 -0
  125. package/lib/typescript/src/utils/fontIdentity.d.ts +1 -1
  126. package/lib/typescript/src/utils/glyphRuntime.d.ts +8 -0
  127. package/lib/typescript/src/utils/iconAccessibility.d.ts +4 -0
  128. package/lib/typescript/src/utils/iconPropsEqual.d.ts +4 -0
  129. package/lib/typescript/src/utils/webCss.d.ts +9 -0
  130. package/lib/typescript/src/utils/webStyle.d.ts +3 -0
  131. package/lib/typescript/src/webFont.d.ts +6 -0
  132. package/package.json +19 -3
  133. package/src/const/codegenPrimitives.ts +3 -3
  134. package/src/specs/NanoIconViewNativeComponent.ts +2 -1
  135. package/src/specs/NativeNanoIconsFontLoader.ts +1 -0
  136. package/lib/commonjs/src/core/pathkit/evenodd.d.ts +0 -12
  137. package/lib/commonjs/src/core/pathkit/evenodd.js +0 -37
  138. package/lib/typescript/src/core/pathkit/evenodd.d.ts +0 -13
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadDynamicSetsFromAppConfig = loadDynamicSetsFromAppConfig;
4
4
  exports.loadIconSetsFromAppConfig = loadIconSetsFromAppConfig;
5
5
  exports.loadSymbolSetsFromAppConfig = loadSymbolSetsFromAppConfig;
6
+ exports.findPluginOptions = findPluginOptions;
7
+ exports.resolveExpoConfigModule = resolveExpoConfigModule;
6
8
  /**
7
9
  * Load icon sets configured with linking: 'dynamic' from the Expo app config
8
10
  * (app.json, app.config.js, or app.config.ts).
@@ -11,6 +13,10 @@ exports.loadSymbolSetsFromAppConfig = loadSymbolSetsFromAppConfig;
11
13
  * falling back to @expo/config.
12
14
  */
13
15
  function loadDynamicSetsFromAppConfig(projectRoot) {
16
+ if (!resolveExpoConfigModule(projectRoot)) {
17
+ throw new Error(`[react-native-nano-icons] Could not find expo/config or @expo/config from ${projectRoot} — required for --dynamic-app-config.\n` +
18
+ `Run the command from your Expo app root, or pass --path <app root>.`);
19
+ }
14
20
  const dynamicSets = loadIconSetsFromAppConfig(projectRoot).filter((s) => s.linking === 'dynamic');
15
21
  if (dynamicSets.length === 0) {
16
22
  throw new Error(`[react-native-nano-icons] No icon sets with linking: "dynamic" found.\n` +
@@ -18,6 +24,11 @@ function loadDynamicSetsFromAppConfig(projectRoot) {
18
24
  }
19
25
  return dynamicSets;
20
26
  }
27
+ const PLUGIN_NAMES = [
28
+ 'react-native-nano-icons',
29
+ 'react-native-nano-icons/app.plugin',
30
+ 'react-native-nano-icons/app.plugin.js',
31
+ ];
21
32
  function loadIconSetsFromAppConfig(projectRoot) {
22
33
  return loadPluginOptions(projectRoot).iconSets ?? [];
23
34
  }
@@ -25,21 +36,29 @@ function loadSymbolSetsFromAppConfig(projectRoot) {
25
36
  return loadPluginOptions(projectRoot).symbolSets ?? [];
26
37
  }
27
38
  function loadPluginOptions(projectRoot) {
39
+ const options = findPluginOptions(projectRoot);
40
+ if (!options) {
41
+ throw new Error(`[react-native-nano-icons] Plugin "react-native-nano-icons" not found in app config.\n` +
42
+ `Add it to your app.json or app.config.js/ts under the "plugins" key.`);
43
+ }
44
+ return options;
45
+ }
46
+ /**
47
+ * The plugin options in the Expo app config, `{}` when the plugin is listed without options,
48
+ * or `undefined` when it is not listed.
49
+ */
50
+ function findPluginOptions(projectRoot) {
28
51
  const configModule = resolveExpoConfigModule(projectRoot);
29
52
  if (!configModule) {
30
- throw new Error(`[react-native-nano-icons] Could not find expo/config or @expo/config from ${projectRoot} — required for --dynamic-app-config.\n` +
31
- `Run the command from your Expo app root, or pass --path <app root>.`);
53
+ throw new Error(`[react-native-nano-icons] Could not find expo/config or @expo/config from ${projectRoot}.`);
32
54
  }
33
55
  const { getConfig } = require(configModule);
34
56
  const { exp } = getConfig(projectRoot, { skipSDKVersionRequirement: true });
35
57
  const plugins = Array.isArray(exp.plugins) ? exp.plugins : [];
36
- const entry = plugins.find((p) => Array.isArray(p) && p[0] === 'react-native-nano-icons');
37
- if (!entry) {
38
- throw new Error(`[react-native-nano-icons] Plugin "react-native-nano-icons" not found in app config.\n` +
39
- `Add it to your app.json or app.config.js/ts under the "plugins" key.`);
40
- }
41
- const [, options] = entry;
42
- return options;
58
+ const entry = plugins.find((p) => PLUGIN_NAMES.includes(Array.isArray(p) ? p[0] : p));
59
+ if (!entry)
60
+ return undefined;
61
+ return (Array.isArray(entry) ? entry[1] : undefined) ?? {};
43
62
  }
44
63
  function resolveExpoConfigModule(projectRoot) {
45
64
  const candidates = [
@@ -0,0 +1,15 @@
1
+ /** An `@expo/fingerprint` hash source of type `contents`. */
2
+ export type FingerprintSource = {
3
+ type: 'contents';
4
+ id: string;
5
+ contents: string;
6
+ reasons: string[];
7
+ };
8
+ /**
9
+ * `extraSources` for `fingerprint.config.js`, read from the plugin options in the Expo app config.
10
+ * Icon sets with `linking: 'static'` and symbol sets are built into the native app, so each adds its
11
+ * input fingerprint: its SVGs, its options, and the installed library and font toolchain versions.
12
+ * Dynamic icon sets are left out, because an update delivers them.
13
+ * Returns no sources when the plugin is not configured, and warns and returns none when the sets can't be read.
14
+ */
15
+ export declare function nanoIconsFingerprintSources(projectRoot: string): FingerprintSource[];
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.nanoIconsFingerprintSources = nanoIconsFingerprintSources;
4
+ const build_1 = require("./build");
5
+ const buildSymbols_1 = require("./buildSymbols");
6
+ const expoConfig_1 = require("./expoConfig");
7
+ const REASONS = ['react-native-nano-icons'];
8
+ /**
9
+ * `extraSources` for `fingerprint.config.js`, read from the plugin options in the Expo app config.
10
+ * Icon sets with `linking: 'static'` and symbol sets are built into the native app, so each adds its
11
+ * input fingerprint: its SVGs, its options, and the installed library and font toolchain versions.
12
+ * Dynamic icon sets are left out, because an update delivers them.
13
+ * Returns no sources when the plugin is not configured, and warns and returns none when the sets can't be read.
14
+ */
15
+ function nanoIconsFingerprintSources(projectRoot) {
16
+ if (!(0, expoConfig_1.resolveExpoConfigModule)(projectRoot)) {
17
+ console.warn(`[react-native-nano-icons] No fingerprint sources added: Could not find expo/config or @expo/config from ${projectRoot}.\n` +
18
+ `Pass the folder of your app config, e.g. nanoIconsFingerprintSources(__dirname) in a fingerprint.config.js next to it.`);
19
+ return [];
20
+ }
21
+ try {
22
+ const options = (0, expoConfig_1.findPluginOptions)(projectRoot);
23
+ const iconSets = (0, build_1.fingerprintIconSets)((options?.iconSets ?? []).filter((set) => set.linking !== 'dynamic'), projectRoot).map(({ fontFamily, hash }) => ({
24
+ type: 'contents',
25
+ id: `react-native-nano-icons:iconSet:${fontFamily}`,
26
+ contents: hash,
27
+ reasons: REASONS,
28
+ }));
29
+ const symbolSets = (0, buildSymbols_1.fingerprintSymbolSets)(options?.symbolSets ?? [], projectRoot).map(({ name, hash }) => ({
30
+ type: 'contents',
31
+ id: `react-native-nano-icons:symbolSet:${name}`,
32
+ contents: hash,
33
+ reasons: REASONS,
34
+ }));
35
+ return [...iconSets, ...symbolSets];
36
+ }
37
+ catch (err) {
38
+ const message = err instanceof Error ? err.message : String(err);
39
+ console.warn(`[react-native-nano-icons] No fingerprint sources added: ${message.replace(/^\[react-native-nano-icons\] /, '')}`);
40
+ return [];
41
+ }
42
+ }
@@ -1,5 +1,5 @@
1
- export { buildAllFonts, IconSetBuildError, type IconSetConfig, type BuiltFont, } from './build';
2
- export { buildAllSymbols, SymbolSetBuildError, type SymbolSetConfig, type BuiltSymbolSet, } from './buildSymbols';
1
+ export { buildAllFonts, checkAllFonts, IconSetBuildError, type IconSetConfig, type BuiltFont, type StaleSet, } from './build';
2
+ export { buildAllSymbols, checkAllSymbols, SymbolSetBuildError, type SymbolSetConfig, type BuiltSymbolSet, } from './buildSymbols';
3
3
  export { SvgWorkerPool, type PreparedSvgCache, } from '../src/core/pipeline/index';
4
4
  export { createOraLogger, createQuietLogger, detectExpoLogLevel, type NanoLogger, type LogLevel, } from './logger';
5
5
  export { loadNanoIconsConfig, loadDynamicIconSets, type NanoIconsConfig, } from './config';
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.copyDrawablesIntoResDir = exports.linkBareAndroidDrawables = exports.copySymbolsetsIntoCatalog = exports.linkBareSymbols = exports.syncAndroidFontAssets = exports.linkBare = exports.loadSymbolSetsFromAppConfig = exports.loadIconSetsFromAppConfig = exports.loadDynamicSetsFromAppConfig = exports.loadDynamicIconSets = exports.loadNanoIconsConfig = exports.detectExpoLogLevel = exports.createQuietLogger = exports.createOraLogger = exports.SvgWorkerPool = exports.SymbolSetBuildError = exports.buildAllSymbols = exports.IconSetBuildError = exports.buildAllFonts = void 0;
3
+ exports.copyDrawablesIntoResDir = exports.linkBareAndroidDrawables = exports.copySymbolsetsIntoCatalog = exports.linkBareSymbols = exports.syncAndroidFontAssets = exports.linkBare = exports.loadSymbolSetsFromAppConfig = exports.loadIconSetsFromAppConfig = exports.loadDynamicSetsFromAppConfig = exports.loadDynamicIconSets = exports.loadNanoIconsConfig = exports.detectExpoLogLevel = exports.createQuietLogger = exports.createOraLogger = exports.SvgWorkerPool = exports.SymbolSetBuildError = exports.checkAllSymbols = exports.buildAllSymbols = exports.IconSetBuildError = exports.checkAllFonts = exports.buildAllFonts = void 0;
4
4
  var build_1 = require("./build");
5
5
  Object.defineProperty(exports, "buildAllFonts", { enumerable: true, get: function () { return build_1.buildAllFonts; } });
6
+ Object.defineProperty(exports, "checkAllFonts", { enumerable: true, get: function () { return build_1.checkAllFonts; } });
6
7
  Object.defineProperty(exports, "IconSetBuildError", { enumerable: true, get: function () { return build_1.IconSetBuildError; } });
7
8
  var buildSymbols_1 = require("./buildSymbols");
8
9
  Object.defineProperty(exports, "buildAllSymbols", { enumerable: true, get: function () { return buildSymbols_1.buildAllSymbols; } });
10
+ Object.defineProperty(exports, "checkAllSymbols", { enumerable: true, get: function () { return buildSymbols_1.checkAllSymbols; } });
9
11
  Object.defineProperty(exports, "SymbolSetBuildError", { enumerable: true, get: function () { return buildSymbols_1.SymbolSetBuildError; } });
10
12
  var index_1 = require("../src/core/pipeline/index");
11
13
  Object.defineProperty(exports, "SvgWorkerPool", { enumerable: true, get: function () { return index_1.SvgWorkerPool; } });
@@ -2,6 +2,10 @@ import type { NanoLogger } from './logger';
2
2
  import type { BuiltFont } from './build';
3
3
  import type { BuiltSymbolSet } from './buildSymbols';
4
4
  export declare function syncAndroidFontAssets(fontsDir: string, staticFonts: BuiltFont[], configuredFamilies: string[]): void;
5
+ /**
6
+ * Why the copy of a static font linked into the app's android/ or ios/ project differs from the generated TTF, if it does.
7
+ */
8
+ export declare function staleLinkedFont(projectRoot: string, family: string, ttfPath: string): string | undefined;
5
9
  export declare function copySymbolsetsIntoCatalog(catalogDir: string, builtSymbolSets: BuiltSymbolSet[]): void;
6
10
  /**
7
11
  * Link custom SF Symbols into the iOS app. Primary path writes into the app's
@@ -37,6 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.syncAndroidFontAssets = syncAndroidFontAssets;
40
+ exports.staleLinkedFont = staleLinkedFont;
40
41
  exports.copySymbolsetsIntoCatalog = copySymbolsetsIntoCatalog;
41
42
  exports.linkBareSymbols = linkBareSymbols;
42
43
  exports.copyDrawablesIntoResDir = copyDrawablesIntoResDir;
@@ -46,6 +47,7 @@ const node_fs_1 = __importDefault(require("node:fs"));
46
47
  const node_path_1 = __importDefault(require("node:path"));
47
48
  const plist = __importStar(require("plist"));
48
49
  const contents_1 = require("../src/core/symbols/contents");
50
+ const vectorDrawable_1 = require("../src/core/symbols/vectorDrawable");
49
51
  const naming_1 = require("../src/utils/naming");
50
52
  const fontIdentity_1 = require("../src/utils/fontIdentity");
51
53
  const ANDROID_FONTS_DIR = 'android/app/src/main/assets/fonts';
@@ -118,6 +120,30 @@ function syncAndroidFontAssets(fontsDir, staticFonts, configuredFamilies) {
118
120
  node_fs_1.default.copyFileSync(b.ttfPath, node_path_1.default.join(fontsDir, `${b.family}.ttf`));
119
121
  }
120
122
  }
123
+ /**
124
+ * Why the copy of a static font linked into the app's android/ or ios/ project differs from the generated TTF, if it does.
125
+ */
126
+ function staleLinkedFont(projectRoot, family, ttfPath) {
127
+ const copies = [
128
+ ...(node_fs_1.default.existsSync(node_path_1.default.join(projectRoot, 'android'))
129
+ ? [node_path_1.default.join(projectRoot, ANDROID_FONTS_DIR, `${family}.ttf`)]
130
+ : []),
131
+ ...(findIosApp(projectRoot)
132
+ ? [
133
+ node_path_1.default.join(projectRoot, 'ios', IOS_NANOICONS_FONTS_DIR, node_path_1.default.basename(ttfPath)),
134
+ ]
135
+ : []),
136
+ ];
137
+ const ttf = node_fs_1.default.readFileSync(ttfPath);
138
+ for (const copy of copies) {
139
+ const relative = node_path_1.default.relative(projectRoot, copy);
140
+ if (!node_fs_1.default.existsSync(copy))
141
+ return `${relative} is missing`;
142
+ if (!node_fs_1.default.readFileSync(copy).equals(ttf))
143
+ return `${relative} is out of date`;
144
+ }
145
+ return undefined;
146
+ }
121
147
  async function linkAndroid(projectRoot, staticFonts, builtFonts) {
122
148
  syncAndroidFontAssets(node_path_1.default.join(projectRoot, ANDROID_FONTS_DIR), staticFonts, builtFonts.map((b) => b.fontFamily));
123
149
  }
@@ -210,6 +236,7 @@ const XML_FILE_RE = /\.xml$/;
210
236
  // scan below only sees names still in the config.
211
237
  const SYMBOL_LEDGER = '.nanoicons-catalog.json';
212
238
  const DRAWABLE_LEDGER = '.nanoicons-drawables.json';
239
+ const DRAWABLE_KEEP_FILE = 'nanoicons_keep.xml';
213
240
  function readLedger(ledgerPath) {
214
241
  try {
215
242
  const names = JSON.parse(node_fs_1.default.readFileSync(ledgerPath, 'utf8'));
@@ -309,7 +336,9 @@ async function linkBareSymbols(projectRoot, builtSymbolSets, logger) {
309
336
  // ---------------------------------------------------------------------------
310
337
  // Copy generated VectorDrawable XML into a res/drawable dir, first removing what
311
338
  // we linked last time (ledger) plus any current-prefix match. Handles removed
312
- // icons, prefix renames and dropped sets.
339
+ // icons, prefix renames and dropped sets. A keep file in res/raw lists them so
340
+ // release builds with resource shrinking don't strip them from react-native-screens'
341
+ // tab bar, which looks them up by name.
313
342
  function copyDrawablesIntoResDir(drawableDir, builtSymbolSets) {
314
343
  node_fs_1.default.mkdirSync(drawableDir, { recursive: true });
315
344
  const outputDir = builtSymbolSets[0]
@@ -342,6 +371,14 @@ function copyDrawablesIntoResDir(drawableDir, builtSymbolSets) {
342
371
  }
343
372
  if (ledgerPath)
344
373
  node_fs_1.default.writeFileSync(ledgerPath, JSON.stringify(linked));
374
+ const keepPath = node_path_1.default.join(node_path_1.default.dirname(drawableDir), 'raw', DRAWABLE_KEEP_FILE);
375
+ if (linked.length) {
376
+ node_fs_1.default.mkdirSync(node_path_1.default.dirname(keepPath), { recursive: true });
377
+ node_fs_1.default.writeFileSync(keepPath, (0, vectorDrawable_1.buildDrawableKeepXml)(linked.map((name) => name.replace(XML_FILE_RE, ''))), 'utf8');
378
+ }
379
+ else {
380
+ node_fs_1.default.rmSync(keepPath, { force: true });
381
+ }
345
382
  }
346
383
  /**
347
384
  * Link generated VectorDrawables into the Android app's res/drawable. They are
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Whether `build`, run into a temp dir, writes the same files as those in `outputDir`.
3
+ * In `mapFile` the stored input fingerprint `m.h` is ignored.
4
+ */
5
+ export declare function buildsSameOutputs(outputDir: string, mapFile: string, build: (tempDir: string) => Promise<unknown>): Promise<boolean>;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.buildsSameOutputs = buildsSameOutputs;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const os_1 = __importDefault(require("os"));
9
+ const path_1 = __importDefault(require("path"));
10
+ /**
11
+ * Whether `build`, run into a temp dir, writes the same files as those in `outputDir`.
12
+ * In `mapFile` the stored input fingerprint `m.h` is ignored.
13
+ */
14
+ async function buildsSameOutputs(outputDir, mapFile, build) {
15
+ const tempDir = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'nano-check-'));
16
+ try {
17
+ await build(tempDir);
18
+ return fs_1.default
19
+ .readdirSync(tempDir)
20
+ .every((entry) => sameEntry(path_1.default.join(tempDir, entry), path_1.default.join(outputDir, entry), mapFile));
21
+ }
22
+ finally {
23
+ fs_1.default.rmSync(tempDir, { recursive: true, force: true });
24
+ }
25
+ }
26
+ function sameEntry(built, existing, mapFile) {
27
+ if (!fs_1.default.existsSync(existing))
28
+ return false;
29
+ if (fs_1.default.statSync(built).isDirectory()) {
30
+ if (!fs_1.default.statSync(existing).isDirectory())
31
+ return false;
32
+ const entries = fs_1.default.readdirSync(built).sort();
33
+ return (entries.join('\n') === fs_1.default.readdirSync(existing).sort().join('\n') &&
34
+ entries.every((entry) => sameEntry(path_1.default.join(built, entry), path_1.default.join(existing, entry), mapFile)));
35
+ }
36
+ if (path_1.default.basename(built) === mapFile) {
37
+ return withoutInputHash(built) === withoutInputHash(existing);
38
+ }
39
+ return fs_1.default.readFileSync(built).equals(fs_1.default.readFileSync(existing));
40
+ }
41
+ function withoutInputHash(file) {
42
+ const map = JSON.parse(fs_1.default.readFileSync(file, 'utf8'));
43
+ delete map?.m?.h;
44
+ return JSON.stringify(map);
45
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const createNanoIconSet = (...args) => {
3
- const { createIconSet } = require('./createNanoIconsSet');
3
+ const { createIconSet } = require('../module/createNanoIconsSet.web.js');
4
4
  return createIconSet(...args);
5
5
  };
6
6
  const plugin = require('./plugin/src/index')
@@ -2,7 +2,8 @@ import type { IconSetConfig, BuiltFont } from './types';
2
2
  /**
3
3
  * Build TTF + glyphmap for all icon sets.
4
4
  * Reports every broken icon, then fails the prebuild so no set is silently left unlinked.
5
+ * When frozen, fails the prebuild instead when a set is out of date, and builds nothing.
5
6
  * EXPO_DEBUG adds the per-file processing details.
6
7
  */
7
- export declare function buildAllFonts(iconSets: IconSetConfig[], projectRoot: string): Promise<BuiltFont[]>;
8
- export declare function getOrBuildFonts(projectRoot: string, iconSets: IconSetConfig[]): Promise<BuiltFont[]>;
8
+ export declare function buildAllFonts(iconSets: IconSetConfig[], projectRoot: string, frozen?: boolean): Promise<BuiltFont[]>;
9
+ export declare function getOrBuildFonts(projectRoot: string, iconSets: IconSetConfig[], frozen?: boolean): Promise<BuiltFont[]>;
@@ -3,20 +3,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildAllFonts = buildAllFonts;
4
4
  exports.getOrBuildFonts = getOrBuildFonts;
5
5
  const index_1 = require("../../cli/index");
6
+ const frozen_1 = require("./frozen");
6
7
  /**
7
8
  * Build TTF + glyphmap for all icon sets.
8
9
  * Reports every broken icon, then fails the prebuild so no set is silently left unlinked.
10
+ * When frozen, fails the prebuild instead when a set is out of date, and builds nothing.
9
11
  * EXPO_DEBUG adds the per-file processing details.
10
12
  */
11
- async function buildAllFonts(iconSets, projectRoot) {
13
+ async function buildAllFonts(iconSets, projectRoot, frozen) {
12
14
  const logger = await (0, index_1.createQuietLogger)((0, index_1.detectExpoLogLevel)());
15
+ const scope = (0, frozen_1.frozenScope)(frozen);
16
+ if (scope !== 'none') {
17
+ (0, frozen_1.failFrozenPrebuild)(await (0, index_1.checkAllFonts)(iconSets, projectRoot, {
18
+ existingOnly: scope === 'existing',
19
+ }));
20
+ }
13
21
  return (0, index_1.buildAllFonts)(iconSets, projectRoot, { logger });
14
22
  }
15
23
  // Single build run per process; reused across ios/android mods.
16
24
  let _buildPromise = null;
17
- function getOrBuildFonts(projectRoot, iconSets) {
25
+ function getOrBuildFonts(projectRoot, iconSets, frozen) {
18
26
  if (!_buildPromise) {
19
- _buildPromise = buildAllFonts(iconSets, projectRoot);
27
+ _buildPromise = buildAllFonts(iconSets, projectRoot, frozen);
20
28
  }
21
29
  return _buildPromise;
22
30
  }
@@ -1,3 +1,3 @@
1
1
  import type { SymbolSetConfig, BuiltSymbolSet } from './types';
2
- export declare function buildAllSymbols(symbolSets: SymbolSetConfig[], projectRoot: string): Promise<BuiltSymbolSet[]>;
3
- export declare function getOrBuildSymbols(projectRoot: string, symbolSets: SymbolSetConfig[]): Promise<BuiltSymbolSet[]>;
2
+ export declare function buildAllSymbols(symbolSets: SymbolSetConfig[], projectRoot: string, frozen?: boolean): Promise<BuiltSymbolSet[]>;
3
+ export declare function getOrBuildSymbols(projectRoot: string, symbolSets: SymbolSetConfig[], frozen?: boolean): Promise<BuiltSymbolSet[]>;
@@ -3,16 +3,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildAllSymbols = buildAllSymbols;
4
4
  exports.getOrBuildSymbols = getOrBuildSymbols;
5
5
  const index_1 = require("../../cli/index");
6
+ const frozen_1 = require("./frozen");
6
7
  // Build all symbol sets.
7
- async function buildAllSymbols(symbolSets, projectRoot) {
8
+ async function buildAllSymbols(symbolSets, projectRoot, frozen) {
8
9
  const logger = await (0, index_1.createQuietLogger)((0, index_1.detectExpoLogLevel)());
10
+ const scope = (0, frozen_1.frozenScope)(frozen);
11
+ if (scope !== 'none') {
12
+ (0, frozen_1.failFrozenPrebuild)(await (0, index_1.checkAllSymbols)(symbolSets, projectRoot, {
13
+ existingOnly: scope === 'existing',
14
+ }));
15
+ }
9
16
  return (0, index_1.buildAllSymbols)(symbolSets, projectRoot, { logger });
10
17
  }
11
18
  // Single build run per process; reused across mods.
12
19
  let _buildPromise = null;
13
- function getOrBuildSymbols(projectRoot, symbolSets) {
20
+ function getOrBuildSymbols(projectRoot, symbolSets, frozen) {
14
21
  if (!_buildPromise) {
15
- _buildPromise = buildAllSymbols(symbolSets, projectRoot);
22
+ _buildPromise = buildAllSymbols(symbolSets, projectRoot, frozen);
16
23
  }
17
24
  return _buildPromise;
18
25
  }
@@ -0,0 +1,3 @@
1
+ import type { StaleSet } from '../../cli/index';
2
+ export declare function frozenScope(frozen: boolean | undefined): 'all' | 'existing' | 'none';
3
+ export declare function failFrozenPrebuild(stale: StaleSet[]): void;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.frozenScope = frozenScope;
4
+ exports.failFrozenPrebuild = failFrozenPrebuild;
5
+ function frozenScope(frozen) {
6
+ if (frozen !== undefined)
7
+ return frozen ? 'all' : 'none';
8
+ const ci = process.env.CI?.toLowerCase();
9
+ return ci && ci !== 'false' && ci !== '0' ? 'existing' : 'none';
10
+ }
11
+ function failFrozenPrebuild(stale) {
12
+ if (!stale.length)
13
+ return;
14
+ const sets = stale
15
+ .map(({ name, reason }) => `${name} (${reason})`)
16
+ .join(', ');
17
+ throw new Error(`[react-native-nano-icons] frozen is on, but ${stale.length === 1 ? '1 set is' : `${stale.length} sets are`} out of date: ${sets}. Rebuild them without frozen, e.g. with a local prebuild, and commit the generated files.`);
18
+ }
@@ -5,11 +5,11 @@ const withNanoIconsSymbolLinking_1 = require("./withNanoIconsSymbolLinking");
5
5
  const withNanoIconsDrawableLinking_1 = require("./withNanoIconsDrawableLinking");
6
6
  const withNanoIcons = (config, options) => {
7
7
  if (options?.iconSets?.length) {
8
- config = (0, withNanoIconsFontLinking_1.withNanoIconsFontLinking)(config, options.iconSets);
8
+ config = (0, withNanoIconsFontLinking_1.withNanoIconsFontLinking)(config, options.iconSets, options.frozen);
9
9
  }
10
10
  if (options?.symbolSets?.length) {
11
- config = (0, withNanoIconsSymbolLinking_1.withNanoIconsSymbolLinking)(config, options.symbolSets);
12
- config = (0, withNanoIconsDrawableLinking_1.withNanoIconsDrawableLinking)(config, options.symbolSets);
11
+ config = (0, withNanoIconsSymbolLinking_1.withNanoIconsSymbolLinking)(config, options.symbolSets, options.frozen);
12
+ config = (0, withNanoIconsDrawableLinking_1.withNanoIconsDrawableLinking)(config, options.symbolSets, options.frozen);
13
13
  }
14
14
  return config;
15
15
  };
@@ -12,6 +12,8 @@ export interface IconSetConfig {
12
12
  upm?: number;
13
13
  /** Safe zone inside UPM for glyphs (default upm * 1020 / 1024, i.e. 1020 at the default upm). Must not exceed upm. */
14
14
  safeZone?: number;
15
+ /** Max distance between the font's quadratic curves and the SVG curves, as a fraction of the em (default 1/512). Must be positive. */
16
+ curveTolerance?: number;
15
17
  /** First Unicode codepoint for glyphs (default 0xe900). Hex string or number. */
16
18
  startUnicode?: number | string;
17
19
  /**
@@ -37,10 +39,21 @@ export interface IconSetConfig {
37
39
  export interface SymbolSetConfig {
38
40
  /** Folder of SVG files (relative to project root). */
39
41
  inputDir: string;
40
- /** Set name; defaults to the inputDir basename. */
42
+ /** Set's name; defaults to the inputDir basename. */
41
43
  name?: string;
42
44
  /** Symbol name prefix (default "nano"): home.svg → "nano.home". */
43
45
  prefix?: string;
46
+ /**
47
+ * How each icon fills the symbol: `'content'` (default) scales its drawn shapes to
48
+ * the full height; `'viewBox'` keeps the padding of its SVG viewBox.
49
+ */
50
+ fit?: 'content' | 'viewBox';
51
+ /**
52
+ * Size of every icon in the set (default 1). With `fit: 'viewBox'`, 1 matches the size
53
+ * of SF Symbols. On Android an icon can't grow past its 24 dp box, so values above 1
54
+ * only use the padding around the drawing.
55
+ */
56
+ scale?: number;
44
57
  /** Output dir; defaults to a sibling nanoicons folder next to inputDir. */
45
58
  outputDir?: string;
46
59
  }
@@ -67,6 +80,14 @@ export interface BuiltSymbolSet {
67
80
  export interface NanoIconsPluginOptions {
68
81
  iconSets?: IconSetConfig[];
69
82
  symbolSets?: SymbolSetConfig[];
83
+ /**
84
+ * Fail prebuild when a set's generated files are out of date, instead of regenerating them.
85
+ *
86
+ * - unset: on in CI (`CI` is set and not `false` or `0`) for the sets whose generated files exist; the others are built.
87
+ * - `true`: on for every set, also outside CI.
88
+ * - `false`: off.
89
+ */
90
+ frozen?: boolean;
70
91
  }
71
92
  /**
72
93
  * Result of building one icon set.
@@ -5,4 +5,4 @@ import type { SymbolSetConfig } from './types';
5
5
  * compiles them automatically and they resolve by name — the native-tab-bar
6
6
  * counterpart to the iOS asset catalog, so no gradle changes are needed.
7
7
  */
8
- export declare function withNanoIconsDrawableLinking(config: Parameters<typeof withDangerousMod>[0], symbolSets: SymbolSetConfig[]): ReturnType<typeof withDangerousMod>;
8
+ export declare function withNanoIconsDrawableLinking(config: Parameters<typeof withDangerousMod>[0], symbolSets: SymbolSetConfig[], frozen?: boolean): ReturnType<typeof withDangerousMod>;
@@ -14,11 +14,11 @@ const ANDROID_DRAWABLES_DIR = 'app/src/main/res/drawable';
14
14
  * compiles them automatically and they resolve by name — the native-tab-bar
15
15
  * counterpart to the iOS asset catalog, so no gradle changes are needed.
16
16
  */
17
- function withNanoIconsDrawableLinking(config, symbolSets) {
17
+ function withNanoIconsDrawableLinking(config, symbolSets, frozen) {
18
18
  return (0, config_plugins_1.withDangerousMod)(config, [
19
19
  'android',
20
20
  async (config) => {
21
- const built = await (0, buildSymbols_1.getOrBuildSymbols)(config.modRequest.projectRoot, symbolSets);
21
+ const built = await (0, buildSymbols_1.getOrBuildSymbols)(config.modRequest.projectRoot, symbolSets, frozen);
22
22
  if (!built?.length)
23
23
  return config;
24
24
  const drawableDir = path_1.default.join(config.modRequest.platformProjectRoot, ANDROID_DRAWABLES_DIR);
@@ -8,12 +8,12 @@ import type { IconSetConfig } from './types';
8
8
  * the .ttf via a relative path outside ios/ leaves stale fonts in the .app
9
9
  * bundle when only the file contents change.
10
10
  */
11
- export declare function withNanoIconsIos(config: Parameters<typeof withXcodeProject>[0], iconSets: IconSetConfig[]): ReturnType<typeof withXcodeProject>;
11
+ export declare function withNanoIconsIos(config: Parameters<typeof withXcodeProject>[0], iconSets: IconSetConfig[], frozen?: boolean): ReturnType<typeof withXcodeProject>;
12
12
  /**
13
13
  * Copy TTFs to Android assets/fonts.
14
14
  */
15
- export declare function withNanoIconsAndroid(config: Parameters<typeof withDangerousMod>[0], iconSets: IconSetConfig[]): ReturnType<typeof withDangerousMod>;
15
+ export declare function withNanoIconsAndroid(config: Parameters<typeof withDangerousMod>[0], iconSets: IconSetConfig[], frozen?: boolean): ReturnType<typeof withDangerousMod>;
16
16
  /**
17
17
  * Apply iOS and Android font linking.
18
18
  */
19
- export declare function withNanoIconsFontLinking(config: Parameters<typeof withNanoIconsIos>[0], iconSets: IconSetConfig[]): ReturnType<typeof withNanoIconsAndroid>;
19
+ export declare function withNanoIconsFontLinking(config: Parameters<typeof withNanoIconsIos>[0], iconSets: IconSetConfig[], frozen?: boolean): ReturnType<typeof withNanoIconsAndroid>;
@@ -21,9 +21,9 @@ const IOS_FONTS_GROUP = 'Resources';
21
21
  * the .ttf via a relative path outside ios/ leaves stale fonts in the .app
22
22
  * bundle when only the file contents change.
23
23
  */
24
- function withNanoIconsIos(config, iconSets) {
24
+ function withNanoIconsIos(config, iconSets, frozen) {
25
25
  config = (0, config_plugins_1.withXcodeProject)(config, async (config) => {
26
- const built = await (0, buildFonts_1.getOrBuildFonts)(config.modRequest.projectRoot, iconSets);
26
+ const built = await (0, buildFonts_1.getOrBuildFonts)(config.modRequest.projectRoot, iconSets, frozen);
27
27
  const bundled = built?.filter((b) => b.linking !== 'dynamic') ?? [];
28
28
  if (!bundled.length)
29
29
  return config;
@@ -49,7 +49,7 @@ function withNanoIconsIos(config, iconSets) {
49
49
  return config;
50
50
  });
51
51
  config = (0, config_plugins_1.withInfoPlist)(config, async (config) => {
52
- const built = await (0, buildFonts_1.getOrBuildFonts)(config.modRequest.projectRoot, iconSets);
52
+ const built = await (0, buildFonts_1.getOrBuildFonts)(config.modRequest.projectRoot, iconSets, frozen);
53
53
  const bundled = built?.filter((b) => b.linking !== 'dynamic') ?? [];
54
54
  if (!bundled.length)
55
55
  return config;
@@ -74,11 +74,11 @@ function getUIAppFonts(infoPlist) {
74
74
  /**
75
75
  * Copy TTFs to Android assets/fonts.
76
76
  */
77
- function withNanoIconsAndroid(config, iconSets) {
77
+ function withNanoIconsAndroid(config, iconSets, frozen) {
78
78
  return (0, config_plugins_1.withDangerousMod)(config, [
79
79
  'android',
80
80
  async (config) => {
81
- const built = await (0, buildFonts_1.getOrBuildFonts)(config.modRequest.projectRoot, iconSets);
81
+ const built = await (0, buildFonts_1.getOrBuildFonts)(config.modRequest.projectRoot, iconSets, frozen);
82
82
  const bundled = built?.filter((b) => b.linking !== 'dynamic') ?? [];
83
83
  (0, index_1.syncAndroidFontAssets)(path_1.default.join(config.modRequest.platformProjectRoot, ANDROID_ASSETS_FONTS_DIR), bundled, built?.map((b) => b.fontFamily) ?? []);
84
84
  return config;
@@ -88,8 +88,8 @@ function withNanoIconsAndroid(config, iconSets) {
88
88
  /**
89
89
  * Apply iOS and Android font linking.
90
90
  */
91
- function withNanoIconsFontLinking(config, iconSets) {
92
- config = withNanoIconsIos(config, iconSets);
93
- config = withNanoIconsAndroid(config, iconSets);
91
+ function withNanoIconsFontLinking(config, iconSets, frozen) {
92
+ config = withNanoIconsIos(config, iconSets, frozen);
93
+ config = withNanoIconsAndroid(config, iconSets, frozen);
94
94
  return config;
95
95
  }
@@ -5,4 +5,4 @@ import type { SymbolSetConfig } from './types';
5
5
  * The Expo prebuild template creates and links that catalog, so no pbxproj
6
6
  * changes are needed — actool compiles them and they load by name.
7
7
  */
8
- export declare function withNanoIconsSymbolLinking(config: Parameters<typeof withDangerousMod>[0], symbolSets: SymbolSetConfig[]): ReturnType<typeof withDangerousMod>;
8
+ export declare function withNanoIconsSymbolLinking(config: Parameters<typeof withDangerousMod>[0], symbolSets: SymbolSetConfig[], frozen?: boolean): ReturnType<typeof withDangerousMod>;
@@ -14,11 +14,11 @@ const buildSymbols_1 = require("./buildSymbols");
14
14
  * The Expo prebuild template creates and links that catalog, so no pbxproj
15
15
  * changes are needed — actool compiles them and they load by name.
16
16
  */
17
- function withNanoIconsSymbolLinking(config, symbolSets) {
17
+ function withNanoIconsSymbolLinking(config, symbolSets, frozen) {
18
18
  return (0, config_plugins_1.withDangerousMod)(config, [
19
19
  'ios',
20
20
  async (config) => {
21
- const built = await (0, buildSymbols_1.getOrBuildSymbols)(config.modRequest.projectRoot, symbolSets);
21
+ const built = await (0, buildSymbols_1.getOrBuildSymbols)(config.modRequest.projectRoot, symbolSets, frozen);
22
22
  if (!built?.length)
23
23
  return config;
24
24
  const projectName = config.modRequest.projectName;