@nesso-how/plugin 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +63 -2
- package/dist/commands-xXIv9QeH.js +191 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/package.d.ts +36 -0
- package/dist/package.js +201 -0
- package/dist/runtime-CeTVu8np.d.ts +739 -0
- package/dist/runtime-Dfjx2_F9.js +764 -0
- package/dist/runtime.d.ts +2 -0
- package/dist/runtime.js +3 -0
- package/example/README.md +24 -0
- package/example/package.json +32 -0
- package/example/src/index.ts +14 -0
- package/example/tsconfig.json +14 -0
- package/package.json +37 -4
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { C as parseFileOptions, D as LocalizedText, E as parseOrThrow, K as parseDefinition, O as resolvePluginText, S as fileTextLimit, T as PluginError, W as Definition, _ as sha256Hex, a as BaseState, b as FileOpenResult, c as PluginManifest, d as createPluginClient, f as parseContribution, g as runtimeLimits, h as parsePluginMessage, i as ActionState, l as ViewState, m as parsePluginManifest, n as ActionContribution, o as PluginContext, p as parsePluginI18n, q as themeColors, r as ActionDescriptor, s as PluginI18n, t as ActionContext, u as checkMessageSize, v as themeTokens, x as FileSaveOptions, y as FileOpenOptions } from "./runtime-CeTVu8np.js";
|
|
2
|
+
export { ActionContext, ActionContribution, ActionDescriptor, ActionState, BaseState, type Definition, type FileOpenOptions, type FileOpenResult, type FileSaveOptions, type LocalizedText, PluginContext, PluginError, PluginI18n, PluginManifest, ViewState, checkMessageSize, createPluginClient, fileTextLimit, parseContribution, parseDefinition, parseFileOptions, parseOrThrow, parsePluginI18n, parsePluginManifest, parsePluginMessage, resolvePluginText, runtimeLimits, sha256Hex, themeColors, themeTokens };
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as parseOrThrow, i as PluginError } from "./commands-xXIv9QeH.js";
|
|
2
|
+
import { a as parsePluginManifest, c as sha256Hex, d as fileTextLimit, f as parseFileOptions, i as parsePluginI18n, l as themeTokens, m as themeColors, n as createPluginClient, o as parsePluginMessage, p as parseDefinition, r as parseContribution, s as runtimeLimits, t as checkMessageSize, u as resolvePluginText } from "./runtime-Dfjx2_F9.js";
|
|
3
|
+
export { PluginError, checkMessageSize, createPluginClient, fileTextLimit, parseContribution, parseDefinition, parseFileOptions, parseOrThrow, parsePluginI18n, parsePluginManifest, parsePluginMessage, resolvePluginText, runtimeLimits, sha256Hex, themeColors, themeTokens };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Uppercase labels
|
|
2
|
+
|
|
3
|
+
Uppercases labels in the invoked view with one undoable batch. Shared concepts change in every view containing them.
|
|
4
|
+
|
|
5
|
+
Copy this directory outside the workspace, [pack the SDK](../README.md#sdk-development), then build:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install --ignore-scripts --save-dev /absolute/path/to/artifacts/nesso-plugin-0.0.0.tgz
|
|
9
|
+
npm run build
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The build typechecks and bundles `src/index.ts` and its package metadata into `dist/index.js`. Choose your own package name and action ID before publishing.
|
|
13
|
+
|
|
14
|
+
To try it in desktop DevTools, set `manifest` to your parsed `package.json` and `compiledCode` to the text of `dist/index.js`:
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
await window.nessoPlugins.propose(
|
|
18
|
+
crypto.randomUUID(),
|
|
19
|
+
{ manifest, files: [{ path: manifest.nesso.entry, bytes: new TextEncoder().encode(compiledCode) }] },
|
|
20
|
+
'en'
|
|
21
|
+
)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Approve the Nesso access dialog. Installation persists; disable or remove it in Settings. To replace a build, pass its installed `contentId` as the fourth argument; development proposals require fresh approval.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nesso-plugin-uppercase",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Uppercase concept labels in the invoked Nesso view",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"keywords": ["nesso-plugin"],
|
|
8
|
+
"files": ["dist"],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"check": "tsc",
|
|
11
|
+
"build": "npm run check && esbuild src/index.ts --bundle --format=esm --platform=browser --target=es2022 --outfile=dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@nesso-how/plugin": "0.0.0",
|
|
15
|
+
"esbuild": "^0.28.2",
|
|
16
|
+
"typescript": "~7.0.2"
|
|
17
|
+
},
|
|
18
|
+
"nesso": {
|
|
19
|
+
"apiVersion": 1,
|
|
20
|
+
"kind": "actions",
|
|
21
|
+
"entry": "dist/index.js",
|
|
22
|
+
"writes": ["concept.label"],
|
|
23
|
+
"capabilities": []
|
|
24
|
+
},
|
|
25
|
+
"i18n": {
|
|
26
|
+
"metadata": {
|
|
27
|
+
"name": { "en": "Uppercase labels" },
|
|
28
|
+
"description": { "en": "Uppercase concept labels in the invoked view." },
|
|
29
|
+
"documentation": { "en": "Changes the labels of concepts in the invoked view in one undoable transaction. Concepts shared with other views change there too." }
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ActionContext, ActionContribution, NessoOperation } from '@nesso-how/plugin'
|
|
2
|
+
import source from '../package.json' with { type: 'json' }
|
|
3
|
+
|
|
4
|
+
export const create = ({ store }: ActionContext): readonly ActionContribution[] => [{
|
|
5
|
+
id: 'uppercase-labels',
|
|
6
|
+
label: source.i18n.metadata.name,
|
|
7
|
+
supportsViews: true,
|
|
8
|
+
run: async () => {
|
|
9
|
+
const state = store.getState()
|
|
10
|
+
if (!('viewGraph' in state)) return
|
|
11
|
+
const operations: readonly NessoOperation[] = state.viewGraph.concepts.map(({ id, label }) => ({ kind: 'concept.label', id, value: label.toUpperCase() }))
|
|
12
|
+
await store.applyOperations(operations, { atRevision: state.revision })
|
|
13
|
+
},
|
|
14
|
+
}]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"lib": ["ES2022", "WebWorker"],
|
|
5
|
+
"module": "NodeNext",
|
|
6
|
+
"moduleResolution": "NodeNext",
|
|
7
|
+
"resolveJsonModule": true,
|
|
8
|
+
"strict": true,
|
|
9
|
+
"verbatimModuleSyntax": true,
|
|
10
|
+
"noEmit": true,
|
|
11
|
+
"types": []
|
|
12
|
+
},
|
|
13
|
+
"include": ["src"]
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nesso-how/plugin",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Types, validation, and asynchronous clients for isolated Nesso plugins",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": ["dist", "example"],
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./src/index.ts",
|
|
11
|
+
"./runtime": "./src/runtime.ts",
|
|
12
|
+
"./package": "./src/package.ts"
|
|
13
|
+
},
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
|
|
18
|
+
"./runtime": { "types": "./dist/runtime.d.ts", "default": "./dist/runtime.js" },
|
|
19
|
+
"./package": { "types": "./dist/package.d.ts", "default": "./dist/package.js" }
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc -p ../../tsconfig.plugin.json && tsdown",
|
|
24
|
+
"prepack": "pnpm run build"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"semver": "^7.8.5",
|
|
28
|
+
"validate-npm-package-name": "^8.0.0",
|
|
29
|
+
"zod": "^4.6.5"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@nesso-how/errors": "workspace:*",
|
|
33
|
+
"@nesso-how/i18n": "workspace:*",
|
|
34
|
+
"@nesso-how/schema": "workspace:*",
|
|
35
|
+
"@types/semver": "^7.8.0",
|
|
36
|
+
"@types/validate-npm-package-name": "^4.0.2",
|
|
37
|
+
"tsdown": "^0.23.1"
|
|
38
|
+
}
|
|
39
|
+
}
|