@ossy/app 1.40.0 → 1.40.1
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/cli/build.task.js +2 -4
- package/cli/manifest-plugin.js +5 -11
- package/cli/start.task.js +2 -1
- package/package.json +10 -10
- package/src/shell/ThemeEditor.jsx +4 -3
package/cli/build.task.js
CHANGED
|
@@ -198,14 +198,12 @@ function generateEmailStub ({ stubAbs, sourceAbs }) {
|
|
|
198
198
|
].join('\n')
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
// Actions are
|
|
202
|
-
// `run` so the manifest plugin can validate them and the platform server can
|
|
203
|
-
// invoke them at runtime.
|
|
201
|
+
// Actions are intent (metadata only). Implementation lives in a matching `*.task.js`.
|
|
204
202
|
function generateActionStub ({ stubAbs, sourceAbs }) {
|
|
205
203
|
const importPath = relImport(stubAbs, sourceAbs)
|
|
206
204
|
return [
|
|
207
205
|
'// Generated by @ossy/app — do not edit',
|
|
208
|
-
`export {
|
|
206
|
+
`export { metadata } from '${importPath}'`,
|
|
209
207
|
'',
|
|
210
208
|
].join('\n')
|
|
211
209
|
}
|
package/cli/manifest-plugin.js
CHANGED
|
@@ -268,25 +268,19 @@ export function manifestPlugin ({ entriesByStub, srcDir, staticOutDir, configVal
|
|
|
268
268
|
continue
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
-
// Actions are
|
|
272
|
-
//
|
|
273
|
-
// `access` ('public' | 'authenticated' | 'workspace', default 'authenticated').
|
|
271
|
+
// Actions are intent: `metadata` only (`{ id, access }`). Matching task
|
|
272
|
+
// with the same id holds `run` (see ADR 0003).
|
|
274
273
|
if (entryInfo.kind === 'action') {
|
|
275
|
-
const actionId = mod
|
|
274
|
+
const actionId = mod?.metadata?.id
|
|
276
275
|
if (typeof actionId !== 'string' || actionId.trim() === '') {
|
|
277
276
|
this.error(
|
|
278
|
-
`[@ossy/app][build] action entry ${entryInfo.sourcePath} must export a non-empty string "id"`,
|
|
279
|
-
)
|
|
280
|
-
}
|
|
281
|
-
if (typeof mod.run !== 'function') {
|
|
282
|
-
this.error(
|
|
283
|
-
`[@ossy/app][build] action entry ${entryInfo.sourcePath} must export a "run" function`,
|
|
277
|
+
`[@ossy/app][build] action entry ${entryInfo.sourcePath} must export a non-empty string "metadata.id"`,
|
|
284
278
|
)
|
|
285
279
|
}
|
|
286
280
|
if (seenActionIds.has(actionId)) {
|
|
287
281
|
this.error(`[@ossy/app][build] Duplicate action id "${actionId}"`)
|
|
288
282
|
}
|
|
289
|
-
const access = mod.access ?? 'authenticated'
|
|
283
|
+
const access = mod.metadata?.access ?? 'authenticated'
|
|
290
284
|
seenActionIds.add(actionId)
|
|
291
285
|
actions.push({ id: actionId, entry: url, access, package: entryPackage(entryInfo, appPackageName) })
|
|
292
286
|
continue
|
package/cli/start.task.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
2
|
import arg from 'arg'
|
|
3
3
|
import { startServer } from '@ossy/platform/server'
|
|
4
|
+
import 'dotenv/config'
|
|
4
5
|
|
|
5
6
|
export async function start (cliArgs = []) {
|
|
6
7
|
const options = arg({
|
|
@@ -13,7 +14,7 @@ export async function start (cliArgs = []) {
|
|
|
13
14
|
const cwd = options['--cwd'] ? path.resolve(options['--cwd']) : process.cwd()
|
|
14
15
|
const buildDir = options['--build-dir'] || 'build'
|
|
15
16
|
const port = options['--port']
|
|
16
|
-
|
|
17
|
+
|
|
17
18
|
const { lifetime } = await startServer({ cwd, buildDir, port })
|
|
18
19
|
await lifetime
|
|
19
20
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ossy/app",
|
|
3
|
-
"version": "1.40.
|
|
3
|
+
"version": "1.40.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"source": "./src/index.js",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -42,15 +42,15 @@
|
|
|
42
42
|
"@babel/eslint-parser": "^7.15.8",
|
|
43
43
|
"@babel/preset-react": "^7.26.3",
|
|
44
44
|
"@babel/register": "^7.25.9",
|
|
45
|
-
"@ossy/design-system": "^1.40.
|
|
46
|
-
"@ossy/locale": "^1.40.
|
|
45
|
+
"@ossy/design-system": "^1.40.1",
|
|
46
|
+
"@ossy/locale": "^1.40.1",
|
|
47
47
|
"@ossy/pages": "^1.23.0",
|
|
48
|
-
"@ossy/platform": "^1.39.
|
|
49
|
-
"@ossy/router": "^1.40.
|
|
50
|
-
"@ossy/router-react": "^1.40.
|
|
51
|
-
"@ossy/sdk": "^1.40.
|
|
52
|
-
"@ossy/sdk-react": "^1.40.
|
|
53
|
-
"@ossy/themes": "^1.40.
|
|
48
|
+
"@ossy/platform": "^1.39.1",
|
|
49
|
+
"@ossy/router": "^1.40.1",
|
|
50
|
+
"@ossy/router-react": "^1.40.1",
|
|
51
|
+
"@ossy/sdk": "^1.40.1",
|
|
52
|
+
"@ossy/sdk-react": "^1.40.1",
|
|
53
|
+
"@ossy/themes": "^1.40.1",
|
|
54
54
|
"@rollup/plugin-alias": "^6.0.0",
|
|
55
55
|
"@rollup/plugin-babel": "^7.0.0",
|
|
56
56
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"README.md",
|
|
85
85
|
"tsconfig.json"
|
|
86
86
|
],
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "c0ba5d90749690634e4dc2705178ff8d89dd3070"
|
|
88
88
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useState, useMemo, useCallback, useEffect } from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { updateResourceContent } from '@ossy/resources'
|
|
3
|
+
import { useSdk } from '@ossy/sdk-react'
|
|
3
4
|
import { Overlay, Button, useTheme, View, Text } from '@ossy/design-system'
|
|
4
5
|
import { DevPagesPanel } from './DevPagesPanel.jsx'
|
|
5
6
|
|
|
@@ -40,7 +41,7 @@ const ThemeSwitcher = () => {
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
export const ThemeEditor = () => {
|
|
43
|
-
const
|
|
44
|
+
const sdk = useSdk()
|
|
44
45
|
const [isEditorOpen, setIsEditorOpen] = useState(false)
|
|
45
46
|
const [viewCount, setViewCount] = useState(0)
|
|
46
47
|
// const [theme, temporarilyUpdateTheme] = useTheme()
|
|
@@ -72,7 +73,7 @@ export const ThemeEditor = () => {
|
|
|
72
73
|
|
|
73
74
|
const onSaveTheme = event => {
|
|
74
75
|
event.preventDefault()
|
|
75
|
-
updateResourceContent(theme)
|
|
76
|
+
updateResourceContent(sdk, 'PCX53TaGviq4_8KvK-VOp', theme)
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
useEffect(() => {
|