@owdproject/cli 0.2.0 → 4.0.0-alpha.3
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/bin/cli.js +10 -10
- package/bin/cp.js +6 -6
- package/bin/lib/catalog.js +2 -1
- package/bin/lib/create.js +14 -8
- package/bin/lib/generateTemplate.js +7 -5
- package/bin/lib/migrateModulePlayground.config.mjs +19 -19
- package/bin/lib/migrateModulePlayground.mjs +12 -10
- package/bin/lib/scaffold.js +1 -1
- package/bin/lib/validateModule.js +23 -22
- package/bin/lib/workspace.js +21 -10
- package/go/desktop-go +0 -0
- package/go/owd-cli +0 -0
- package/go/tui/engine_test.go +5 -5
- package/go/tui/handlers.go +1 -1
- package/go/tui/helpers.go +2 -2
- package/go/tui/helpers_test.go +1 -1
- package/go/tui/modals.go +3 -3
- package/go/tui/resolver.go +34 -5
- package/go/tui/resolver_test.go +10 -10
- package/go/tui/tasks.go +4 -4
- package/go/tui/tui.go +2 -2
- package/go/tui/tui_test.go +5 -5
- package/go/tui/workqueue_test.go +2 -2
- package/package.json +9 -4
package/bin/cli.js
CHANGED
|
@@ -72,7 +72,7 @@ CONTROL PANEL (TUI)
|
|
|
72
72
|
q / Esc Quit
|
|
73
73
|
${name} init [dir] Create a new OWD project (then opens the control panel)
|
|
74
74
|
${name} create Create a new app or module (interactive wizard)
|
|
75
|
-
${name} create <kind> <name> Scaffold a new app or module (e.g. desktop create app todo)
|
|
75
|
+
${name} create <kind> <name> Scaffold a new app or module (e.g. desktop create app todo → @owdproject/nuxt-app-todo)
|
|
76
76
|
${name} add <package> [options]
|
|
77
77
|
${name} add <kind> <name> [options]
|
|
78
78
|
${name} validate [path...] Check Nuxt module + playground layout
|
|
@@ -99,17 +99,17 @@ INSTALL SOURCES (control panel or CLI)
|
|
|
99
99
|
EXAMPLES
|
|
100
100
|
pnpm ${name} # control panel
|
|
101
101
|
pnpm ${name} dev # monorepo desktop (from repo root)
|
|
102
|
-
cd apps/app-about && pnpm ${name} dev #
|
|
102
|
+
cd apps/owd-nuxt-app-about && pnpm ${name} dev # about app playground
|
|
103
103
|
pnpm ${name} dev --playground # force playground when cwd is in a module
|
|
104
104
|
${name} init my-desktop # scaffold + pnpm install + control panel
|
|
105
|
-
${name} add app-todo --npm
|
|
106
|
-
${name} add app-todo --dev
|
|
107
|
-
${name} add module-persistence --from dxlliv
|
|
105
|
+
${name} add nuxt-app-todo --npm
|
|
106
|
+
${name} add nuxt-app-todo --dev
|
|
107
|
+
${name} add nuxt-module-pinia-persistence --from dxlliv
|
|
108
108
|
|
|
109
109
|
KINDS (optional — inferred from the package name)
|
|
110
|
-
app app-*
|
|
111
|
-
module module-*
|
|
112
|
-
theme theme-*
|
|
110
|
+
app nuxt-app-* → apps/ (react-app-* for React desktops)
|
|
111
|
+
module nuxt-module-* → packages/ (nuxt-kit-*, react-kit-* and *-template are not listed in the control panel)
|
|
112
|
+
theme nuxt-theme-* → themes/ (react-theme-* for React desktops)
|
|
113
113
|
|
|
114
114
|
OPTIONS
|
|
115
115
|
--playground Start the module playground dev server (when cwd is inside an @owdproject/* package with playground/)
|
|
@@ -130,7 +130,7 @@ OPTIONS
|
|
|
130
130
|
<git-url> Full clone URL
|
|
131
131
|
|
|
132
132
|
LEGACY (still supported)
|
|
133
|
-
${name} install-app @owdproject/app-todo
|
|
133
|
+
${name} install-app @owdproject/nuxt-app-todo
|
|
134
134
|
→ prefer: ${name} add app-todo
|
|
135
135
|
`
|
|
136
136
|
}
|
|
@@ -349,7 +349,7 @@ export async function runCli(name, argv, options = {}) {
|
|
|
349
349
|
if (forcePlayground && !devTarget) {
|
|
350
350
|
fail(
|
|
351
351
|
'No @owdproject module with playground/desktop.config.ts found from this directory.',
|
|
352
|
-
'Run from an app/theme/module package (e.g. apps/app-about), or omit --playground for the monorepo desktop.',
|
|
352
|
+
'Run from an app/theme/module package (e.g. apps/owd-nuxt-app-about), or omit --playground for the monorepo desktop.',
|
|
353
353
|
)
|
|
354
354
|
}
|
|
355
355
|
runDevForeground(devTarget)
|
package/bin/cp.js
CHANGED
|
@@ -2086,12 +2086,12 @@ export async function runCp(commandName = 'desktop') {
|
|
|
2086
2086
|
|
|
2087
2087
|
const npmDownloads = {
|
|
2088
2088
|
'@owdproject/core': 410,
|
|
2089
|
-
'@owdproject/app-about': 8,
|
|
2090
|
-
'@owdproject/app-todo': 12,
|
|
2091
|
-
'@owdproject/app-terminal': 24,
|
|
2092
|
-
'@owdproject/module-fs': 52,
|
|
2093
|
-
'@owdproject/module-persistence': 38,
|
|
2094
|
-
'@
|
|
2089
|
+
'@owdproject/nuxt-app-about': 8,
|
|
2090
|
+
'@owdproject/nuxt-app-todo': 12,
|
|
2091
|
+
'@owdproject/nuxt-app-terminal': 24,
|
|
2092
|
+
'@owdproject/nuxt-module-fs': 52,
|
|
2093
|
+
'@owdproject/nuxt-module-pinia-persistence': 38,
|
|
2094
|
+
'@dxlliv/nuxt-theme-gnome': 14,
|
|
2095
2095
|
'@owdproject/theme-win95': 36,
|
|
2096
2096
|
}
|
|
2097
2097
|
|
package/bin/lib/catalog.js
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
fullName,
|
|
15
15
|
shortName,
|
|
16
16
|
inferKind,
|
|
17
|
+
withoutFrameworkPrefix,
|
|
17
18
|
isInstallableDesktopModule,
|
|
18
19
|
desktopMetaDir,
|
|
19
20
|
} from './workspace.js'
|
|
@@ -416,7 +417,7 @@ export function filterCatalog(catalog, kind, options = {}) {
|
|
|
416
417
|
const sortMode = normalizeCatalogSort(options.sortMode ?? 'updated')
|
|
417
418
|
const filtered = catalog
|
|
418
419
|
.filter((e) => e.kind === kind)
|
|
419
|
-
.filter((e) => kind !== 'module' || (isInstallableDesktopModule(e.name) && e.shortName.startsWith('module-')))
|
|
420
|
+
.filter((e) => kind !== 'module' || (isInstallableDesktopModule(e.name) && withoutFrameworkPrefix(e.shortName).startsWith('module-')))
|
|
420
421
|
|
|
421
422
|
return sortCatalog(filtered, sortMode, options.config ?? null)
|
|
422
423
|
}
|
package/bin/lib/create.js
CHANGED
|
@@ -64,8 +64,12 @@ function copyAndScaffold(srcDir, destDir, replacements) {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
const srcPath = join(srcDir, entry)
|
|
67
|
+
// Longest placeholder first so e.g. `desktop-app-template` wins over `app-template`.
|
|
68
|
+
const orderedReplacements = Object.entries(replacements).sort(
|
|
69
|
+
(a, b) => b[0].length - a[0].length,
|
|
70
|
+
)
|
|
67
71
|
let destEntry = entry
|
|
68
|
-
for (const [placeholder, val] of
|
|
72
|
+
for (const [placeholder, val] of orderedReplacements) {
|
|
69
73
|
destEntry = destEntry.replaceAll(placeholder, val)
|
|
70
74
|
}
|
|
71
75
|
const destPath = join(destDir, destEntry)
|
|
@@ -78,7 +82,7 @@ function copyAndScaffold(srcDir, destDir, replacements) {
|
|
|
78
82
|
const isText = !fileContent.slice(0, 512).includes(0)
|
|
79
83
|
if (isText) {
|
|
80
84
|
let textContent = fileContent.toString('utf8')
|
|
81
|
-
for (const [placeholder, val] of
|
|
85
|
+
for (const [placeholder, val] of orderedReplacements) {
|
|
82
86
|
textContent = textContent.replaceAll(placeholder, val)
|
|
83
87
|
}
|
|
84
88
|
writeFileSync(destPath, textContent, 'utf8')
|
|
@@ -125,14 +129,16 @@ export async function runCreateCli(options = {}) {
|
|
|
125
129
|
rl.close()
|
|
126
130
|
}
|
|
127
131
|
|
|
128
|
-
// Normalize prefix from name (e.g. if user entered "app-todo"
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
// Normalize prefix from name (e.g. if user entered "nuxt-app-todo" or "app-todo"
|
|
133
|
+
// instead of "todo"). New Nuxt extension packages are framework-first.
|
|
134
|
+
for (const prefix of [`nuxt-${kind}-`, `${kind}-`]) {
|
|
135
|
+
if (name.startsWith(prefix)) {
|
|
136
|
+
name = name.slice(prefix.length)
|
|
137
|
+
break
|
|
138
|
+
}
|
|
133
139
|
}
|
|
134
140
|
|
|
135
|
-
const pkgShortName =
|
|
141
|
+
const pkgShortName = `nuxt-${kind}-${name}`
|
|
136
142
|
const pkgFullName = `@owdproject/${pkgShortName}`
|
|
137
143
|
const workspaceDir = KINDS[kind].workspaceDir
|
|
138
144
|
const targetDir = join(workspaceRoot, workspaceDir, pkgShortName)
|
|
@@ -24,15 +24,17 @@ const BLUEPRINT_ROOT = resolve(__dirname, '../../../core/template-blueprint')
|
|
|
24
24
|
|
|
25
25
|
export const STARTER_DESKTOP_DEPS = [
|
|
26
26
|
'@owdproject/core',
|
|
27
|
-
'@owdproject/
|
|
28
|
-
'@owdproject/
|
|
27
|
+
'@owdproject/nuxt',
|
|
28
|
+
'@owdproject/nuxt-theme-nova',
|
|
29
|
+
'@owdproject/nuxt-app-about',
|
|
29
30
|
'h3',
|
|
30
31
|
]
|
|
31
32
|
|
|
32
33
|
/** Used when a starter package is not on npm yet (before first publish). */
|
|
33
34
|
export const TEMPLATE_NPM_FALLBACK_VERSIONS = {
|
|
34
|
-
'@owdproject/core': '
|
|
35
|
-
'@owdproject/
|
|
35
|
+
'@owdproject/core': '4.0.0-alpha.3',
|
|
36
|
+
'@owdproject/nuxt': '4.0.0-alpha.3',
|
|
37
|
+
'@owdproject/nuxt-theme-nova': '4.0.0-alpha.3',
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
const DESKTOP_COPY_FILES = [
|
|
@@ -202,7 +204,7 @@ function buildTemplateDesktopPackageJson(versions) {
|
|
|
202
204
|
}
|
|
203
205
|
|
|
204
206
|
const pkg = {
|
|
205
|
-
name: '@owdproject/
|
|
207
|
+
name: '@owdproject/nuxt-desktop',
|
|
206
208
|
private: true,
|
|
207
209
|
nx: { name: 'desktop' },
|
|
208
210
|
scripts: {
|
|
@@ -5,7 +5,7 @@ export const configs = [
|
|
|
5
5
|
{
|
|
6
6
|
path: 'apps/app-todo',
|
|
7
7
|
slug: 'app-todo',
|
|
8
|
-
name: '@owdproject/app-todo',
|
|
8
|
+
name: '@owdproject/nuxt-app-todo',
|
|
9
9
|
moduleName: 'desktop-app-todo',
|
|
10
10
|
version: '0.1.3',
|
|
11
11
|
keywords: ['owd-client', 'owd-apps', 'owd-modules'],
|
|
@@ -21,7 +21,7 @@ export const configs = [
|
|
|
21
21
|
{
|
|
22
22
|
path: 'apps/app-terminal',
|
|
23
23
|
slug: 'app-terminal',
|
|
24
|
-
name: '@owdproject/app-terminal',
|
|
24
|
+
name: '@owdproject/nuxt-app-terminal',
|
|
25
25
|
moduleName: 'desktop-app-terminal',
|
|
26
26
|
version: '0.1.3',
|
|
27
27
|
launch: {
|
|
@@ -36,7 +36,7 @@ export const configs = [
|
|
|
36
36
|
{
|
|
37
37
|
path: 'apps/app-debug',
|
|
38
38
|
slug: 'app-debug',
|
|
39
|
-
name: '@owdproject/app-debug',
|
|
39
|
+
name: '@owdproject/nuxt-app-debug',
|
|
40
40
|
moduleName: 'desktop-app-debug',
|
|
41
41
|
version: '0.1.0',
|
|
42
42
|
launch: {
|
|
@@ -51,7 +51,7 @@ export const configs = [
|
|
|
51
51
|
{
|
|
52
52
|
path: 'apps/app-dino',
|
|
53
53
|
slug: 'app-dino',
|
|
54
|
-
name: '@owdproject/app-dino',
|
|
54
|
+
name: '@owdproject/nuxt-app-dino',
|
|
55
55
|
moduleName: 'desktop-app-dino',
|
|
56
56
|
version: '0.0.1',
|
|
57
57
|
private: true,
|
|
@@ -66,7 +66,7 @@ export const configs = [
|
|
|
66
66
|
{
|
|
67
67
|
path: 'apps/app-soundcloud',
|
|
68
68
|
slug: 'app-soundcloud',
|
|
69
|
-
name: '@owdproject/app-soundcloud',
|
|
69
|
+
name: '@owdproject/nuxt-app-soundcloud',
|
|
70
70
|
moduleName: 'desktop-app-soundcloud',
|
|
71
71
|
version: '0.1.0',
|
|
72
72
|
launch: {
|
|
@@ -81,7 +81,7 @@ export const configs = [
|
|
|
81
81
|
{
|
|
82
82
|
path: 'apps/app-youtube',
|
|
83
83
|
slug: 'app-youtube',
|
|
84
|
-
name: '@owdproject/app-youtube',
|
|
84
|
+
name: '@owdproject/nuxt-app-youtube',
|
|
85
85
|
moduleName: 'desktop-app-youtube',
|
|
86
86
|
version: '0.1.0',
|
|
87
87
|
launch: {
|
|
@@ -96,16 +96,16 @@ export const configs = [
|
|
|
96
96
|
{
|
|
97
97
|
path: 'apps/app-classic-audioplayer',
|
|
98
98
|
slug: 'app-classic-audioplayer',
|
|
99
|
-
name: '@owdproject/app-classic-audioplayer',
|
|
99
|
+
name: '@owdproject/nuxt-app-classic-audioplayer',
|
|
100
100
|
moduleName: 'desktop-app-classic-audioplayer',
|
|
101
101
|
version: '0.0.4',
|
|
102
|
-
playgroundModules: ['@owdproject/module-fs', '@owdproject/module-persistence'],
|
|
103
|
-
playgroundApps: ['@owdproject/app-classic-audioplayer'],
|
|
102
|
+
playgroundModules: ['@owdproject/nuxt-module-fs', '@owdproject/nuxt-module-pinia-persistence'],
|
|
103
|
+
playgroundApps: ['@owdproject/nuxt-app-classic-audioplayer'],
|
|
104
104
|
fsMounts: { '/mnt/test': '/test.zip' },
|
|
105
105
|
copyTestZip: true,
|
|
106
106
|
playgroundExtraDevDeps: {
|
|
107
|
-
'@owdproject/module-fs': 'workspace:*',
|
|
108
|
-
'@owdproject/module-persistence': 'workspace:*',
|
|
107
|
+
'@owdproject/nuxt-module-fs': 'workspace:*',
|
|
108
|
+
'@owdproject/nuxt-module-pinia-persistence': 'workspace:*',
|
|
109
109
|
},
|
|
110
110
|
launch: {
|
|
111
111
|
file: 'launch-audioplayer.client.ts',
|
|
@@ -120,7 +120,7 @@ export const configs = [
|
|
|
120
120
|
{
|
|
121
121
|
path: 'apps/app-classic-videoplayer',
|
|
122
122
|
slug: 'app-classic-videoplayer',
|
|
123
|
-
name: '@owdproject/app-classic-videoplayer',
|
|
123
|
+
name: '@owdproject/nuxt-app-classic-videoplayer',
|
|
124
124
|
moduleName: 'desktop-app-classic-videoplayer',
|
|
125
125
|
version: '0.0.4',
|
|
126
126
|
launch: {
|
|
@@ -138,13 +138,13 @@ export const configs = [
|
|
|
138
138
|
name: '@owdproject/app-explorer',
|
|
139
139
|
moduleName: 'desktop-app-explorer',
|
|
140
140
|
version: '0.0.4',
|
|
141
|
-
playgroundModules: ['@owdproject/module-fs', '@owdproject/module-persistence'],
|
|
141
|
+
playgroundModules: ['@owdproject/nuxt-module-fs', '@owdproject/nuxt-module-pinia-persistence'],
|
|
142
142
|
playgroundApps: ['@owdproject/app-explorer'],
|
|
143
143
|
fsMounts: { '/mnt/test': '/test.zip' },
|
|
144
144
|
copyTestZip: true,
|
|
145
145
|
playgroundExtraDevDeps: {
|
|
146
|
-
'@owdproject/module-fs': 'workspace:*',
|
|
147
|
-
'@owdproject/module-persistence': 'workspace:*',
|
|
146
|
+
'@owdproject/nuxt-module-fs': 'workspace:*',
|
|
147
|
+
'@owdproject/nuxt-module-pinia-persistence': 'workspace:*',
|
|
148
148
|
},
|
|
149
149
|
dependencies: {
|
|
150
150
|
},
|
|
@@ -160,20 +160,20 @@ export const configs = [
|
|
|
160
160
|
{
|
|
161
161
|
path: 'apps/app-atproto',
|
|
162
162
|
slug: 'app-atproto',
|
|
163
|
-
name: '@owdproject/app-atproto',
|
|
163
|
+
name: '@owdproject/nuxt-app-atproto',
|
|
164
164
|
moduleName: 'desktop-app-atproto',
|
|
165
165
|
version: '0.0.3',
|
|
166
166
|
playgroundTheme: '@owdproject/theme-win95',
|
|
167
167
|
playgroundModules: ['@owdproject/module-atproto'],
|
|
168
|
-
playgroundApps: ['@owdproject/app-terminal', '@owdproject/app-atproto'],
|
|
168
|
+
playgroundApps: ['@owdproject/nuxt-app-terminal', '@owdproject/nuxt-app-atproto'],
|
|
169
169
|
dependencies: {
|
|
170
|
-
'@owdproject/kit-tailwind': 'workspace:*',
|
|
170
|
+
'@owdproject/nuxt-kit-tailwind': 'workspace:*',
|
|
171
171
|
'@owdproject/module-atproto': 'workspace:*',
|
|
172
172
|
},
|
|
173
173
|
playgroundExtraDevDeps: {
|
|
174
174
|
'@owdproject/module-atproto': 'workspace:*',
|
|
175
175
|
'@owdproject/theme-win95': 'workspace:*',
|
|
176
|
-
'@owdproject/app-terminal': 'workspace:*',
|
|
176
|
+
'@owdproject/nuxt-app-terminal': 'workspace:*',
|
|
177
177
|
},
|
|
178
178
|
launch: {
|
|
179
179
|
file: 'launch-atproto.client.ts',
|
|
@@ -19,7 +19,7 @@ function fixAppPlugin(pluginPath, registerName) {
|
|
|
19
19
|
writeFileSync(
|
|
20
20
|
pluginPath,
|
|
21
21
|
`import { defineNuxtPlugin } from 'nuxt/app'
|
|
22
|
-
import { defineDesktopApp } from '@owdproject/
|
|
22
|
+
import { defineDesktopApp } from '@owdproject/nuxt/kit/defineDesktopApp'
|
|
23
23
|
import ${configVar} from './app.config'
|
|
24
24
|
|
|
25
25
|
export default defineNuxtPlugin({
|
|
@@ -38,8 +38,8 @@ function buildLaunchPlugin(cfg) {
|
|
|
38
38
|
if (l.fsDemo) {
|
|
39
39
|
return `import { nextTick } from 'vue'
|
|
40
40
|
import { defineNuxtPlugin } from 'nuxt/app'
|
|
41
|
-
import { useApplicationManager } from '@owdproject/
|
|
42
|
-
import { openVfsFile } from '@owdproject/module-fs/runtime/utils/utilFsOpenFile'
|
|
41
|
+
import { useApplicationManager } from '@owdproject/nuxt/runtime/composables/useApplicationManager'
|
|
42
|
+
import { openVfsFile } from '@owdproject/nuxt-module-fs/runtime/utils/utilFsOpenFile'
|
|
43
43
|
|
|
44
44
|
const APP_ID = '${l.appId}'
|
|
45
45
|
|
|
@@ -75,7 +75,7 @@ export default defineNuxtPlugin({
|
|
|
75
75
|
|
|
76
76
|
return `import { nextTick } from 'vue'
|
|
77
77
|
import { defineNuxtPlugin } from 'nuxt/app'
|
|
78
|
-
import { useApplicationManager } from '@owdproject/
|
|
78
|
+
import { useApplicationManager } from '@owdproject/nuxt/runtime/composables/useApplicationManager'
|
|
79
79
|
|
|
80
80
|
const APP_ID = '${l.appId}'
|
|
81
81
|
const WINDOW_MODEL = 'main'
|
|
@@ -126,7 +126,8 @@ function buildPackageJson(cfg, old) {
|
|
|
126
126
|
'@nuxt/module-builder': '^1.0.2',
|
|
127
127
|
'@nuxt/schema': '^4.3.0',
|
|
128
128
|
'@owdproject/core': 'workspace:*',
|
|
129
|
-
'@owdproject/
|
|
129
|
+
'@owdproject/nuxt': 'workspace:*',
|
|
130
|
+
'@owdproject/nuxt-theme-nova': 'workspace:*',
|
|
130
131
|
nuxt: '^4.3.0',
|
|
131
132
|
typescript: '~5.9.3',
|
|
132
133
|
...(cfg.devDependencies || {}),
|
|
@@ -158,7 +159,7 @@ function buildPackageJson(cfg, old) {
|
|
|
158
159
|
},
|
|
159
160
|
dependencies: deps,
|
|
160
161
|
devDependencies: devDeps,
|
|
161
|
-
peerDependencies: old.peerDependencies || { '@owdproject/core': '^
|
|
162
|
+
peerDependencies: old.peerDependencies || { '@owdproject/core': '>=4.0.0-alpha.0', '@owdproject/nuxt': '^4.0.0-alpha.3' },
|
|
162
163
|
}
|
|
163
164
|
if (cfg.private || old.private) pkg.private = true
|
|
164
165
|
if (old.peerDependenciesMeta) pkg.peerDependenciesMeta = old.peerDependenciesMeta
|
|
@@ -168,11 +169,12 @@ function buildPackageJson(cfg, old) {
|
|
|
168
169
|
function buildPlaygroundPkg(cfg) {
|
|
169
170
|
const deps = {
|
|
170
171
|
'@owdproject/core': 'workspace:*',
|
|
172
|
+
'@owdproject/nuxt': 'workspace:*',
|
|
171
173
|
[cfg.name]: 'workspace:*',
|
|
172
174
|
nuxt: '^4.4.4',
|
|
173
175
|
...(cfg.playgroundExtraDevDeps || {}),
|
|
174
176
|
}
|
|
175
|
-
if (!cfg.playgroundTheme) deps['@owdproject/theme-nova'] = 'workspace:*'
|
|
177
|
+
if (!cfg.playgroundTheme) deps['@owdproject/nuxt-theme-nova'] = 'workspace:*'
|
|
176
178
|
if (cfg.playgroundTheme) deps[cfg.playgroundTheme] = 'workspace:*'
|
|
177
179
|
return {
|
|
178
180
|
name: `${cfg.name}-playground`,
|
|
@@ -184,10 +186,10 @@ function buildPlaygroundPkg(cfg) {
|
|
|
184
186
|
}
|
|
185
187
|
|
|
186
188
|
function buildDesktopConfig(cfg) {
|
|
187
|
-
const theme = cfg.playgroundTheme || '@owdproject/theme-nova'
|
|
189
|
+
const theme = cfg.playgroundTheme || '@owdproject/nuxt-theme-nova'
|
|
188
190
|
const apps = cfg.playgroundApps || [cfg.name]
|
|
189
191
|
const modules = cfg.playgroundModules || []
|
|
190
|
-
let s = `import { defineDesktopConfig } from '@owdproject/
|
|
192
|
+
let s = `import { defineDesktopConfig } from '@owdproject/nuxt'\n\nexport default defineDesktopConfig({\n theme: '${theme}',\n`
|
|
191
193
|
if (apps.length) s += ` apps: [${apps.map((a) => `'${a}'`).join(', ')}],\n`
|
|
192
194
|
if (modules.length) s += ` modules: [${modules.map((m) => `'${m}'`).join(', ')}],\n`
|
|
193
195
|
s += ' systemBar: { enabled: true, startButton: true },\n'
|
|
@@ -201,7 +203,7 @@ function buildDesktopConfig(cfg) {
|
|
|
201
203
|
}
|
|
202
204
|
|
|
203
205
|
const NUXT = `export default defineNuxtConfig({
|
|
204
|
-
modules: ['@owdproject/
|
|
206
|
+
modules: ['@owdproject/nuxt'],
|
|
205
207
|
app: { baseURL: process.env.NUXT_APP_BASE_URL || '/' },
|
|
206
208
|
i18n: { strategy: 'no_prefix' },
|
|
207
209
|
devtools: { enabled: true },
|
package/bin/lib/scaffold.js
CHANGED
|
@@ -14,7 +14,7 @@ import { fileURLToPath } from 'node:url'
|
|
|
14
14
|
|
|
15
15
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
16
16
|
const CLIENT_TEMPLATE = resolve(__dirname, '../../../../template')
|
|
17
|
-
const DEFAULT_CLIENT_REPO = 'https://github.com/owdproject/
|
|
17
|
+
const DEFAULT_CLIENT_REPO = 'https://github.com/owdproject/nuxt-desktop.git'
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* @param {string} [startDir]
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { execSync } from 'node:child_process'
|
|
2
2
|
import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs'
|
|
3
3
|
import { dirname, join, relative, resolve } from 'node:path'
|
|
4
|
-
import { findWorkspaceRoot } from './workspace.js'
|
|
4
|
+
import { findWorkspaceRoot, withoutFrameworkPrefix } from './workspace.js'
|
|
5
5
|
|
|
6
6
|
const SCOPE = '@owdproject/'
|
|
7
7
|
|
|
8
8
|
export const DESKTOP_CORE_PACKAGE = '@owdproject/core'
|
|
9
|
-
export const DESKTOP_KIT_PRIMEVUE_PACKAGE = '@owdproject/kit-primevue'
|
|
9
|
+
export const DESKTOP_KIT_PRIMEVUE_PACKAGE = '@owdproject/nuxt-kit-primevue'
|
|
10
10
|
|
|
11
11
|
const REQUIRED_SCRIPTS = ['dev', 'dev:prepare', 'dev:generate', 'prepack']
|
|
12
12
|
const INFRASTRUCTURE_PLAYBOOK_SCRIPTS = ['dev:prepare', 'prepack']
|
|
@@ -19,7 +19,7 @@ export function isDesktopCorePackage(pkgName) {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* Published Nuxt modules without an app/theme playground (core, kit-primevue).
|
|
22
|
+
* Published Nuxt modules without an app/theme playground (core, kit-nuxt-primevue).
|
|
23
23
|
*
|
|
24
24
|
* @param {string} pkgName
|
|
25
25
|
*/
|
|
@@ -35,8 +35,9 @@ export function isDesktopInfrastructurePackage(pkgName) {
|
|
|
35
35
|
*/
|
|
36
36
|
export function inferModuleKind(pkgName) {
|
|
37
37
|
const short = pkgName.startsWith(SCOPE) ? pkgName.slice(SCOPE.length) : pkgName
|
|
38
|
-
|
|
39
|
-
if (
|
|
38
|
+
const base = withoutFrameworkPrefix(short)
|
|
39
|
+
if (base.startsWith('app-')) return 'app'
|
|
40
|
+
if (base.startsWith('theme-')) return 'theme'
|
|
40
41
|
return 'module'
|
|
41
42
|
}
|
|
42
43
|
|
|
@@ -439,11 +440,11 @@ export function validateOwdModule(packageDir, options = {}) {
|
|
|
439
440
|
}
|
|
440
441
|
|
|
441
442
|
const peerDeps = /** @type {Record<string, string>} */ (pkg.peerDependencies ?? {})
|
|
442
|
-
if (!peerDeps['@owdproject/core']) {
|
|
443
|
+
if (!peerDeps['@owdproject/core'] && !peerDeps['@owdproject/nuxt']) {
|
|
443
444
|
issue(
|
|
444
445
|
'warning',
|
|
445
446
|
'peer-core',
|
|
446
|
-
'peerDependencies should declare @owdproject/
|
|
447
|
+
'peerDependencies should declare @owdproject/nuxt for shell APIs',
|
|
447
448
|
)
|
|
448
449
|
}
|
|
449
450
|
|
|
@@ -495,21 +496,21 @@ export function validateOwdModule(packageDir, options = {}) {
|
|
|
495
496
|
moduleSrc.includes('registerTailwindPath') ||
|
|
496
497
|
moduleSrc.includes('registerThemeTailwindPath')
|
|
497
498
|
const hasKitPrimevue =
|
|
498
|
-
moduleSrc.includes("installModule('@owdproject/kit-primevue'") ||
|
|
499
|
-
moduleSrc.includes('installModule("@owdproject/kit-primevue"')
|
|
499
|
+
moduleSrc.includes("installModule('@owdproject/nuxt-kit-primevue'") ||
|
|
500
|
+
moduleSrc.includes('installModule("@owdproject/nuxt-kit-primevue"')
|
|
500
501
|
if (kind === 'theme') {
|
|
501
502
|
if (!hasKitPrimevue) {
|
|
502
503
|
issue(
|
|
503
504
|
'warning',
|
|
504
|
-
'kit-primevue',
|
|
505
|
-
'theme src/module.ts should install @owdproject/kit-primevue for PrimeVue + Tailwind',
|
|
505
|
+
'kit-nuxt-primevue',
|
|
506
|
+
'theme src/module.ts should install @owdproject/nuxt-kit-primevue for PrimeVue + Tailwind',
|
|
506
507
|
)
|
|
507
508
|
}
|
|
508
509
|
if (!hasKitTailwind) {
|
|
509
510
|
issue(
|
|
510
511
|
'warning',
|
|
511
512
|
'tailwind-path',
|
|
512
|
-
'theme src/module.ts should call registerThemeTailwindPath from @owdproject/kit-primevue/kit/registerTailwindPath',
|
|
513
|
+
'theme src/module.ts should call registerThemeTailwindPath from @owdproject/nuxt-kit-primevue/kit/registerTailwindPath',
|
|
513
514
|
)
|
|
514
515
|
}
|
|
515
516
|
|
|
@@ -561,7 +562,7 @@ export function validateOwdModule(packageDir, options = {}) {
|
|
|
561
562
|
issue(
|
|
562
563
|
'warning',
|
|
563
564
|
'tailwind-path',
|
|
564
|
-
'src/module.ts should call registerTailwindPath from @owdproject/kit-tailwind/kit/registerTailwindPath for Vue components',
|
|
565
|
+
'src/module.ts should call registerTailwindPath from @owdproject/nuxt-kit-tailwind/kit/registerTailwindPath for Vue components',
|
|
565
566
|
)
|
|
566
567
|
}
|
|
567
568
|
|
|
@@ -615,18 +616,18 @@ export function validateOwdModule(packageDir, options = {}) {
|
|
|
615
616
|
`playground/package.json must depend on ${pkgName}`,
|
|
616
617
|
)
|
|
617
618
|
}
|
|
618
|
-
if (!deps['@owdproject/
|
|
619
|
+
if (!deps['@owdproject/nuxt']) {
|
|
619
620
|
issue(
|
|
620
621
|
'error',
|
|
621
622
|
'playground-core-dep',
|
|
622
|
-
'playground/package.json must depend on @owdproject/
|
|
623
|
+
'playground/package.json must depend on @owdproject/nuxt',
|
|
623
624
|
)
|
|
624
625
|
}
|
|
625
|
-
if (kind === 'app' && !deps['@owdproject/theme-nova']) {
|
|
626
|
+
if (kind === 'app' && !deps['@owdproject/nuxt-theme-nova']) {
|
|
626
627
|
issue(
|
|
627
628
|
'warning',
|
|
628
629
|
'playground-theme-nova',
|
|
629
|
-
'app playgrounds should use @owdproject/theme-nova in dependencies',
|
|
630
|
+
'app playgrounds should use @owdproject/nuxt-theme-nova in dependencies',
|
|
630
631
|
)
|
|
631
632
|
}
|
|
632
633
|
} catch {
|
|
@@ -639,11 +640,11 @@ export function validateOwdModule(packageDir, options = {}) {
|
|
|
639
640
|
issue('error', 'playground-nuxt-config', 'playground/nuxt.config.ts is required')
|
|
640
641
|
} else {
|
|
641
642
|
const nuxtCfg = readFileSync(nuxtConfigPath, 'utf8')
|
|
642
|
-
if (!nuxtCfg.includes('@owdproject/
|
|
643
|
+
if (!nuxtCfg.includes('@owdproject/nuxt')) {
|
|
643
644
|
issue(
|
|
644
645
|
'error',
|
|
645
646
|
'playground-nuxt-core',
|
|
646
|
-
'playground/nuxt.config.ts must register @owdproject/
|
|
647
|
+
'playground/nuxt.config.ts must register @owdproject/nuxt',
|
|
647
648
|
)
|
|
648
649
|
}
|
|
649
650
|
if (!/\bssr\s*:\s*false\b/.test(nuxtCfg)) {
|
|
@@ -716,8 +717,8 @@ export function validateOwdModule(packageDir, options = {}) {
|
|
|
716
717
|
if (appDeps[DESKTOP_KIT_PRIMEVUE_PACKAGE]) {
|
|
717
718
|
issue(
|
|
718
719
|
'warning',
|
|
719
|
-
'app-kit-primevue-dep',
|
|
720
|
-
'remove @owdproject/kit-primevue from app dependencies — PrimeVue comes from the theme at runtime; apps only need @owdproject/kit-tailwind',
|
|
720
|
+
'app-kit-nuxt-primevue-dep',
|
|
721
|
+
'remove @owdproject/nuxt-kit-primevue from app dependencies — PrimeVue comes from the theme at runtime; apps only need @owdproject/nuxt-kit-tailwind',
|
|
721
722
|
)
|
|
722
723
|
}
|
|
723
724
|
|
|
@@ -794,7 +795,7 @@ export function validateOwdModule(packageDir, options = {}) {
|
|
|
794
795
|
issue(
|
|
795
796
|
'warning',
|
|
796
797
|
'launch-auto-start',
|
|
797
|
-
`${launchFile}: prefer autoStartPlaygroundApps(nuxtApp, [...]) from @owdproject/
|
|
798
|
+
`${launchFile}: prefer autoStartPlaygroundApps(nuxtApp, [...]) from @owdproject/nuxt (handles workArea + stale windows)`,
|
|
798
799
|
)
|
|
799
800
|
}
|
|
800
801
|
}
|
package/bin/lib/workspace.js
CHANGED
|
@@ -8,6 +8,19 @@ import {
|
|
|
8
8
|
|
|
9
9
|
export const SCOPE = '@owdproject/'
|
|
10
10
|
|
|
11
|
+
/** Framework segments used by framework-first OWD package names (nuxt-app-*, react-theme-*). */
|
|
12
|
+
export const FRAMEWORKS = ['nuxt', 'react', 'vue', 'svelte', 'angular', 'astro']
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Strips a leading framework segment so kind/kit/module detection keeps working
|
|
16
|
+
* with framework-first names (nuxt-app-about -> app-about, react-theme-win95 -> theme-win95).
|
|
17
|
+
*/
|
|
18
|
+
export function withoutFrameworkPrefix(short) {
|
|
19
|
+
const idx = short.indexOf('-')
|
|
20
|
+
if (idx > 0 && FRAMEWORKS.includes(short.slice(0, idx))) return short.slice(idx + 1)
|
|
21
|
+
return short
|
|
22
|
+
}
|
|
23
|
+
|
|
11
24
|
/** Not loadable via desktop.config `modules` (core is the shell). */
|
|
12
25
|
export const DESKTOP_NON_INSTALLABLE = new Set([
|
|
13
26
|
'@owdproject/core',
|
|
@@ -37,21 +50,21 @@ export function docsBasePathFromConfig(config) {
|
|
|
37
50
|
export function isDesktopKitPackage(pkgName) {
|
|
38
51
|
const isScoped = pkgName.startsWith(SCOPE)
|
|
39
52
|
const short = isScoped ? pkgName.slice(SCOPE.length) : pkgName
|
|
40
|
-
if (!isScoped && !
|
|
41
|
-
return short.startsWith('kit-')
|
|
53
|
+
if (!isScoped && !withoutFrameworkPrefix(short).startsWith('kit-')) return false
|
|
54
|
+
return withoutFrameworkPrefix(short).startsWith('kit-')
|
|
42
55
|
}
|
|
43
56
|
|
|
44
57
|
/** Scaffold / blueprint packages — not loadable desktop modules. */
|
|
45
58
|
export function isDesktopTemplatePackage(pkgName) {
|
|
46
59
|
const isScoped = pkgName.startsWith(SCOPE)
|
|
47
60
|
const short = isScoped ? pkgName.slice(SCOPE.length) : pkgName
|
|
48
|
-
if (!isScoped && !pkgName.endsWith('-template')) return false
|
|
49
61
|
return short.endsWith('-template')
|
|
50
62
|
}
|
|
51
63
|
|
|
52
64
|
export function isInstallableDesktopModule(pkgName) {
|
|
53
65
|
const isScoped = pkgName.startsWith(SCOPE)
|
|
54
|
-
|
|
66
|
+
const short = isScoped ? pkgName.slice(SCOPE.length) : pkgName
|
|
67
|
+
if (!isScoped && !withoutFrameworkPrefix(short).startsWith('module-')) return false
|
|
55
68
|
return (
|
|
56
69
|
!DESKTOP_NON_INSTALLABLE.has(pkgName) &&
|
|
57
70
|
!isDesktopKitPackage(pkgName) &&
|
|
@@ -86,10 +99,7 @@ export const KINDS = {
|
|
|
86
99
|
export function findWorkspaceRoot(startDir = process.cwd()) {
|
|
87
100
|
let dir = startDir
|
|
88
101
|
for (;;) {
|
|
89
|
-
if (
|
|
90
|
-
existsSync(join(dir, 'pnpm-workspace.yaml')) &&
|
|
91
|
-
existsSync(join(dir, 'nx.json'))
|
|
92
|
-
) {
|
|
102
|
+
if (existsSync(join(dir, 'pnpm-workspace.yaml'))) {
|
|
93
103
|
return dir
|
|
94
104
|
}
|
|
95
105
|
const parent = dirname(dir)
|
|
@@ -199,8 +209,9 @@ export function fullName(short) {
|
|
|
199
209
|
}
|
|
200
210
|
|
|
201
211
|
export function inferKind(shortName) {
|
|
202
|
-
|
|
203
|
-
if (
|
|
212
|
+
const base = withoutFrameworkPrefix(shortName)
|
|
213
|
+
if (base.startsWith('app-')) return 'app'
|
|
214
|
+
if (base.startsWith('theme-')) return 'theme'
|
|
204
215
|
return 'module'
|
|
205
216
|
}
|
|
206
217
|
|
package/go/desktop-go
CHANGED
|
Binary file
|
package/go/owd-cli
CHANGED
|
Binary file
|
package/go/tui/engine_test.go
CHANGED
|
@@ -18,23 +18,23 @@ func TestResolveMethodLabel(t *testing.T) {
|
|
|
18
18
|
func TestBuildConfigFromPendingRemovals(t *testing.T) {
|
|
19
19
|
ctx := &bridge.WorkspaceContext{
|
|
20
20
|
Config: bridge.Config{
|
|
21
|
-
Apps: []string{"@owdproject/app-about", "@owdproject/app-todo"},
|
|
21
|
+
Apps: []string{"@owdproject/nuxt-app-about", "@owdproject/nuxt-app-todo"},
|
|
22
22
|
Modules: []string{},
|
|
23
23
|
},
|
|
24
24
|
}
|
|
25
25
|
catalog := &bridge.CatalogResponse{
|
|
26
26
|
Entries: []bridge.CatalogEntry{
|
|
27
|
-
{Name: "@owdproject/app-todo", ShortName: "app-todo", Kind: "app"},
|
|
27
|
+
{Name: "@owdproject/nuxt-app-todo", ShortName: "app-todo", Kind: "app"},
|
|
28
28
|
},
|
|
29
29
|
}
|
|
30
30
|
pending := map[string]bool{
|
|
31
|
-
"@owdproject/app-todo": false,
|
|
31
|
+
"@owdproject/nuxt-app-todo": false,
|
|
32
32
|
}
|
|
33
33
|
config, removes := buildConfigFromPending(ctx, catalog, pending, nil)
|
|
34
|
-
if len(removes) != 1 || removes[0] != "@owdproject/app-todo" {
|
|
34
|
+
if len(removes) != 1 || removes[0] != "@owdproject/nuxt-app-todo" {
|
|
35
35
|
t.Fatalf("expected removal, got %v", removes)
|
|
36
36
|
}
|
|
37
|
-
if containsStr(config.Apps, "@owdproject/app-todo") {
|
|
37
|
+
if containsStr(config.Apps, "@owdproject/nuxt-app-todo") {
|
|
38
38
|
t.Fatalf("app-todo should be removed from config, got %v", config.Apps)
|
|
39
39
|
}
|
|
40
40
|
}
|
package/go/tui/handlers.go
CHANGED
|
@@ -274,8 +274,8 @@ func (m *TuiModel) handleResolveDependencyKeys(msg tea.KeyMsg) (tea.Model, tea.C
|
|
|
274
274
|
methods = append(methods, struct{ Name, Label string }{"local", "Use Existing Local Folder"})
|
|
275
275
|
}
|
|
276
276
|
methods = append(methods,
|
|
277
|
-
struct{ Name, Label string }{"git-ssh", "Git SSH"},
|
|
278
277
|
struct{ Name, Label string }{"git-https", "Git HTTPS"},
|
|
278
|
+
struct{ Name, Label string }{"git-ssh", "Git SSH"},
|
|
279
279
|
struct{ Name, Label string }{"npm", "NPM Package"},
|
|
280
280
|
)
|
|
281
281
|
|
package/go/tui/helpers.go
CHANGED
|
@@ -176,7 +176,7 @@ func getOwdDepsLocal(workspaceRoot, shortName, kind string) ([]string, bool) {
|
|
|
176
176
|
if !strings.HasPrefix(name, "@owdproject/") || seen[name] {
|
|
177
177
|
continue
|
|
178
178
|
}
|
|
179
|
-
short := name[strings.LastIndex(name, "/")+1:]
|
|
179
|
+
short := baseKindName(name[strings.LastIndex(name, "/")+1:])
|
|
180
180
|
if strings.HasPrefix(short, "module-") || strings.HasPrefix(short, "kit-") || strings.HasPrefix(short, "app-") || strings.HasPrefix(short, "theme-") {
|
|
181
181
|
deps = append(deps, name)
|
|
182
182
|
seen[name] = true
|
|
@@ -219,7 +219,7 @@ func getOwdDepsFromNpm(pkgName string) ([]string, error) {
|
|
|
219
219
|
if !strings.HasPrefix(name, "@owdproject/") || seen[name] {
|
|
220
220
|
continue
|
|
221
221
|
}
|
|
222
|
-
short := name[strings.LastIndex(name, "/")+1:]
|
|
222
|
+
short := baseKindName(name[strings.LastIndex(name, "/")+1:])
|
|
223
223
|
if strings.HasPrefix(short, "module-") || strings.HasPrefix(short, "kit-") || strings.HasPrefix(short, "app-") || strings.HasPrefix(short, "theme-") {
|
|
224
224
|
deps = append(deps, name)
|
|
225
225
|
seen[name] = true
|
package/go/tui/helpers_test.go
CHANGED
|
@@ -73,7 +73,7 @@ func TestCatalogSourceLabel(t *testing.T) {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
func TestActiveThemeName(t *testing.T) {
|
|
76
|
-
nova := "@owdproject/theme-nova"
|
|
76
|
+
nova := "@owdproject/nuxt-theme-nova"
|
|
77
77
|
gnome := "@owdproject/theme-gnome"
|
|
78
78
|
ctx := &bridge.WorkspaceContext{
|
|
79
79
|
Config: bridge.Config{Theme: &nova},
|
package/go/tui/modals.go
CHANGED
|
@@ -144,8 +144,8 @@ func (m *TuiModel) renderResolveDependencyModal() string {
|
|
|
144
144
|
options = append(options, struct{ Name, Label string }{"local", "Use Existing Local Folder"})
|
|
145
145
|
}
|
|
146
146
|
options = append(options,
|
|
147
|
-
struct{ Name, Label string }{"git-ssh", "Git SSH"},
|
|
148
147
|
struct{ Name, Label string }{"git-https", "Git HTTPS"},
|
|
148
|
+
struct{ Name, Label string }{"git-ssh", "Git SSH"},
|
|
149
149
|
struct{ Name, Label string }{"npm", "NPM Package"},
|
|
150
150
|
)
|
|
151
151
|
for i, opt := range options {
|
|
@@ -212,7 +212,7 @@ func (m *TuiModel) renderManagePackageModal(pkg *bridge.CatalogEntry) string {
|
|
|
212
212
|
// Kits
|
|
213
213
|
var kits []string
|
|
214
214
|
for _, dep := range m.promptPkgDeps {
|
|
215
|
-
if
|
|
215
|
+
if isOwdKit(dep) {
|
|
216
216
|
shortKit := dep[strings.LastIndex(dep, "/")+1:]
|
|
217
217
|
kits = append(kits, shortKit)
|
|
218
218
|
}
|
|
@@ -263,7 +263,7 @@ func (m *TuiModel) renderManagePackageModal(pkg *bridge.CatalogEntry) string {
|
|
|
263
263
|
// Deps (excluding kits)
|
|
264
264
|
var otherDeps []string
|
|
265
265
|
for _, d := range m.promptPkgDeps {
|
|
266
|
-
if !
|
|
266
|
+
if !isOwdKit(d) {
|
|
267
267
|
s := d
|
|
268
268
|
if idx := strings.LastIndex(d, "/"); idx >= 0 {
|
|
269
269
|
s = d[idx+1:]
|
package/go/tui/resolver.go
CHANGED
|
@@ -53,6 +53,34 @@ func shortNameFromPkg(name string) string {
|
|
|
53
53
|
return name
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
// knownFrameworks are the framework segments used by framework-first OWD package
|
|
57
|
+
// names (e.g. nuxt-app-about, react-theme-win95).
|
|
58
|
+
var knownFrameworks = map[string]bool{
|
|
59
|
+
"nuxt": true,
|
|
60
|
+
"react": true,
|
|
61
|
+
"vue": true,
|
|
62
|
+
"svelte": true,
|
|
63
|
+
"angular": true,
|
|
64
|
+
"astro": true,
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// baseKindName strips a leading framework segment so kind/kit/module detection
|
|
68
|
+
// keeps working with framework-first names (nuxt-app-about -> app-about).
|
|
69
|
+
func baseKindName(short string) string {
|
|
70
|
+
if idx := strings.Index(short, "-"); idx >= 0 && knownFrameworks[short[:idx]] {
|
|
71
|
+
return short[idx+1:]
|
|
72
|
+
}
|
|
73
|
+
return short
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// isOwdKit reports whether a scoped OWD package is a UI kit (kit-*, nuxt-kit-*, …).
|
|
77
|
+
func isOwdKit(name string) bool {
|
|
78
|
+
if !strings.HasPrefix(name, "@owdproject/") {
|
|
79
|
+
return false
|
|
80
|
+
}
|
|
81
|
+
return strings.HasPrefix(baseKindName(shortNameFromPkg(name)), "kit-")
|
|
82
|
+
}
|
|
83
|
+
|
|
56
84
|
func kindDirForKind(kind string) string {
|
|
57
85
|
switch kind {
|
|
58
86
|
case "app":
|
|
@@ -76,9 +104,9 @@ func catalogEntryForName(catalog *bridge.CatalogResponse, name string) bridge.Ca
|
|
|
76
104
|
}
|
|
77
105
|
short := shortNameFromPkg(name)
|
|
78
106
|
kind := "module"
|
|
79
|
-
if strings.HasPrefix(short, "app-") {
|
|
107
|
+
if strings.HasPrefix(baseKindName(short), "app-") {
|
|
80
108
|
kind = "app"
|
|
81
|
-
} else if strings.HasPrefix(short, "theme-") {
|
|
109
|
+
} else if strings.HasPrefix(baseKindName(short), "theme-") {
|
|
82
110
|
kind = "theme"
|
|
83
111
|
}
|
|
84
112
|
return bridge.CatalogEntry{
|
|
@@ -212,7 +240,8 @@ func BuildStartupCheckQueue(
|
|
|
212
240
|
continue
|
|
213
241
|
}
|
|
214
242
|
short := shortNameFromPkg(dep)
|
|
215
|
-
|
|
243
|
+
base := baseKindName(short)
|
|
244
|
+
if !strings.HasPrefix(base, "kit-") && !strings.HasPrefix(base, "module-") {
|
|
216
245
|
continue
|
|
217
246
|
}
|
|
218
247
|
if isLocallyAvailable(workspaceRoot, short) {
|
|
@@ -365,9 +394,9 @@ func DiscoverNestedDeps(
|
|
|
365
394
|
}
|
|
366
395
|
depShort := shortNameFromPkg(dep)
|
|
367
396
|
depKind := "module"
|
|
368
|
-
if strings.HasPrefix(depShort, "app-") {
|
|
397
|
+
if strings.HasPrefix(baseKindName(depShort), "app-") {
|
|
369
398
|
depKind = "app"
|
|
370
|
-
} else if strings.HasPrefix(depShort, "theme-") {
|
|
399
|
+
} else if strings.HasPrefix(baseKindName(depShort), "theme-") {
|
|
371
400
|
depKind = "theme"
|
|
372
401
|
}
|
|
373
402
|
logFn("⚠ Dependency discovered: " + depShort)
|
package/go/tui/resolver_test.go
CHANGED
|
@@ -25,8 +25,8 @@ func TestReadDesktopPackageDeps(t *testing.T) {
|
|
|
25
25
|
pkgPath := filepath.Join(dir, "package.json")
|
|
26
26
|
content := `{
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@owdproject/app-about": "workspace:*",
|
|
29
|
-
"@owdproject/theme-nova": "^1.0.0"
|
|
28
|
+
"@owdproject/nuxt-app-about": "workspace:*",
|
|
29
|
+
"@owdproject/nuxt-theme-nova": "^1.0.0"
|
|
30
30
|
}
|
|
31
31
|
}`
|
|
32
32
|
if err := os.WriteFile(pkgPath, []byte(content), 0644); err != nil {
|
|
@@ -36,10 +36,10 @@ func TestReadDesktopPackageDeps(t *testing.T) {
|
|
|
36
36
|
if err != nil {
|
|
37
37
|
t.Fatal(err)
|
|
38
38
|
}
|
|
39
|
-
if deps["@owdproject/app-about"] != "workspace:*" {
|
|
39
|
+
if deps["@owdproject/nuxt-app-about"] != "workspace:*" {
|
|
40
40
|
t.Fatalf("unexpected workspace dep: %v", deps)
|
|
41
41
|
}
|
|
42
|
-
if deps["@owdproject/theme-nova"] != "^1.0.0" {
|
|
42
|
+
if deps["@owdproject/nuxt-theme-nova"] != "^1.0.0" {
|
|
43
43
|
t.Fatalf("unexpected npm dep: %v", deps)
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -53,19 +53,19 @@ func TestBuildQueueFromConfigWorkspaceAndNpm(t *testing.T) {
|
|
|
53
53
|
pkgPath := filepath.Join(desktopDir, "package.json")
|
|
54
54
|
content := `{
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@owdproject/app-about": "workspace:*",
|
|
57
|
-
"@owdproject/theme-nova": "^1.2.0"
|
|
56
|
+
"@owdproject/nuxt-app-about": "workspace:*",
|
|
57
|
+
"@owdproject/nuxt-theme-nova": "^1.2.0"
|
|
58
58
|
}
|
|
59
59
|
}`
|
|
60
60
|
if err := os.WriteFile(pkgPath, []byte(content), 0644); err != nil {
|
|
61
61
|
t.Fatal(err)
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
theme := "@owdproject/theme-nova"
|
|
64
|
+
theme := "@owdproject/nuxt-theme-nova"
|
|
65
65
|
ctx := &bridge.WorkspaceContext{
|
|
66
66
|
Config: bridge.Config{
|
|
67
67
|
Theme: &theme,
|
|
68
|
-
Apps: []string{"@owdproject/app-about"},
|
|
68
|
+
Apps: []string{"@owdproject/nuxt-app-about"},
|
|
69
69
|
},
|
|
70
70
|
Paths: bridge.WorkspacePaths{PackageJson: pkgPath},
|
|
71
71
|
}
|
|
@@ -75,11 +75,11 @@ func TestBuildQueueFromConfigWorkspaceAndNpm(t *testing.T) {
|
|
|
75
75
|
if q.TotalCount() != 2 {
|
|
76
76
|
t.Fatalf("expected 2 queue items, got %d", q.TotalCount())
|
|
77
77
|
}
|
|
78
|
-
about := q.FindByName("@owdproject/app-about")
|
|
78
|
+
about := q.FindByName("@owdproject/nuxt-app-about")
|
|
79
79
|
if about == nil || about.Source != SourcePending {
|
|
80
80
|
t.Fatalf("expected pending workspace item, got %+v", about)
|
|
81
81
|
}
|
|
82
|
-
nova := q.FindByName("@owdproject/theme-nova")
|
|
82
|
+
nova := q.FindByName("@owdproject/nuxt-theme-nova")
|
|
83
83
|
if nova == nil || nova.Kind != KindNpm {
|
|
84
84
|
t.Fatalf("expected npm item, got %+v", nova)
|
|
85
85
|
}
|
package/go/tui/tasks.go
CHANGED
|
@@ -216,10 +216,10 @@ func kindDirForEntry(pkgName, shortName string, entries []bridge.CatalogEntry) s
|
|
|
216
216
|
|
|
217
217
|
// kindDirForShortName infers the workspace subdirectory from the package short name.
|
|
218
218
|
func kindDirForShortName(shortName string) string {
|
|
219
|
-
switch {
|
|
220
|
-
case strings.HasPrefix(
|
|
219
|
+
switch base := baseKindName(shortName); {
|
|
220
|
+
case strings.HasPrefix(base, "app-"):
|
|
221
221
|
return "apps"
|
|
222
|
-
case strings.HasPrefix(
|
|
222
|
+
case strings.HasPrefix(base, "theme-"):
|
|
223
223
|
return "themes"
|
|
224
224
|
default:
|
|
225
225
|
return "packages" // module-*, kit-*, and anything else
|
|
@@ -600,7 +600,7 @@ export default defineDesktopConfig({
|
|
|
600
600
|
runtime.msgChan <- setupProgressMsg{Step: step, Total: totalSteps, Label: "Resetting package dependencies…"}
|
|
601
601
|
runtime.msgChan <- logLineMsg("ℹ Resetting desktop/package.json dependencies to core only…")
|
|
602
602
|
defaultPackageJson := `{
|
|
603
|
-
"name": "@owdproject/
|
|
603
|
+
"name": "@owdproject/nuxt-desktop",
|
|
604
604
|
"private": true,
|
|
605
605
|
"nx": {
|
|
606
606
|
"name": "desktop"
|
package/go/tui/tui.go
CHANGED
|
@@ -822,10 +822,10 @@ func (m *TuiModel) loadPackageDetails(pkg *bridge.CatalogEntry) {
|
|
|
822
822
|
}
|
|
823
823
|
m.promptPkgDeps = append(m.promptPkgDeps, name)
|
|
824
824
|
}
|
|
825
|
-
if name == "@owdproject/kit-primevue" {
|
|
825
|
+
if name == "@owdproject/nuxt-kit-primevue" {
|
|
826
826
|
m.promptPkgHasPrimevue = true
|
|
827
827
|
}
|
|
828
|
-
if name == "@owdproject/kit-tailwind" || name == "tailwindcss" {
|
|
828
|
+
if name == "@owdproject/nuxt-kit-tailwind" || name == "tailwindcss" {
|
|
829
829
|
m.promptPkgHasTailwind = true
|
|
830
830
|
}
|
|
831
831
|
}
|
package/go/tui/tui_test.go
CHANGED
|
@@ -43,27 +43,27 @@ func TestEngineQueueMessages(t *testing.T) {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
func TestBuildConfigFromPending(t *testing.T) {
|
|
46
|
-
theme := "@owdproject/theme-nova"
|
|
46
|
+
theme := "@owdproject/nuxt-theme-nova"
|
|
47
47
|
ctx := &bridge.WorkspaceContext{
|
|
48
48
|
Config: bridge.Config{
|
|
49
49
|
Theme: &theme,
|
|
50
|
-
Apps: []string{"@owdproject/app-about"},
|
|
50
|
+
Apps: []string{"@owdproject/nuxt-app-about"},
|
|
51
51
|
Modules: []string{},
|
|
52
52
|
},
|
|
53
53
|
}
|
|
54
54
|
catalog := &bridge.CatalogResponse{
|
|
55
55
|
Entries: []bridge.CatalogEntry{
|
|
56
|
-
{Name: "@owdproject/app-todo", ShortName: "app-todo", Kind: "app"},
|
|
56
|
+
{Name: "@owdproject/nuxt-app-todo", ShortName: "app-todo", Kind: "app"},
|
|
57
57
|
},
|
|
58
58
|
}
|
|
59
59
|
pending := map[string]bool{
|
|
60
|
-
"@owdproject/app-todo": true,
|
|
60
|
+
"@owdproject/nuxt-app-todo": true,
|
|
61
61
|
}
|
|
62
62
|
config, removes := buildConfigFromPending(ctx, catalog, pending, nil)
|
|
63
63
|
if len(removes) != 0 {
|
|
64
64
|
t.Fatalf("expected no removals, got %v", removes)
|
|
65
65
|
}
|
|
66
|
-
if !containsStr(config.Apps, "@owdproject/app-todo") {
|
|
66
|
+
if !containsStr(config.Apps, "@owdproject/nuxt-app-todo") {
|
|
67
67
|
t.Fatalf("expected app-todo in apps, got %v", config.Apps)
|
|
68
68
|
}
|
|
69
69
|
}
|
package/go/tui/workqueue_test.go
CHANGED
|
@@ -28,10 +28,10 @@ func TestWorkQueueProgress(t *testing.T) {
|
|
|
28
28
|
|
|
29
29
|
func TestWorkQueueAppendUnique(t *testing.T) {
|
|
30
30
|
q := NewWorkQueue()
|
|
31
|
-
if !q.AppendUnique(WorkItem{Name: "@owdproject/app-about", ShortName: "app-about"}) {
|
|
31
|
+
if !q.AppendUnique(WorkItem{Name: "@owdproject/nuxt-app-about", ShortName: "app-about"}) {
|
|
32
32
|
t.Fatal("first append should succeed")
|
|
33
33
|
}
|
|
34
|
-
if q.AppendUnique(WorkItem{Name: "@owdproject/app-about", ShortName: "app-about"}) {
|
|
34
|
+
if q.AppendUnique(WorkItem{Name: "@owdproject/nuxt-app-about", ShortName: "app-about"}) {
|
|
35
35
|
t.Fatal("duplicate append should fail")
|
|
36
36
|
}
|
|
37
37
|
if len(q.Items) != 1 {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owdproject/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "4.0.0-alpha.3",
|
|
4
4
|
"description": "Control Panel and Command Line Interface for Open Web Desktop",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"owd",
|
|
@@ -40,7 +40,12 @@
|
|
|
40
40
|
"mitt": "^3.0.1",
|
|
41
41
|
"nanoid": "^5.1.11",
|
|
42
42
|
"shellwords": "^1.1.1",
|
|
43
|
-
"
|
|
44
|
-
"
|
|
43
|
+
"@owdproject/core": "^4.0.0-alpha.3",
|
|
44
|
+
"ts-morph": "^25.0.1"
|
|
45
|
+
},
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"access": "public",
|
|
48
|
+
"tag": "alpha",
|
|
49
|
+
"registry": "https://registry.npmjs.org/"
|
|
45
50
|
}
|
|
46
|
-
}
|
|
51
|
+
}
|