@owdproject/core 3.1.4-beta.0 → 3.2.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 +6 -6
- package/bin/cli.js +395 -0
- package/bin/desktop.js +5 -0
- package/bin/lib/catalog.js +293 -0
- package/bin/lib/config.js +109 -0
- package/bin/lib/desktopConfig.js +56 -0
- package/bin/lib/generateTemplate.js +389 -0
- package/bin/lib/install.js +408 -0
- package/bin/lib/migrateModulePlayground.config.mjs +164 -0
- package/bin/lib/migrateModulePlayground.mjs +313 -0
- package/bin/lib/npmVersions.js +124 -0
- package/bin/lib/playgroundContext.js +188 -0
- package/bin/lib/scaffold.js +197 -0
- package/bin/lib/status.js +289 -0
- package/bin/lib/validateModule.js +683 -0
- package/bin/lib/workspace.js +182 -0
- package/bin/owd.js +2 -25
- package/bin/tui.js +1379 -0
- package/dist/module.d.mts +13 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +219 -0
- package/dist/types.d.mts +7 -0
- package/module.ts +53 -19
- package/package.json +78 -22
- package/runtime/components/Core/Application/CoreApplicationRender.vue +3 -1
- package/runtime/components/Core/Application/CoreApplicationWindowsRender.vue +28 -7
- package/runtime/components/Core/Desktop/CoreDesktop.vue +11 -7
- package/runtime/components/Core/Window/CoreWindow.vue +45 -9
- package/runtime/components/Core/Window/CoreWindowNav.vue +26 -8
- package/runtime/composables/useApplicationEntries.ts +1 -1
- package/runtime/composables/useApplicationManager.ts +282 -4
- package/runtime/composables/useDesktopManager.ts +46 -4
- package/runtime/composables/useOwdDialogs.ts +13 -0
- package/runtime/composables/useTerminalManager.ts +62 -3
- package/runtime/composables/useWorkspaceOverview.ts +41 -0
- package/runtime/core/controllers/ApplicationController.ts +120 -30
- package/runtime/core/controllers/WindowController.ts +5 -10
- package/runtime/dialogs/owdDialogProvider.ts +81 -0
- package/runtime/plugins/01.owd-dialogs-fallback.ts +15 -0
- package/runtime/stores/storeApplicationMeta.ts +56 -12
- package/runtime/stores/storeDesktop.ts +79 -0
- package/runtime/stores/storeDesktopDefaultApps.ts +53 -0
- package/runtime/stores/storeDesktopExplorer.ts +74 -0
- package/runtime/stores/storeDesktopWorkspace.ts +14 -2
- package/runtime/utils/captureElementToCanvas.ts +21 -0
- package/runtime/utils/explorerEntryPath.ts +10 -0
- package/runtime/utils/resolveDesktopConfigPath.ts +52 -0
- package/runtime/utils/validateOwdUserConfig.ts +44 -0
- package/types/index.d.ts +64 -12
- package/CHANGELOG.md +0 -25
- package/project.json +0 -4
- package/runtime/composables/useClipboardFs.ts +0 -25
- package/runtime/core/managers/ApplicationManager.ts +0 -281
- package/runtime/core/managers/DesktopManager.ts +0 -47
- package/runtime/core/managers/TerminalManager.ts +0 -48
- package/runtime/stores/storeApplication.ts +0 -235
- package/test/basic.test.ts +0 -15
- package/test/fixtures/basic/app.vue +0 -5
- package/test/fixtures/basic/nuxt.config.ts +0 -5
- package/test/fixtures/basic/package.json +0 -5
- package/tsconfig.app.json +0 -31
- package/tsconfig.json +0 -12
- package/tsconfig.spec.json +0 -37
- package/vitest.config.ts +0 -24
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
import { execSync, spawn } from 'node:child_process'
|
|
2
|
+
import { existsSync } from 'node:fs'
|
|
3
|
+
import { createRequire } from 'node:module'
|
|
4
|
+
import { dirname, join } from 'node:path'
|
|
5
|
+
import { fileURLToPath } from 'node:url'
|
|
6
|
+
import {
|
|
7
|
+
KINDS,
|
|
8
|
+
shortName as toShortName,
|
|
9
|
+
isWorkspaceInstallMode,
|
|
10
|
+
inferKind,
|
|
11
|
+
} from './workspace.js'
|
|
12
|
+
import {
|
|
13
|
+
resolveDesktopConfigPath,
|
|
14
|
+
desktopConfigWritePath,
|
|
15
|
+
} from './desktopConfig.js'
|
|
16
|
+
|
|
17
|
+
const require = createRequire(import.meta.url)
|
|
18
|
+
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
19
|
+
const desktopBin = join(__dirname, '..', 'desktop.js')
|
|
20
|
+
|
|
21
|
+
const SCOPE = '@owdproject/'
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @param {string | undefined} from
|
|
25
|
+
* @param {string} pkgShortName
|
|
26
|
+
* @param {boolean} inMonorepo
|
|
27
|
+
* @param {{ npm?: boolean, dev?: boolean }} [options]
|
|
28
|
+
*/
|
|
29
|
+
export function resolveSource(from, pkgShortName, inMonorepo, options = {}) {
|
|
30
|
+
const { npm = false, dev = false } = options
|
|
31
|
+
|
|
32
|
+
if (npm || from === 'npm' || from === 'registry') {
|
|
33
|
+
return { mode: 'npm', label: 'npm registry' }
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (dev && inMonorepo) {
|
|
37
|
+
return {
|
|
38
|
+
mode: 'workspace',
|
|
39
|
+
gitUrl: `https://github.com/owdproject/${pkgShortName}.git`,
|
|
40
|
+
label: `github.com/owdproject/${pkgShortName}`,
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (!from) {
|
|
45
|
+
return { mode: 'npm', label: 'npm registry' }
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (from === 'owdproject' || from === 'official') {
|
|
49
|
+
if (!inMonorepo) {
|
|
50
|
+
return { mode: 'npm', label: 'npm registry' }
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
mode: 'workspace',
|
|
54
|
+
gitUrl: `https://github.com/owdproject/${pkgShortName}.git`,
|
|
55
|
+
label: `github.com/owdproject/${pkgShortName}`,
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const trimmed = from.trim()
|
|
60
|
+
|
|
61
|
+
if (
|
|
62
|
+
trimmed.startsWith('https://') ||
|
|
63
|
+
trimmed.startsWith('http://') ||
|
|
64
|
+
trimmed.startsWith('git@') ||
|
|
65
|
+
trimmed.startsWith('ssh://')
|
|
66
|
+
) {
|
|
67
|
+
return {
|
|
68
|
+
mode: 'workspace',
|
|
69
|
+
gitUrl: normalizeGitUrl(trimmed),
|
|
70
|
+
label: trimmed,
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const slug = trimmed
|
|
75
|
+
.replace(/^github:/, '')
|
|
76
|
+
.replace(/^fork:/, '')
|
|
77
|
+
.replace(/^https?:\/\/github\.com\//, '')
|
|
78
|
+
.replace(/\.git$/, '')
|
|
79
|
+
.replace(/\/$/, '')
|
|
80
|
+
|
|
81
|
+
if (slug.includes('/')) {
|
|
82
|
+
const gitUrl = normalizeGitUrl(`https://github.com/${slug}`)
|
|
83
|
+
return { mode: 'workspace', gitUrl, label: slug }
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (!inMonorepo) {
|
|
87
|
+
return { mode: 'npm', label: 'npm registry' }
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
mode: 'workspace',
|
|
92
|
+
gitUrl: `https://github.com/${slug}/${pkgShortName}.git`,
|
|
93
|
+
label: `github.com/${slug}/${pkgShortName}`,
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function normalizeGitUrl(input) {
|
|
98
|
+
const trimmed = input.trim().replace(/\/$/, '')
|
|
99
|
+
if (trimmed.startsWith('git@') || trimmed.startsWith('ssh://')) return trimmed
|
|
100
|
+
if (/^https?:\/\//.test(trimmed)) {
|
|
101
|
+
return trimmed.endsWith('.git') ? trimmed : `${trimmed}.git`
|
|
102
|
+
}
|
|
103
|
+
const path = trimmed
|
|
104
|
+
.replace(/^github\.com\//, '')
|
|
105
|
+
.replace(/^https?:\/\/github\.com\//, '')
|
|
106
|
+
if (/^[\w.-]+\/[\w.-]+/.test(path)) {
|
|
107
|
+
return `https://github.com/${path.split('/').slice(0, 2).join('/')}.git`
|
|
108
|
+
}
|
|
109
|
+
throw new Error(`Could not parse git source: "${input}"`)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @param {string} workspaceRoot
|
|
114
|
+
* @param {string} pkgName full @owdproject/name
|
|
115
|
+
*/
|
|
116
|
+
export function hasLocalWorkspaceSource(workspaceRoot, pkgName) {
|
|
117
|
+
const pkgShort = toShortName(pkgName)
|
|
118
|
+
const kind = inferKind(pkgShort)
|
|
119
|
+
return existsSync(join(workspaceRoot, KINDS[kind].workspaceDir, pkgShort, 'package.json'))
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export async function resolveForkUser(githubUser, pkgShortName) {
|
|
123
|
+
if (!githubUser || githubUser === 'owdproject') return 'owdproject'
|
|
124
|
+
|
|
125
|
+
try {
|
|
126
|
+
const res = await fetch(`https://api.github.com/repos/${githubUser}/${pkgShortName}`, {
|
|
127
|
+
headers: { Accept: 'application/vnd.github+json', 'User-Agent': 'owd-desktop-cli' },
|
|
128
|
+
})
|
|
129
|
+
if (res.ok) return githubUser
|
|
130
|
+
} catch {
|
|
131
|
+
/* ignore */
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return 'owdproject'
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @param {string} pkgName full @owdproject/name
|
|
139
|
+
* @param {import('./workspace.js').InstallMode extends infer M ? { installMode?: M, githubUser?: string | null } : never} settings
|
|
140
|
+
* @param {string | null} workspaceRoot
|
|
141
|
+
*/
|
|
142
|
+
export async function resolveInstallPlan(pkgName, settings, workspaceRoot) {
|
|
143
|
+
const pkgShort = toShortName(pkgName)
|
|
144
|
+
const kind = inferKind(pkgShort)
|
|
145
|
+
const inMonorepo = Boolean(workspaceRoot)
|
|
146
|
+
|
|
147
|
+
if (!isWorkspaceInstallMode(settings)) {
|
|
148
|
+
return {
|
|
149
|
+
mode: 'npm',
|
|
150
|
+
pkgName,
|
|
151
|
+
shortName: pkgShort,
|
|
152
|
+
kind,
|
|
153
|
+
label: 'npm registry',
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (!inMonorepo) {
|
|
158
|
+
return {
|
|
159
|
+
error:
|
|
160
|
+
'Dev install mode requires an OWD monorepo (apps/, packages/, themes/). Switch to User mode or use --npm.',
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const fromUser = settings.githubUser
|
|
165
|
+
? await resolveForkUser(settings.githubUser, pkgShort)
|
|
166
|
+
: 'owdproject'
|
|
167
|
+
|
|
168
|
+
const source = resolveSource(fromUser, pkgShort, true)
|
|
169
|
+
return {
|
|
170
|
+
mode: 'workspace',
|
|
171
|
+
pkgName,
|
|
172
|
+
shortName: pkgShort,
|
|
173
|
+
kind,
|
|
174
|
+
from: fromUser,
|
|
175
|
+
source,
|
|
176
|
+
targetDir: join(KINDS[kind].workspaceDir, pkgShort),
|
|
177
|
+
label: source.label,
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @param {string} pkgName
|
|
183
|
+
* @param {{ installMode?: string, githubUser?: string | null }} settings
|
|
184
|
+
* @param {string} workspaceRoot
|
|
185
|
+
* @param {{ stdio?: 'inherit' | 'pipe' }} [options]
|
|
186
|
+
*/
|
|
187
|
+
export async function installPackage(pkgName, settings, workspaceRoot, options = {}) {
|
|
188
|
+
const plan = await resolveInstallPlan(pkgName, settings, workspaceRoot)
|
|
189
|
+
if (plan.error) throw new Error(plan.error)
|
|
190
|
+
|
|
191
|
+
const stdio = options.stdio ?? 'inherit'
|
|
192
|
+
const args = ['add', plan.shortName]
|
|
193
|
+
|
|
194
|
+
if (plan.mode === 'npm') {
|
|
195
|
+
args.push('--npm')
|
|
196
|
+
} else if (plan.from && plan.from !== 'owdproject') {
|
|
197
|
+
args.push('--from', plan.from)
|
|
198
|
+
} else {
|
|
199
|
+
args.push('--dev')
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
execSync(
|
|
203
|
+
`node ${JSON.stringify(desktopBin)} ${args.map((a) => JSON.stringify(a)).join(' ')}`,
|
|
204
|
+
{ cwd: workspaceRoot, stdio },
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
return plan
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export function runPrepareModules(workspaceRoot, stdio = 'inherit') {
|
|
211
|
+
try {
|
|
212
|
+
execSync('pnpm run prepare:modules', { cwd: workspaceRoot, stdio })
|
|
213
|
+
} catch {
|
|
214
|
+
/* optional in minimal workspaces */
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function loadConfigUtil(workspaceRoot) {
|
|
219
|
+
const utilPath = join(
|
|
220
|
+
workspaceRoot,
|
|
221
|
+
'node_modules/@owdproject/nx/dist/utils/utilConfig.js',
|
|
222
|
+
)
|
|
223
|
+
if (!existsSync(utilPath)) {
|
|
224
|
+
throw new Error('Workspace install needs @owdproject/nx. Run `pnpm install` at the repo root.')
|
|
225
|
+
}
|
|
226
|
+
return require(utilPath)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export function printPlan({ pkgName, kind, targetDir, source, branch, dryRun }) {
|
|
230
|
+
const kindMeta = KINDS[kind]
|
|
231
|
+
console.log(`
|
|
232
|
+
${dryRun ? 'Plan (dry run)' : 'Adding to desktop'}
|
|
233
|
+
────────────────────────────────────────
|
|
234
|
+
Package ${pkgName}
|
|
235
|
+
Type ${kindMeta.label}
|
|
236
|
+
Folder ${targetDir}/
|
|
237
|
+
Source ${source.label}${branch ? ` (branch: ${branch})` : ''}
|
|
238
|
+
Config desktop/desktop.config.ts → ${kindMeta.configKey}
|
|
239
|
+
────────────────────────────────────────
|
|
240
|
+
`)
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export function printNextSteps({ targetDir, dryRun }) {
|
|
244
|
+
if (dryRun) {
|
|
245
|
+
console.log('Dry run complete. Re-run without --dry-run to apply.\n')
|
|
246
|
+
return
|
|
247
|
+
}
|
|
248
|
+
console.log(`Next steps:
|
|
249
|
+
pnpm run dev Start the desktop
|
|
250
|
+
pnpm run prepare:modules Rebuild module stubs if needed
|
|
251
|
+
|
|
252
|
+
Package lives in ${targetDir}/
|
|
253
|
+
`)
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* @param {string} targetDir
|
|
258
|
+
* @param {string} gitUrl
|
|
259
|
+
* @param {string | undefined} branch
|
|
260
|
+
* @param {string} workspaceRoot
|
|
261
|
+
* @param {{ stdio?: 'inherit' | 'pipe' | 'ignore', quiet?: boolean }} [options]
|
|
262
|
+
*/
|
|
263
|
+
export function cloneRepo(targetDir, gitUrl, branch, workspaceRoot, options = {}) {
|
|
264
|
+
const stdio = options.stdio ?? 'inherit'
|
|
265
|
+
const quiet = options.quiet ?? stdio !== 'inherit'
|
|
266
|
+
const absoluteTarget = join(workspaceRoot, targetDir)
|
|
267
|
+
|
|
268
|
+
if (existsSync(join(absoluteTarget, 'package.json'))) {
|
|
269
|
+
if (!quiet) console.log(`Folder ${targetDir}/ already exists — skipping clone.\n`)
|
|
270
|
+
return
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (existsSync(absoluteTarget)) {
|
|
274
|
+
throw new Error(
|
|
275
|
+
`${targetDir}/ exists but has no package.json. Remove the folder or clone your fork there manually.`,
|
|
276
|
+
)
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
const branchArg = branch ? `-b ${JSON.stringify(branch)} ` : ''
|
|
280
|
+
if (!quiet) console.log(`Cloning into ${targetDir}/ …\n`)
|
|
281
|
+
execSync(
|
|
282
|
+
`git clone ${branchArg}${JSON.stringify(gitUrl)} ${JSON.stringify(absoluteTarget)}`,
|
|
283
|
+
{ stdio, cwd: workspaceRoot },
|
|
284
|
+
)
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
function linkWorkspacePackage(desktopPath, pkgName, stdio = 'inherit') {
|
|
288
|
+
execSync(`pnpm add ${pkgName}@workspace:*`, {
|
|
289
|
+
stdio,
|
|
290
|
+
cwd: desktopPath,
|
|
291
|
+
})
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function runDevPrepare(workspaceRoot, pkgName, options = {}) {
|
|
295
|
+
const stdio = options.stdio ?? 'inherit'
|
|
296
|
+
const quiet = options.quiet ?? stdio !== 'inherit'
|
|
297
|
+
try {
|
|
298
|
+
execSync(`pnpm --filter "${pkgName}" run dev:prepare`, {
|
|
299
|
+
stdio,
|
|
300
|
+
cwd: workspaceRoot,
|
|
301
|
+
})
|
|
302
|
+
} catch {
|
|
303
|
+
if (!quiet) console.log('(no dev:prepare script — ok for some packages)\n')
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export async function runWorkspaceInstall({
|
|
308
|
+
pkgName,
|
|
309
|
+
shortName: pkgShort,
|
|
310
|
+
kind,
|
|
311
|
+
workspaceRoot,
|
|
312
|
+
source,
|
|
313
|
+
branch,
|
|
314
|
+
dryRun,
|
|
315
|
+
}) {
|
|
316
|
+
const { workspaceDir } = KINDS[kind]
|
|
317
|
+
const targetDir = join(workspaceDir, pkgShort)
|
|
318
|
+
const desktopPath = join(workspaceRoot, 'desktop')
|
|
319
|
+
const resolved = resolveDesktopConfigPath(desktopPath)
|
|
320
|
+
const configPath = resolved?.path ?? desktopConfigWritePath(desktopPath)
|
|
321
|
+
|
|
322
|
+
printPlan({
|
|
323
|
+
pkgName,
|
|
324
|
+
kind,
|
|
325
|
+
targetDir,
|
|
326
|
+
source,
|
|
327
|
+
branch,
|
|
328
|
+
dryRun,
|
|
329
|
+
})
|
|
330
|
+
|
|
331
|
+
if (dryRun) {
|
|
332
|
+
printNextSteps({ targetDir, dryRun: true })
|
|
333
|
+
return
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
cloneRepo(targetDir, source.gitUrl, branch, workspaceRoot)
|
|
337
|
+
linkWorkspacePackage(desktopPath, pkgName)
|
|
338
|
+
|
|
339
|
+
const { addToDesktopConfig } = loadConfigUtil(workspaceRoot)
|
|
340
|
+
addToDesktopConfig(configPath, KINDS[kind].configKey, pkgName)
|
|
341
|
+
|
|
342
|
+
runDevPrepare(workspaceRoot, pkgName)
|
|
343
|
+
|
|
344
|
+
console.log(`✓ ${pkgName} is ready.\n`)
|
|
345
|
+
printNextSteps({ targetDir, dryRun: false })
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export function runNpmInstall(kind, pkgName, workspaceRoot, stdio = 'inherit') {
|
|
349
|
+
const nxTarget = KINDS[kind].nx
|
|
350
|
+
const child = spawn('pnpm', ['nx', 'run', nxTarget, `--name=${pkgName}`], {
|
|
351
|
+
stdio,
|
|
352
|
+
shell: true,
|
|
353
|
+
cwd: workspaceRoot,
|
|
354
|
+
})
|
|
355
|
+
child.on('exit', (code) => {
|
|
356
|
+
if (stdio === 'inherit') process.exit(code ?? 1)
|
|
357
|
+
})
|
|
358
|
+
return child
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/** Preview label for TUI list rows */
|
|
362
|
+
/**
|
|
363
|
+
* @param {string} pkgName
|
|
364
|
+
* @param {{ installMode?: string, githubUser?: string | null }} settings
|
|
365
|
+
* @param {string} workspaceRoot
|
|
366
|
+
* @param {{ stdio?: 'inherit' | 'pipe' }} [options]
|
|
367
|
+
*/
|
|
368
|
+
export async function materializeToWorkspace(pkgName, settings, workspaceRoot, options = {}) {
|
|
369
|
+
const plan = await resolveInstallPlan(pkgName, settings, workspaceRoot)
|
|
370
|
+
if (plan.error) throw new Error(plan.error)
|
|
371
|
+
if (plan.mode !== 'workspace') {
|
|
372
|
+
throw new Error(`Cannot materialize ${pkgName}: install mode is not DEV (workspace).`)
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
if (hasLocalWorkspaceSource(workspaceRoot, pkgName)) {
|
|
376
|
+
return { skipped: true, plan }
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
const stdio = options.stdio ?? 'inherit'
|
|
380
|
+
const quiet = stdio !== 'inherit'
|
|
381
|
+
const desktopPath = join(workspaceRoot, 'desktop')
|
|
382
|
+
|
|
383
|
+
cloneRepo(plan.targetDir, plan.source.gitUrl, undefined, workspaceRoot, { stdio, quiet })
|
|
384
|
+
linkWorkspacePackage(desktopPath, pkgName, stdio)
|
|
385
|
+
runDevPrepare(workspaceRoot, pkgName, { stdio, quiet })
|
|
386
|
+
|
|
387
|
+
return { skipped: false, plan }
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/** @param {import('./catalog.js').CatalogEntry} item */
|
|
391
|
+
export function catalogListTag(item) {
|
|
392
|
+
if (item.localSource) return 'local'
|
|
393
|
+
if (item.installed && !item.localSource) return 'npm'
|
|
394
|
+
if (item.org === 'workspace') return 'local'
|
|
395
|
+
return 'catalog'
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export function installTag(settings, item) {
|
|
399
|
+
const tag = catalogListTag(item)
|
|
400
|
+
if (tag === 'catalog') {
|
|
401
|
+
if (isWorkspaceInstallMode(settings)) {
|
|
402
|
+
const user = settings.githubUser
|
|
403
|
+
return user && user !== 'owdproject' ? 'git fork' : 'git'
|
|
404
|
+
}
|
|
405
|
+
return 'npm'
|
|
406
|
+
}
|
|
407
|
+
return tag
|
|
408
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/** @typedef {import('./migrateModulePlayground.mjs').MigrateConfig} MigrateConfig */
|
|
2
|
+
|
|
3
|
+
/** @type {MigrateConfig[]} */
|
|
4
|
+
export const configs = [
|
|
5
|
+
{
|
|
6
|
+
path: 'apps/app-todo',
|
|
7
|
+
slug: 'app-todo',
|
|
8
|
+
name: '@owdproject/app-todo',
|
|
9
|
+
moduleName: 'owd-app-todo',
|
|
10
|
+
version: '0.1.3',
|
|
11
|
+
keywords: ['owd-client', 'owd-apps', 'owd-modules'],
|
|
12
|
+
launch: {
|
|
13
|
+
file: 'launch-todo.client.ts',
|
|
14
|
+
pluginName: 'app-todo-playground-launch',
|
|
15
|
+
dependsOn: 'owd-app-todo-register',
|
|
16
|
+
appId: 'org.owdproject.todo',
|
|
17
|
+
command: 'todo',
|
|
18
|
+
},
|
|
19
|
+
pagesYml: true,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
path: 'apps/app-terminal',
|
|
23
|
+
slug: 'app-terminal',
|
|
24
|
+
name: '@owdproject/app-terminal',
|
|
25
|
+
moduleName: 'owd-app-terminal',
|
|
26
|
+
version: '0.1.3',
|
|
27
|
+
launch: {
|
|
28
|
+
file: 'launch-terminal.client.ts',
|
|
29
|
+
pluginName: 'app-terminal-playground-launch',
|
|
30
|
+
dependsOn: 'owd-app-terminal-register',
|
|
31
|
+
appId: 'org.owdproject.terminal',
|
|
32
|
+
command: 'terminal',
|
|
33
|
+
},
|
|
34
|
+
pagesYml: true,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
path: 'apps/app-debug',
|
|
38
|
+
slug: 'app-debug',
|
|
39
|
+
name: '@owdproject/app-debug',
|
|
40
|
+
moduleName: 'owd-app-debug',
|
|
41
|
+
version: '0.1.0',
|
|
42
|
+
launch: {
|
|
43
|
+
file: 'launch-debug.client.ts',
|
|
44
|
+
pluginName: 'app-debug-playground-launch',
|
|
45
|
+
dependsOn: 'owd-app-debug-register',
|
|
46
|
+
appId: 'org.owdproject.debug',
|
|
47
|
+
command: 'debug',
|
|
48
|
+
},
|
|
49
|
+
pagesYml: true,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
path: 'apps/app-dino',
|
|
53
|
+
slug: 'app-dino',
|
|
54
|
+
name: '@owdproject/app-dino',
|
|
55
|
+
moduleName: 'owd-app-dino',
|
|
56
|
+
version: '0.0.1',
|
|
57
|
+
private: true,
|
|
58
|
+
launch: {
|
|
59
|
+
file: 'launch-dino.client.ts',
|
|
60
|
+
pluginName: 'app-dino-playground-launch',
|
|
61
|
+
dependsOn: 'owd-app-dino-register',
|
|
62
|
+
appId: 'org.owdproject.dino',
|
|
63
|
+
command: 'dino',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
path: 'apps/app-soundcloud',
|
|
68
|
+
slug: 'app-soundcloud',
|
|
69
|
+
name: '@owdproject/app-soundcloud',
|
|
70
|
+
moduleName: 'owd-app-soundcloud',
|
|
71
|
+
version: '0.1.0',
|
|
72
|
+
launch: {
|
|
73
|
+
file: 'launch-soundcloud.client.ts',
|
|
74
|
+
pluginName: 'app-soundcloud-playground-launch',
|
|
75
|
+
dependsOn: 'owd-app-soundcloud-register',
|
|
76
|
+
appId: 'org.owdproject.soundcloud',
|
|
77
|
+
command: 'soundcloud --new --no-check',
|
|
78
|
+
},
|
|
79
|
+
pagesYml: true,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
path: 'apps/app-youtube',
|
|
83
|
+
slug: 'app-youtube',
|
|
84
|
+
name: '@owdproject/app-youtube',
|
|
85
|
+
moduleName: 'owd-app-youtube',
|
|
86
|
+
version: '0.1.0',
|
|
87
|
+
launch: {
|
|
88
|
+
file: 'launch-youtube.client.ts',
|
|
89
|
+
pluginName: 'app-youtube-playground-launch',
|
|
90
|
+
dependsOn: 'owd-app-youtube-register',
|
|
91
|
+
appId: 'org.owdproject.youtube',
|
|
92
|
+
command: 'youtube --new --no-check',
|
|
93
|
+
},
|
|
94
|
+
pagesYml: true,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
path: 'apps/app-classic-audioplayer',
|
|
98
|
+
slug: 'app-classic-audioplayer',
|
|
99
|
+
name: '@owdproject/app-classic-audioplayer',
|
|
100
|
+
moduleName: 'owd-app-classic-audioplayer',
|
|
101
|
+
version: '0.0.4',
|
|
102
|
+
playgroundModules: ['@owdproject/module-fs', '@owdproject/module-persistence'],
|
|
103
|
+
playgroundApps: ['@owdproject/app-classic-audioplayer'],
|
|
104
|
+
fsMounts: { '/mnt/test': '/test.zip' },
|
|
105
|
+
copyTestZip: true,
|
|
106
|
+
playgroundExtraDevDeps: {
|
|
107
|
+
'@owdproject/module-fs': 'workspace:*',
|
|
108
|
+
'@owdproject/module-persistence': 'workspace:*',
|
|
109
|
+
},
|
|
110
|
+
launch: {
|
|
111
|
+
file: 'launch-audioplayer.client.ts',
|
|
112
|
+
pluginName: 'app-classic-audioplayer-playground-launch',
|
|
113
|
+
dependsOn: 'owd-app-classic-audioplayer-register',
|
|
114
|
+
appId: 'org.owdproject.classic-audioplayer',
|
|
115
|
+
command: 'classic-audioplayer',
|
|
116
|
+
fsDemo: true,
|
|
117
|
+
},
|
|
118
|
+
pagesYml: true,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
path: 'apps/app-classic-videoplayer',
|
|
122
|
+
slug: 'app-classic-videoplayer',
|
|
123
|
+
name: '@owdproject/app-classic-videoplayer',
|
|
124
|
+
moduleName: 'owd-app-classic-videoplayer',
|
|
125
|
+
version: '0.0.4',
|
|
126
|
+
launch: {
|
|
127
|
+
file: 'launch-videoplayer.client.ts',
|
|
128
|
+
pluginName: 'app-classic-videoplayer-playground-launch',
|
|
129
|
+
dependsOn: 'owd-app-classic-videoplayer-register',
|
|
130
|
+
appId: 'org.owdproject.classic-videoplayer',
|
|
131
|
+
command: 'classic-videoplayer',
|
|
132
|
+
},
|
|
133
|
+
pagesYml: true,
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
path: 'apps/app-explorer',
|
|
137
|
+
slug: 'app-explorer',
|
|
138
|
+
name: '@owdproject/app-explorer',
|
|
139
|
+
moduleName: 'owd-app-explorer',
|
|
140
|
+
version: '0.0.4',
|
|
141
|
+
playgroundModules: ['@owdproject/module-fs', '@owdproject/module-persistence'],
|
|
142
|
+
playgroundApps: ['@owdproject/app-explorer'],
|
|
143
|
+
fsMounts: { '/mnt/test': '/test.zip' },
|
|
144
|
+
copyTestZip: true,
|
|
145
|
+
playgroundExtraDevDeps: {
|
|
146
|
+
'@owdproject/module-fs': 'workspace:*',
|
|
147
|
+
'@owdproject/module-persistence': 'workspace:*',
|
|
148
|
+
'@owdproject/kit-fs': 'workspace:*',
|
|
149
|
+
'@owdproject/kit-explorer': 'workspace:*',
|
|
150
|
+
},
|
|
151
|
+
dependencies: {
|
|
152
|
+
'@owdproject/kit-explorer': 'workspace:*',
|
|
153
|
+
'@owdproject/kit-fs': 'workspace:*',
|
|
154
|
+
},
|
|
155
|
+
launch: {
|
|
156
|
+
file: 'launch-explorer.client.ts',
|
|
157
|
+
pluginName: 'app-explorer-playground-launch',
|
|
158
|
+
dependsOn: 'owd-app-explorer-register',
|
|
159
|
+
appId: 'org.owdproject.explorer',
|
|
160
|
+
command: 'explorer /mnt/test',
|
|
161
|
+
},
|
|
162
|
+
pagesYml: true,
|
|
163
|
+
},
|
|
164
|
+
]
|