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.
- package/README.md +2 -147
- package/compatibility.json +74 -61
- package/compatibility.ts +134 -79
- package/dist/compatibility.js +45 -13
- package/dist/index.js +127 -64
- package/dist/package-manager.js +62 -0
- package/dist/scaffold.js +362 -57
- package/index.ts +256 -156
- package/library-template/AGENTS.md +1 -1
- package/library-template/README.md +4 -3
- package/library-template/bunfig +4 -0
- package/library-template/package.json +73 -70
- package/library-template/patches/@nativescript-community__octane@0.2.5.patch +161 -24
- package/library-template/patches/@nativescript__core@9.1.3.patch +98 -0
- package/library-template/patches/@nativescript__vite@8.0.20.patch +532 -17
- package/library-template/patches/@octane-xplat__nativescript-mason-core@1.0.0-beta.7.patch +65 -0
- package/library-template/patches/octane@0.16.3.patch +56 -2
- package/library-template/src/Badge.tsx +5 -5
- package/library-template/src/Badge.web.tsx +5 -5
- package/library-template/src/Welcome.stories.tsx +12 -0
- package/library-template/src/normalizeBadgeLabel.ts +1 -1
- package/library-template/src/props.ts +11 -11
- package/library-template/tests/normalizeBadgeLabel.test.ts +1 -1
- package/library-template/tests/packed-consumer.mjs +140 -123
- package/library-template/tsconfig.envs.json +1 -0
- package/library-template/tsconfig.json +1 -0
- package/library-template/tsconfig.types.json +15 -1
- package/library-template/tsrx-typegen.json +1 -1
- package/library-template/workshop.config.ts +3 -0
- package/package-manager.ts +93 -0
- package/package.json +10 -5
- package/scaffold.ts +1061 -449
- package/template/.agents/skills/xplat/SKILL.md +1 -1
- package/template/.agents/skills/xplat/references/styling.md +10 -10
- package/template/AGENTS.md +2 -2
- package/template/bunfig +4 -0
- package/template/nativescript.config.ts +13 -13
- package/template/package.json +69 -64
- package/template/patches/@nativescript-community__octane@0.2.5.patch +161 -24
- package/template/patches/@nativescript__core@9.1.3.patch +98 -0
- package/template/patches/@nativescript__vite@8.0.20.patch +532 -17
- package/template/patches/@octane-xplat__nativescript-mason-core@1.0.0-beta.7.patch +65 -0
- package/template/patches/octane@0.16.3.patch +56 -2
- package/template/src/App.tsrx +66 -64
- package/template/src/Welcome.stories.tsx +22 -0
- package/template/src/app.spec.tsrx +168 -158
- package/template/src/app.web.test.tsx +18 -13
- package/template/src/failure-reporting.spec.ts +3 -3
- package/template/src/main.ts +14 -13
- package/template/src/main.tsrx +2 -0
- package/template/src/native-runtime.spec.ts +13 -11
- package/template/src/test-setup.web.ts +9 -8
- package/template/src/test.ts +6 -6
- package/template/tsconfig.json +17 -1
- package/template/vite.config.native.mts +1 -2
- package/template/vite.config.ts +29 -23
- package/template/vitest.config.mts +17 -17
- package/template/vitest.web.config.mts +7 -7
- package/template/workshop.config.ts +3 -0
- package/library-template/patches/@tsrx__typescript-plugin@0.4.11.patch +0 -11
- package/template/patches/@tsrx__typescript-plugin@0.4.11.patch +0 -11
- /package/library-template/patches/{@octanejs__tiptap@0.0.61.patch → @octanejs__tiptap@0.0.62.patch} +0 -0
- /package/template/patches/{@octanejs__tiptap@0.0.61.patch → @octanejs__tiptap@0.0.62.patch} +0 -0
package/index.ts
CHANGED
|
@@ -2,204 +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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
composeLibrary,
|
|
8
|
+
composeTargets,
|
|
9
|
+
defaultTargets,
|
|
10
|
+
resolveTargets,
|
|
11
|
+
selectableTargets,
|
|
12
|
+
targets,
|
|
12
13
|
} from './scaffold.ts'
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
const fail = (message: string): never => {
|
|
24
|
+
console.error(`✗ ${message}`)
|
|
25
|
+
process.exit(1)
|
|
39
26
|
}
|
|
40
27
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
47
|
-
console.error('✗ --name needs an npm package name')
|
|
48
|
-
process.exit(1)
|
|
49
|
-
}
|
|
46
|
+
const { values, positionals } = parseCli()
|
|
50
47
|
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
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
|
|
56
|
-
|
|
57
|
-
|
|
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 (
|
|
63
|
-
|
|
64
|
-
process.exit(1)
|
|
57
|
+
if (values.name === '') {
|
|
58
|
+
fail('--name needs an npm package name')
|
|
65
59
|
}
|
|
66
60
|
|
|
67
|
-
|
|
68
|
-
|
|
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(
|
|
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
|
-
|
|
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' &&
|
|
84
|
-
|
|
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
|
-
|
|
90
|
-
process.exit(1)
|
|
77
|
+
fail(`${dir} exists and is not empty`)
|
|
91
78
|
}
|
|
92
79
|
|
|
93
80
|
const parseTargets = (value) => {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
81
|
+
const ids = value
|
|
82
|
+
.split(',')
|
|
83
|
+
.map((s) => s.trim())
|
|
84
|
+
.filter(Boolean)
|
|
98
85
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
86
|
+
if (ids.length === 0) {
|
|
87
|
+
throw new Error(`--targets needs a comma list: ${selectableTargets.join(', ')}`)
|
|
88
|
+
}
|
|
102
89
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
-
|
|
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
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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
|
-
|
|
184
|
-
|
|
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
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
function
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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
|
+
}
|
|
205
305
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Library package notes
|
|
2
2
|
|
|
3
|
-
- Use
|
|
3
|
+
- Use the package manager pinned in `package.json` `packageManager`.
|
|
4
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.
|
|
@@ -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
|
-
|
|
21
|
+
return <Badge label="Ready" />
|
|
22
22
|
}
|
|
23
23
|
```
|
|
24
24
|
|
|
@@ -49,8 +49,9 @@ The package publishes authored source for the app's bundler to compile.
|
|
|
49
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
|
|
53
|
-
|
|
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`
|