create-octane-xplat 0.18.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 (77) hide show
  1. package/README.md +2 -144
  2. package/compatibility.json +97 -19
  3. package/compatibility.ts +141 -72
  4. package/dist/compatibility.js +66 -26
  5. package/dist/index.js +127 -64
  6. package/dist/package-manager.js +62 -0
  7. package/dist/scaffold.js +377 -127
  8. package/index.ts +256 -154
  9. package/library-template/AGENTS.md +6 -4
  10. package/library-template/README.md +22 -18
  11. package/library-template/bunfig +4 -0
  12. package/library-template/package.json +115 -18
  13. package/library-template/patches/@nativescript-community__octane@0.2.5.patch +1018 -0
  14. package/library-template/patches/@nativescript-community__sqlite-bridge@4.1.1.patch +30 -0
  15. package/library-template/patches/@nativescript-community__vite-octane@0.2.1.patch +72 -0
  16. package/library-template/patches/@nativescript__core@9.1.3.patch +1280 -0
  17. package/library-template/patches/@nativescript__doctor@2.0.18.patch +13 -0
  18. package/library-template/patches/@nativescript__vite@8.0.20.patch +2019 -0
  19. package/library-template/patches/@octane-xplat__nativescript-mason-core@1.0.0-beta.7.patch +65 -0
  20. package/library-template/patches/@octanejs__tiptap@0.0.62.patch +12 -0
  21. package/library-template/patches/@sveltejs__acorn-typescript@1.0.13.patch +16 -0
  22. package/library-template/patches/css@3.0.0.patch +52 -0
  23. package/library-template/patches/octane@0.16.3.patch +1479 -0
  24. package/library-template/src/Badge.tsx +7 -6
  25. package/library-template/src/Badge.web.tsx +7 -6
  26. package/library-template/src/Welcome.stories.tsx +12 -0
  27. package/library-template/src/normalizeBadgeLabel.ts +1 -1
  28. package/library-template/src/props.ts +11 -11
  29. package/library-template/tests/normalizeBadgeLabel.test.ts +1 -1
  30. package/library-template/tests/packed-consumer.mjs +140 -123
  31. package/library-template/tsconfig.envs.json +1 -0
  32. package/library-template/tsconfig.json +1 -0
  33. package/library-template/tsconfig.types.json +15 -1
  34. package/library-template/tsrx-typegen.json +1 -1
  35. package/library-template/workshop.config.ts +3 -0
  36. package/package-manager.ts +93 -0
  37. package/package.json +70 -58
  38. package/scaffold.ts +1056 -526
  39. package/template/.agents/skills/xplat/SKILL.md +6 -6
  40. package/template/.agents/skills/xplat/references/components.md +1 -1
  41. package/template/.agents/skills/xplat/references/navigation.md +1 -1
  42. package/template/.agents/skills/xplat/references/styling.md +14 -14
  43. package/template/AGENTS.md +10 -10
  44. package/template/bunfig +4 -0
  45. package/template/gitignore +1 -0
  46. package/template/nativescript.config.ts +13 -16
  47. package/template/package.json +119 -10
  48. package/template/patches/@nativescript-community__octane@0.2.5.patch +1018 -0
  49. package/template/patches/@nativescript-community__sqlite-bridge@4.1.1.patch +30 -0
  50. package/template/patches/@nativescript-community__vite-octane@0.2.1.patch +72 -0
  51. package/template/patches/@nativescript__core@9.1.3.patch +1280 -0
  52. package/template/patches/@nativescript__doctor@2.0.18.patch +13 -0
  53. package/template/patches/@nativescript__vite@8.0.20.patch +2019 -0
  54. package/template/patches/@octane-xplat__nativescript-mason-core@1.0.0-beta.7.patch +65 -0
  55. package/template/patches/@octanejs__tiptap@0.0.62.patch +12 -0
  56. package/template/patches/@sveltejs__acorn-typescript@1.0.13.patch +16 -0
  57. package/template/patches/css@3.0.0.patch +52 -0
  58. package/template/patches/octane@0.16.3.patch +1479 -0
  59. package/template/src/App.tsrx +77 -42
  60. package/template/src/Welcome.stories.tsx +22 -0
  61. package/template/src/app.spec.tsrx +169 -163
  62. package/template/src/app.web.test.tsx +18 -13
  63. package/template/src/failure-reporting.spec.ts +3 -3
  64. package/template/src/main.ts +14 -13
  65. package/template/src/main.tsrx +2 -0
  66. package/template/src/main.web.tsrx +5 -5
  67. package/template/src/native-runtime.spec.ts +13 -11
  68. package/template/src/test-setup.web.ts +9 -8
  69. package/template/src/test.ts +6 -6
  70. package/template/tsconfig.json +17 -1
  71. package/template/vite.config.native.mts +1 -2
  72. package/template/vite.config.ts +29 -23
  73. package/template/vitest.config.mts +18 -18
  74. package/template/vitest.web.config.mts +7 -7
  75. package/template/workshop.config.ts +3 -0
  76. package/library-template/pnpm-workspace.yaml +0 -171
  77. package/template/pnpm-workspace.yaml +0 -192
package/index.ts CHANGED
@@ -2,202 +2,304 @@
2
2
  import { existsSync, readdirSync } from 'node:fs'
3
3
  import { basename, resolve } from 'node:path'
4
4
  import { spawnSync } from 'node:child_process'
5
+ import { parseArgs } from 'node:util'
5
6
  import {
6
- composeLibrary,
7
- composeTargets,
8
- defaultTargets,
9
- resolveTargets,
10
- selectableTargets,
11
- targets,
7
+ composeLibrary,
8
+ composeTargets,
9
+ defaultTargets,
10
+ resolveTargets,
11
+ selectableTargets,
12
+ targets,
12
13
  } from './scaffold.ts'
13
14
 
14
- const argv = process.argv.slice(2)
15
- const noInstall = argv.includes('--no-install')
16
- const templateIndex = argv.findIndex((arg) => arg === '--template' || arg.startsWith('--template='))
17
- const templateValueIndex =
18
- templateIndex !== -1 && argv[templateIndex] === '--template' ? templateIndex + 1 : -1
19
-
20
- const templateArg =
21
- templateIndex === -1
22
- ? 'app'
23
- : templateValueIndex !== -1
24
- ? argv[templateValueIndex]
25
- : argv[templateIndex].slice('--template='.length)
26
-
27
- const nameIndex = argv.findIndex((arg) => arg === '--name' || arg.startsWith('--name='))
28
- const nameValueIndex = nameIndex !== -1 && argv[nameIndex] === '--name' ? nameIndex + 1 : -1
29
- const nameArg =
30
- nameIndex === -1
31
- ? undefined
32
- : nameValueIndex !== -1
33
- ? argv[nameValueIndex]
34
- : argv[nameIndex].slice('--name='.length)
15
+ import { compatibility } from './compatibility.ts'
16
+ import {
17
+ decidePackageManager,
18
+ installedManagers,
19
+ managerVersion,
20
+ type PackageManager,
21
+ } from './package-manager.ts'
35
22
 
36
- if (templateIndex !== -1 && (!templateArg || templateArg.startsWith('-'))) {
37
- console.error('✗ --template needs a value: app or library')
38
- process.exit(1)
23
+ const fail = (message: string): never => {
24
+ console.error(`✗ ${message}`)
25
+ process.exit(1)
39
26
  }
40
27
 
41
- if (!['app', 'library'].includes(templateArg)) {
42
- console.error(`✗ unknown template "${templateArg}" — expected app or library`)
43
- process.exit(1)
28
+ function parseCli() {
29
+ try {
30
+ return parseArgs({
31
+ args: process.argv.slice(2),
32
+ allowPositionals: true,
33
+ options: {
34
+ template: { type: 'string', default: 'app' },
35
+ name: { type: 'string' },
36
+ targets: { type: 'string' },
37
+ 'package-manager': { type: 'string' },
38
+ 'no-install': { type: 'boolean', default: false },
39
+ },
40
+ })
41
+ } catch (error) {
42
+ return fail(error.message)
43
+ }
44
44
  }
45
45
 
46
- if (nameIndex !== -1 && (!nameArg || nameArg.startsWith('-'))) {
47
- console.error('✗ --name needs an npm package name')
48
- process.exit(1)
49
- }
46
+ const { values, positionals } = parseCli()
50
47
 
51
- const targetsIndex = argv.findIndex((arg) => arg === '--targets' || arg.startsWith('--targets='))
52
- const targetsValueIndex =
53
- targetsIndex !== -1 && argv[targetsIndex] === '--targets' ? targetsIndex + 1 : -1
48
+ const oneOf = <T extends string>(flag: string, value: string | undefined, choices: readonly T[]) =>
49
+ value === undefined || (choices as readonly string[]).includes(value)
50
+ ? (value as T | undefined)
51
+ : fail(`--${flag} must be ${choices.join(' or ')}`)
54
52
 
55
- const targetsArg =
56
- targetsIndex === -1
57
- ? undefined
58
- : targetsValueIndex !== -1
59
- ? argv[targetsValueIndex]
60
- : argv[targetsIndex].slice('--targets='.length)
53
+ const templateArg = oneOf('template', values.template, ['app', 'library'] as const)!
54
+ const managerFlag = oneOf('package-manager', values['package-manager'], ['bun', 'pnpm'] as const)
55
+ const noInstall = values['no-install']
61
56
 
62
- if (targetsIndex !== -1 && (targetsArg === undefined || targetsArg.startsWith('-'))) {
63
- console.error(`✗ --targets needs a comma list: ${selectableTargets.join(', ')}`)
64
- process.exit(1)
57
+ if (values.name === '') {
58
+ fail('--name needs an npm package name')
65
59
  }
66
60
 
67
- const optionValues = new Set(
68
- [targetsValueIndex, templateValueIndex, nameValueIndex].filter((index) => index !== -1),
69
- )
61
+ if (positionals.length > 1) {
62
+ fail(`expected one project directory, got ${positionals.join(' ')}`)
63
+ }
70
64
 
71
- const positional = argv.filter((arg, i) => !arg.startsWith('-') && !optionValues.has(i))
72
65
  const defaultDir = templateArg === 'library' ? 'octane-xplat-library' : 'octane-xplat-app'
73
- const dir = resolve(positional[0] ?? defaultDir)
74
-
75
- if (templateArg === 'library' && targetsIndex !== -1) {
76
- console.error(
77
- '✗ --targets applies to the app template; libraries start with web and native builds',
78
- )
66
+ const dir = resolve(positionals[0] ?? defaultDir)
79
67
 
80
- process.exit(1)
68
+ if (templateArg === 'library' && values.targets !== undefined) {
69
+ fail('--targets applies to the app template; libraries start with web and native builds')
81
70
  }
82
71
 
83
- if (templateArg === 'app' && nameIndex !== -1) {
84
- console.error('✗ --name applies only to the library template')
85
- process.exit(1)
72
+ if (templateArg === 'app' && values.name !== undefined) {
73
+ fail('--name applies only to the library template')
86
74
  }
87
75
 
88
76
  if (existsSync(dir) && readdirSync(dir).length > 0) {
89
- console.error(`✗ ${dir} exists and is not empty`)
90
- process.exit(1)
77
+ fail(`${dir} exists and is not empty`)
91
78
  }
92
79
 
93
80
  const parseTargets = (value) => {
94
- const ids = value
95
- .split(',')
96
- .map((s) => s.trim())
97
- .filter(Boolean)
81
+ const ids = value
82
+ .split(',')
83
+ .map((s) => s.trim())
84
+ .filter(Boolean)
98
85
 
99
- if (ids.length === 0) {
100
- throw new Error(`--targets needs a comma list: ${selectableTargets.join(', ')}`)
101
- }
86
+ if (ids.length === 0) {
87
+ throw new Error(`--targets needs a comma list: ${selectableTargets.join(', ')}`)
88
+ }
102
89
 
103
- for (const id of ids) {
104
- if (!selectableTargets.includes(id)) {
105
- throw new Error(
106
- `unknown target "${id}" — expected a comma list of: ${selectableTargets.join(', ')}`,
107
- )
108
- }
109
- }
90
+ for (const id of ids) {
91
+ if (!selectableTargets.includes(id)) {
92
+ throw new Error(
93
+ `unknown target "${id}" — expected a comma list of: ${selectableTargets.join(', ')}`,
94
+ )
95
+ }
96
+ }
110
97
 
111
- return resolveTargets(ids)
98
+ return resolveTargets(ids)
99
+ }
100
+
101
+ const decision = decidePackageManager({
102
+ flag: managerFlag,
103
+ userAgent: process.env.npm_config_user_agent,
104
+ installed: installedManagers(),
105
+ interactive: Boolean(process.stdout.isTTY),
106
+ })
107
+
108
+ let packageManager: PackageManager = decision.kind === 'use' ? decision.manager : 'bun'
109
+ let managerNotice: string | undefined
110
+
111
+ if (decision.kind === 'missing') {
112
+ managerNotice = `! Neither Bun nor pnpm was found. Installing dependencies, applying framework
113
+ patches (xplat patches apply) and running the app all need one of them.
114
+ Install Bun ${compatibility.tools.bun}+ (https://bun.sh) or pnpm ${compatibility.tools.pnpm}+ (https://pnpm.io), then:
115
+ cd ${dir} && bun install
116
+ To use pnpm instead, recreate the project with --package-manager pnpm.`
117
+ } else if (decision.kind === 'use' && !decision.installed.includes(decision.manager)) {
118
+ managerNotice = `! ${managerLabel(decision.manager)} was selected but is not installed — the
119
+ ${decision.manager} project was scaffolded without installing dependencies.
120
+ Install ${managerLabel(decision.manager)} ${compatibility.tools[decision.manager]}+, then run the
121
+ package manager's install command inside ${dir}.`
122
+ }
123
+
124
+ /** The manager `select`, joining the caller's clack session. */
125
+ async function promptForManager(p: typeof import('@clack/prompts')) {
126
+ const picked = await p.select<PackageManager>({
127
+ message: 'Package manager',
128
+ options: [
129
+ { value: 'bun', label: 'Bun' },
130
+ { value: 'pnpm', label: 'pnpm' },
131
+ ],
132
+ initialValue: 'bun',
133
+ })
134
+
135
+ if (p.isCancel(picked)) {
136
+ p.cancel('Cancelled')
137
+ process.exit(0)
138
+ }
139
+
140
+ packageManager = picked
112
141
  }
113
142
 
114
143
  let ids: string[] = []
144
+
115
145
  if (templateArg === 'library') {
116
- const packageName = nameArg ?? basename(dir)
117
- try {
118
- composeLibrary(dir, packageName)
119
- } catch (error) {
120
- console.error(`✗ ${error.message}`)
121
- process.exit(1)
122
- }
123
-
124
- console.log(`\n✓ scaffolded ${dir} (library: ${packageName}; web + iOS + Android)`)
146
+ const packageName = values.name ?? basename(dir)
147
+
148
+ if (decision.kind === 'prompt') {
149
+ const p = await import('@clack/prompts')
150
+
151
+ p.intro('create-octane-xplat')
152
+ await promptForManager(p)
153
+ }
154
+
155
+ try {
156
+ composeLibrary(dir, packageName, { packageManager })
157
+ } catch (error) {
158
+ console.error(`✗ ${error.message}`)
159
+ process.exit(1)
160
+ }
161
+
162
+ console.log(
163
+ `\n✓ scaffolded ${dir} (library: ${packageName}; web + iOS + Android; ${packageManager})`,
164
+ )
125
165
  } else {
126
- if (targetsArg !== undefined) {
127
- try {
128
- ids = parseTargets(targetsArg)
129
- } catch (error) {
130
- console.error(`✗ ${error.message}`)
131
- process.exit(1)
132
- }
133
- } else if (process.stdout.isTTY) {
134
- // Non-interactive creation does not need the prompt module.
135
- const p = await import('@clack/prompts')
136
- p.intro('create-octane-xplat')
137
- const picked = await p.multiselect({
138
- message: 'Target platforms',
139
- options: selectableTargets.map((id) => ({
140
- value: id,
141
- label: targets[id].label,
142
- hint: targets[id].note,
143
- })),
144
- initialValues: [...defaultTargets],
145
- required: true,
146
- })
147
-
148
- if (p.isCancel(picked)) {
149
- p.cancel('Cancelled')
150
- process.exit(0)
151
- }
152
-
153
- ids = picked
154
- } else {
155
- ids = defaultTargets
156
- }
157
-
158
- composeTargets(ids, dir)
159
- console.log(
160
- `\n✓ scaffolded ${dir} (${[...new Set(resolveTargets(ids))].filter((id) => !targets[id].hidden).join(', ')})`,
161
- )
166
+ if (values.targets !== undefined) {
167
+ try {
168
+ ids = parseTargets(values.targets)
169
+ } catch (error) {
170
+ console.error(`✗ ${error.message}`)
171
+ process.exit(1)
172
+ }
173
+ } else if (process.stdout.isTTY) {
174
+ // Non-interactive creation does not need the prompt module.
175
+ const p = await import('@clack/prompts')
176
+
177
+ p.intro('create-octane-xplat')
178
+
179
+ const picked = await p.multiselect({
180
+ message: 'Target platforms',
181
+ options: selectableTargets.map((id) => ({
182
+ value: id,
183
+ label: targets[id].label,
184
+ hint: targets[id].note,
185
+ })),
186
+ initialValues: [...defaultTargets],
187
+ required: true,
188
+ })
189
+
190
+ if (p.isCancel(picked)) {
191
+ p.cancel('Cancelled')
192
+ process.exit(0)
193
+ }
194
+
195
+ ids = picked
196
+ if (decision.kind === 'prompt') {
197
+ await promptForManager(p)
198
+ }
199
+ } else {
200
+ ids = defaultTargets
201
+ }
202
+
203
+ // Targets from the flag skip the multiselect; the manager choice still asks.
204
+ if (decision.kind === 'prompt' && values.targets !== undefined) {
205
+ const p = await import('@clack/prompts')
206
+
207
+ p.intro('create-octane-xplat')
208
+ await promptForManager(p)
209
+ }
210
+
211
+ composeTargets(ids, dir, { packageManager })
212
+ console.log(
213
+ `\n✓ scaffolded ${dir} (${[...new Set(resolveTargets(ids))].filter((id) => !targets[id].hidden).join(', ')}; ${packageManager})`,
214
+ )
215
+ }
216
+
217
+ if (managerNotice) {
218
+ console.log(`\n${managerNotice}`)
219
+ if (decision.kind === 'use') {
220
+ printNextSteps(dir, ids, templateArg, packageManager)
221
+ }
222
+
223
+ process.exit(0)
162
224
  }
163
225
 
164
226
  if (noInstall) {
165
- console.log('\nSkipped install (--no-install). To run manually:')
166
- printNextSteps(dir, ids, templateArg)
167
- process.exit(0)
227
+ console.log('\nSkipped install (--no-install). To run manually:')
228
+ printNextSteps(dir, ids, templateArg, packageManager)
229
+ process.exit(0)
168
230
  }
169
231
 
170
- const install = spawnSync('pnpm', ['install'], {
171
- cwd: dir,
172
- stdio: 'inherit',
173
- shell: process.platform === 'win32',
232
+ const managerFloor = compatibility.tools[packageManager]
233
+ const managerInstalled = managerVersion(packageManager)
234
+
235
+ if (managerInstalled !== undefined && versionBelow(managerInstalled, managerFloor)) {
236
+ console.log(
237
+ `! ${managerLabel(packageManager)} ${managerInstalled} is below the supported ${managerFloor}+ — install may fail`,
238
+ )
239
+ }
240
+
241
+ const install = spawnSync(packageManager, ['install'], {
242
+ cwd: dir,
243
+ stdio: 'inherit',
244
+ shell: process.platform === 'win32',
174
245
  })
175
246
 
176
247
  if (install.status !== 0) {
177
- console.log(`\nInstall didn't finish (pnpm missing?). To run manually:`)
178
- printNextSteps(dir, ids, templateArg)
179
- process.exit(install.status ?? 1)
248
+ console.log(
249
+ `\nInstall didn't finish (${managerLabel(packageManager)} missing?). To run manually:`,
250
+ )
251
+
252
+ printNextSteps(dir, ids, templateArg, packageManager)
253
+ process.exit(install.status ?? 1)
180
254
  }
181
255
 
182
256
  if (templateArg === 'app' && ids.includes('web')) {
183
- console.log('\n✓ installed — starting dev server (Ctrl+C to stop)\n')
184
- spawnSync('pnpm', ['dev'], { cwd: dir, stdio: 'inherit', shell: process.platform === 'win32' })
257
+ console.log('\n✓ installed — starting dev server (Ctrl+C to stop)\n')
258
+ spawnSync(packageManager, ['run', 'dev'], {
259
+ cwd: dir,
260
+ stdio: 'inherit',
261
+ shell: process.platform === 'win32',
262
+ })
185
263
  } else {
186
- console.log('\n✓ installed. Next steps:')
187
- printNextSteps(dir, ids, templateArg)
188
- }
189
-
190
- function printNextSteps(dir, ids, template) {
191
- console.log(` cd ${dir}\n pnpm install`)
192
- if (template === 'library') {
193
- console.log(' pnpm typecheck\n pnpm lint\n pnpm typegen\n pnpm test\n pnpm test:packed')
194
- return
195
- }
196
-
197
- if (ids.includes('web')) {
198
- console.log(' pnpm dev')
199
- } else {
200
- // No web entry — `xplat dev` discovers whichever native targets exist.
201
- console.log(' pnpm xplat dev')
202
- }
264
+ console.log('\n✓ installed. Next steps:')
265
+ printNextSteps(dir, ids, templateArg, packageManager)
266
+ }
267
+
268
+ function managerLabel(manager: PackageManager) {
269
+ return manager === 'bun' ? 'Bun' : 'pnpm'
270
+ }
271
+
272
+ function versionBelow(version: string, floor: string) {
273
+ const parts = (value: string) => value.split('.').map((n) => Number.parseInt(n, 10) || 0)
274
+ const got = parts(version)
275
+ const min = parts(floor)
276
+
277
+ for (let i = 0; i < Math.max(got.length, min.length); i++) {
278
+ const a = got[i] ?? 0
279
+ const b = min[i] ?? 0
280
+
281
+ if (a !== b) {
282
+ return a < b
283
+ }
284
+ }
285
+
286
+ return false
287
+ }
288
+
289
+ function printNextSteps(dir, ids, template, pm: PackageManager) {
290
+ console.log(` cd ${dir}\n ${pm} install`)
291
+ if (template === 'library') {
292
+ console.log(
293
+ ` ${pm} run typecheck\n ${pm} run lint\n ${pm} run typegen\n ${pm} run test\n ${pm} run test:packed`,
294
+ )
295
+
296
+ return
297
+ }
298
+
299
+ if (ids.includes('web')) {
300
+ console.log(` ${pm} run dev`)
301
+ } else {
302
+ // No web entry — `xplat dev` discovers whichever native targets exist.
303
+ console.log(` ${pm} run xplat dev`)
304
+ }
203
305
  }
@@ -1,7 +1,7 @@
1
1
  # Library package notes
2
2
 
3
- - Use pnpm for package management.
4
- - Keep build dependencies in `catalog:xplat`. Use `pnpm dlx @octane-xplat/cli@latest upgrade --check` to preview a workspace-wide version/patch update and `pnpm dlx @octane-xplat/cli@latest upgrade` to apply it. Keep consumer peer ranges under the library's control; run `pnpm xplat doctor` and the package checks afterward.
3
+ - Use the package manager pinned in `package.json` `packageManager`.
4
+ - Keep build dependencies in `catalog:xplat`. Use `bunx @octane-xplat/cli@latest upgrade --check` to preview a workspace-wide version/patch update and `bunx @octane-xplat/cli@latest upgrade` to apply it. Keep consumer peer ranges under the library's control; run `bun run xplat doctor` and the package checks afterward.
5
5
  - Keep the public API in `src/index.ts` and `src/index.web.ts`; both barrels
6
6
  must export the same names and types.
7
7
  - Put shared prop contracts in `src/props.ts` and document public exports.
@@ -11,8 +11,10 @@
11
11
  start with `/** @jsxImportSource @octane-xplat/jsx/dom */`.
12
12
  - Keep DOM globals out of native files. Use the shared `@octane-xplat/ui`
13
13
  elements when behavior can be shared.
14
+ - Give every exported function and value an explicit type; `bun run typegen`
15
+ writes each file's declarations on its own and reports missing ones.
14
16
  - Declare every imported package. Runtime plugins belong in `dependencies`;
15
17
  Octane and renderer packages belong in `peerDependencies` when consumers
16
18
  supply the runtime.
17
- - Before publishing, run `pnpm typecheck`, `pnpm lint`, `pnpm test`,
18
- `pnpm typegen`, and `pnpm test:packed`.
19
+ - Before publishing, run `bun run typecheck`, `bun run lint`, `bun run test`,
20
+ `bun run typegen`, and `bun run test:packed`.
@@ -9,7 +9,7 @@ and check the artifact that will be published.
9
9
  Install this package in an Octane Xplat app:
10
10
 
11
11
  ```sh
12
- pnpm add octane-xplat-library
12
+ bun add octane-xplat-library
13
13
  ```
14
14
 
15
15
  Render the example component from your app:
@@ -18,7 +18,7 @@ Render the example component from your app:
18
18
  import { Badge } from 'octane-xplat-library'
19
19
 
20
20
  export function Welcome() {
21
- return <Badge label="Ready" />
21
+ return <Badge label="Ready" />
22
22
  }
23
23
  ```
24
24
 
@@ -27,12 +27,12 @@ export function Welcome() {
27
27
  Run these commands from the package directory:
28
28
 
29
29
  ```sh
30
- pnpm typecheck
31
- pnpm lint
32
- pnpm lint:fix
33
- pnpm test
34
- pnpm typegen
35
- pnpm test:packed
30
+ bun run typecheck
31
+ bun run lint
32
+ bun run lint:fix
33
+ bun run test
34
+ bun run typegen
35
+ bun run test:packed
36
36
  ```
37
37
 
38
38
  Linting uses the CLI's bundled framework defaults. Apply safe lint fixes with
@@ -40,26 +40,27 @@ Linting uses the CLI's bundled framework defaults. Apply safe lint fixes with
40
40
  without changing files:
41
41
 
42
42
  ```sh
43
- pnpm format
44
- pnpm exec xplat fmt --check
43
+ bun run format
44
+ bun run xplat fmt --check
45
45
  ```
46
46
 
47
47
  The package publishes authored source for the app's bundler to compile.
48
- `pnpm typegen` generates `.d.ts` files so consumers' type checkers use
49
- declarations. `pnpm test:packed` packs the package, places that artifact into
48
+ `bun run typegen` generates `.d.ts` files so consumers' type checkers use
49
+ declarations. `bun run test:packed` packs the package, places that artifact into
50
50
  small web and native TypeScript consumers, and checks both export conditions.
51
51
 
52
- The package sets `nodeLinker: hoisted` in `pnpm-workspace.yaml` because the
53
- NativeScript bundler expects a flat dependency tree.
52
+ The starter configures a hoisted dependency tree
53
+ (`linker = "hoisted"` / `nodeLinker: hoisted`) because the NativeScript
54
+ bundler expects a flat dependency tree.
54
55
 
55
56
  Its `catalog:xplat` build dependencies and patches follow one framework
56
57
  compatibility set. Update that set together; consumer `peerDependencies`
57
58
  ranges are preserved for you to maintain:
58
59
 
59
60
  ```sh
60
- pnpm dlx @octane-xplat/cli@latest upgrade --check
61
- pnpm dlx @octane-xplat/cli@latest upgrade
62
- pnpm xplat doctor
61
+ bunx @octane-xplat/cli@latest upgrade --check
62
+ bunx @octane-xplat/cli@latest upgrade
63
+ bun run xplat doctor
63
64
  ```
64
65
 
65
66
  ## Platform files
@@ -79,6 +80,9 @@ metadata to this package.
79
80
 
80
81
  Before publishing, replace the generated package name and repository metadata
81
82
  in `package.json`, fill in the year and copyright holder in `LICENSE`, and
82
- confirm that every runtime import is declared. `pnpm test:packed` checks the
83
+ confirm that every runtime import is declared. `bun run test:packed` checks the
83
84
  package tarball's web and native type exports; it does not build or launch a
84
85
  consuming app on a device.
86
+
87
+ Follow [Publish a reusable component library](https://octane-xplat.goddardai.org/component-libraries)
88
+ for a complete app-to-tarball workflow, runtime ownership, assets and publication.
@@ -0,0 +1,4 @@
1
+ [install]
2
+ # NativeScript resolves plugins from the app’s flat dependency tree.
3
+ linker = "hoisted"
4
+ exact = true