create-octane-xplat 0.19.0 → 0.20.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.
Files changed (63) hide show
  1. package/README.md +2 -147
  2. package/compatibility.json +74 -61
  3. package/compatibility.ts +134 -79
  4. package/dist/compatibility.js +45 -13
  5. package/dist/index.js +127 -64
  6. package/dist/package-manager.js +62 -0
  7. package/dist/scaffold.js +362 -57
  8. package/index.ts +256 -156
  9. package/library-template/AGENTS.md +1 -1
  10. package/library-template/README.md +4 -3
  11. package/library-template/bunfig +4 -0
  12. package/library-template/package.json +73 -70
  13. package/library-template/patches/@nativescript-community__octane@0.2.5.patch +161 -24
  14. package/library-template/patches/@nativescript__core@9.1.3.patch +98 -0
  15. package/library-template/patches/@nativescript__vite@8.0.20.patch +532 -17
  16. package/library-template/patches/@octane-xplat__nativescript-mason-core@1.0.0-beta.7.patch +65 -0
  17. package/library-template/patches/octane@0.16.3.patch +56 -2
  18. package/library-template/src/Badge.tsx +5 -5
  19. package/library-template/src/Badge.web.tsx +5 -5
  20. package/library-template/src/Welcome.stories.tsx +12 -0
  21. package/library-template/src/normalizeBadgeLabel.ts +1 -1
  22. package/library-template/src/props.ts +11 -11
  23. package/library-template/tests/normalizeBadgeLabel.test.ts +1 -1
  24. package/library-template/tests/packed-consumer.mjs +140 -123
  25. package/library-template/tsconfig.envs.json +1 -0
  26. package/library-template/tsconfig.json +1 -0
  27. package/library-template/tsconfig.types.json +15 -1
  28. package/library-template/tsrx-typegen.json +1 -1
  29. package/library-template/workshop.config.ts +3 -0
  30. package/package-manager.ts +93 -0
  31. package/package.json +10 -5
  32. package/scaffold.ts +1061 -449
  33. package/template/.agents/skills/xplat/SKILL.md +1 -1
  34. package/template/.agents/skills/xplat/references/styling.md +10 -10
  35. package/template/AGENTS.md +2 -2
  36. package/template/bunfig +4 -0
  37. package/template/nativescript.config.ts +13 -13
  38. package/template/package.json +69 -64
  39. package/template/patches/@nativescript-community__octane@0.2.5.patch +161 -24
  40. package/template/patches/@nativescript__core@9.1.3.patch +98 -0
  41. package/template/patches/@nativescript__vite@8.0.20.patch +532 -17
  42. package/template/patches/@octane-xplat__nativescript-mason-core@1.0.0-beta.7.patch +65 -0
  43. package/template/patches/octane@0.16.3.patch +56 -2
  44. package/template/src/App.tsrx +66 -64
  45. package/template/src/Welcome.stories.tsx +22 -0
  46. package/template/src/app.spec.tsrx +168 -158
  47. package/template/src/app.web.test.tsx +18 -13
  48. package/template/src/failure-reporting.spec.ts +3 -3
  49. package/template/src/main.ts +14 -13
  50. package/template/src/main.tsrx +2 -0
  51. package/template/src/native-runtime.spec.ts +13 -11
  52. package/template/src/test-setup.web.ts +9 -8
  53. package/template/src/test.ts +6 -6
  54. package/template/tsconfig.json +17 -1
  55. package/template/vite.config.native.mts +1 -2
  56. package/template/vite.config.ts +29 -23
  57. package/template/vitest.config.mts +17 -17
  58. package/template/vitest.web.config.mts +7 -7
  59. package/template/workshop.config.ts +3 -0
  60. package/library-template/patches/@tsrx__typescript-plugin@0.4.11.patch +0 -11
  61. package/template/patches/@tsrx__typescript-plugin@0.4.11.patch +0 -11
  62. /package/library-template/patches/{@octanejs__tiptap@0.0.61.patch → @octanejs__tiptap@0.0.62.patch} +0 -0
  63. /package/template/patches/{@octanejs__tiptap@0.0.61.patch → @octanejs__tiptap@0.0.62.patch} +0 -0
@@ -1180,3 +1180,101 @@ index e75c7c8010e23917a7138c7351243aab0bad1f49..7cf9244c0290a76b186c15f13cc94ca7
1180
1180
  function isRule(node) {
1181
1181
  return node.type === 'rule';
1182
1182
  }
1183
+ diff --git a/ui/styling/font.ios.js b/ui/styling/font.ios.js
1184
+ index 31fd457fd1929618042db5c35ca687e23b0c05d7..8938d4224a86a996e21f7217d8785547214d5cbd 100644
1185
+ --- a/ui/styling/font.ios.js
1186
+ +++ b/ui/styling/font.ios.js
1187
+ @@ -4,9 +4,9 @@ import { File, Folder, knownFolders, path } from '../../file-system';
1188
+ export { FontStyle, FontWeight, FontVariationSettings, parseFont } from './font-common';
1189
+ const uiFontCache = new Map();
1190
+ function computeFontCacheKey(fontDescriptor) {
1191
+ - const { fontFamily, fontSize, fontWeight, fontVariationSettings, isBold, isItalic } = fontDescriptor;
1192
+ + const { fontFamily, fontSize, fontWeight, cssFontWeight, fontVariationSettings, isBold, isItalic } = fontDescriptor;
1193
+ const sep = ':';
1194
+ - return [fontFamily.join(sep), fontSize, fontWeight, String(FontVariationSettings.toString(fontVariationSettings)).replace(/'/g, '').replace(/[\s,]/g, '_'), isBold, isItalic].join(sep);
1195
+ + return [fontFamily.join(sep), fontSize, fontWeight, cssFontWeight, String(FontVariationSettings.toString(fontVariationSettings)).replace(/'/g, '').replace(/[\s,]/g, '_'), isBold, isItalic].join(sep);
1196
+ }
1197
+ function getUIFontCached(fontDescriptor) {
1198
+ const cacheKey = computeFontCacheKey(fontDescriptor);
1199
+ @@ -17,25 +17,38 @@ function getUIFontCached(fontDescriptor) {
1200
+ return uiFontCache.get(cacheKey);
1201
+ }
1202
+ let uiFont = NativeScriptUtils.createUIFont(fontDescriptor);
1203
+ - if (fontDescriptor.fontVariationSettings?.length) {
1204
+ - let font = CGFontCreateWithFontName(uiFont.fontName);
1205
+ - const variationAxes = CGFontCopyVariationAxes(font);
1206
+ - // This can be null if font doesn't support axes
1207
+ - if (variationAxes?.count) {
1208
+ - const variationSettings = NSMutableDictionary.new();
1209
+ - const variationAxesCount = variationAxes.count;
1210
+ - const variationAxesNames = [];
1211
+ - for (let i = 0, length = variationAxes.count; i < length; i++) {
1212
+ - variationAxesNames.push(String(variationAxes[i].objectForKey('kCGFontVariationAxisName')));
1213
+ - }
1214
+ - for (const variationSetting of fontDescriptor.fontVariationSettings) {
1215
+ - const axisName = fuzzySearch(variationSetting.axis, variationAxesNames);
1216
+ - if (axisName?.length) {
1217
+ - variationSettings.setValueForKey(variationSetting.value, axisName[0]);
1218
+ - }
1219
+ + // Resolve axes after the native CSS cascade has produced this Font. Keep
1220
+ + // derived coordinates out of the authored/inherited variation settings.
1221
+ + const axes = CTFontCopyVariationAxes(uiFont);
1222
+ + if (axes?.count) {
1223
+ + const variations = NSMutableDictionary.new();
1224
+ + const current = CTFontCopyVariation(uiFont);
1225
+ + if (current) {
1226
+ + variations.addEntriesFromDictionary(current);
1227
+ + }
1228
+ + let changed = false;
1229
+ + const settings = fontDescriptor.fontVariationSettings || [];
1230
+ + for (let index = 0; index < axes.count; index++) {
1231
+ + const axis = axes.objectAtIndex(index);
1232
+ + const identifier = Number(axis.objectForKey(kCTFontVariationAxisIdentifierKey));
1233
+ + const tag = String.fromCharCode(identifier >>> 24, (identifier >>> 16) & 255, (identifier >>> 8) & 255, identifier & 255);
1234
+ + const name = String(axis.objectForKey(kCTFontVariationAxisNameKey));
1235
+ + const explicit = settings.find((setting) => setting.axis.toLowerCase() === tag.toLowerCase())
1236
+ + || settings.find((setting) => fuzzySearch(setting.axis, [name]).length > 0);
1237
+ + const value = explicit ? explicit.value : tag === 'wght' ? fontDescriptor.cssFontWeight : undefined;
1238
+ + if (value === undefined) {
1239
+ + continue;
1240
+ }
1241
+ - font = CGFontCreateCopyWithVariations(font, variationSettings);
1242
+ - uiFont = CTFontCreateWithGraphicsFont(font, fontDescriptor.fontSize, null, null);
1243
+ + const minimum = Number(axis.objectForKey(kCTFontVariationAxisMinimumValueKey));
1244
+ + const maximum = Number(axis.objectForKey(kCTFontVariationAxisMaximumValueKey));
1245
+ + variations.setObjectForKey(Math.max(minimum, Math.min(maximum, value)), identifier);
1246
+ + changed = true;
1247
+ + }
1248
+ + if (changed) {
1249
+ + // Copy the resolved font so family, italic transforms and other
1250
+ + // selected coordinates survive the weight adjustment.
1251
+ + const descriptor = UIFontDescriptor.fontDescriptorWithFontAttributes({ [kCTFontVariationAttribute]: variations });
1252
+ + uiFont = CTFontCreateCopyWithAttributes(uiFont, fontDescriptor.fontSize, null, descriptor);
1253
+ }
1254
+ }
1255
+ uiFontCache.set(cacheKey, uiFont);
1256
+ @@ -72,6 +85,7 @@ export class Font extends FontBase {
1257
+ // Apply a11y scale and calculate proper font size (avoid applying multiplier to native point size as it's messing calculations)
1258
+ fontSize: this.fontSize ? this.fontSize * this.fontScale : defaultFont.pointSize,
1259
+ fontWeight: getNativeFontWeight(this.fontWeight),
1260
+ + cssFontWeight: getNumericFontWeight(this.fontWeight),
1261
+ fontVariationSettings: this.fontVariationSettings,
1262
+ isBold: this.isBold,
1263
+ isItalic: this.isItalic,
1264
+ @@ -82,6 +96,16 @@ export class Font extends FontBase {
1265
+ }
1266
+ }
1267
+ Font.default = new Font(undefined, undefined);
1268
+ +function getNumericFontWeight(weight) {
1269
+ + if (weight == null || weight === FontWeight.NORMAL) {
1270
+ + return 400;
1271
+ + }
1272
+ + if (weight === FontWeight.BOLD) {
1273
+ + return 700;
1274
+ + }
1275
+ + const numeric = Number(weight);
1276
+ + return Number.isFinite(numeric) ? numeric : 400;
1277
+ +}
1278
+ function getNativeFontWeight(fontWeight) {
1279
+ const value = typeof fontWeight === 'number' ? fontWeight + '' : fontWeight;
1280
+ switch (value) {