acrylblends 1.0.2 → 1.0.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/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/docs/framework/README.md +1 -0
- package/docs/framework/agents/index.md +1 -1
- package/docs/framework/guides/data.md +12 -0
- package/docs/framework/workshop/README.md +381 -0
- package/docs/framework/workshop/facilitator.md +107 -0
- package/lib/cordis/db-sqlite.js +10 -2
- package/lib/cordis/kv-json.js +10 -2
- package/lib/cordis/node-server.js +1 -1
- package/lib/cordis/router-http.js +1 -1
- package/lib/node-server.js +1 -1
- package/lib/{test-websocket-ZXHNHQSU.js → test-websocket-D8WWqE5G.js} +1 -2
- package/package.json +1 -1
- package/plugins/acryl-db-sqlite/plugin.json +1 -1
- package/plugins/acryl-db-sqlite/src/index.ts +8 -1
- package/plugins/acryl-kv-json/plugin.json +1 -1
- package/plugins/acryl-kv-json/src/index.ts +8 -1
- package/plugins/acryl-node-server/src/adapter/request.ts +3 -2
package/dist/index.js
CHANGED
|
@@ -697,7 +697,7 @@ function mount(appDir, plugin) {
|
|
|
697
697
|
const found = (plugin.after ? new RegExp(`^( *)- id: ?\\S+\\n\\1 {2}name: ?${plugin.after}\\n(?:\\1 {2}config:\\n(?:\\1 {4}.*\\n|\\1 {2}\\s*\\n)*)?`, "mu") : /^( *)- id: ?routes\n/mu).exec(text);
|
|
698
698
|
if (found) {
|
|
699
699
|
const indent = found[1];
|
|
700
|
-
const row = `${indent}- id: ${plugin.name}\n${indent} name: ${plugin.name}\n`;
|
|
700
|
+
const row = `${indent}- id: ${plugin.row ?? plugin.name}\n${indent} name: ${plugin.name}\n`;
|
|
701
701
|
const at = plugin.after ? found.index + found[0].length : found.index;
|
|
702
702
|
text = text.slice(0, at) + row + text.slice(at);
|
|
703
703
|
writeFileSync(manifestFile, text);
|
|
@@ -712,15 +712,17 @@ function mount(appDir, plugin) {
|
|
|
712
712
|
if (text.includes(entry)) done.push("src/app.ts (already registered)");
|
|
713
713
|
else {
|
|
714
714
|
const last = [...text.matchAll(/^import .* from '\.\.\/plugins\/[^']+'\n/gmu)].at(-1);
|
|
715
|
-
const table = /^export const registry = \{\
|
|
715
|
+
const table = /^export const registry = \{(\s)/mu.exec(text);
|
|
716
716
|
if (last && table) {
|
|
717
|
-
const
|
|
718
|
-
|
|
717
|
+
const file = plugin.entry ?? "index.ts";
|
|
718
|
+
const line = `import * as ${plugin.local} from '../plugins/${plugin.name}/${file}'\n`;
|
|
719
|
+
const at = table.index + table[0].length;
|
|
720
|
+
text = text.slice(0, at) + (table[1] === "\n" ? ` ${entry},\n` : `${entry}, `) + text.slice(at);
|
|
719
721
|
const lastEnd = last.index + last[0].length;
|
|
720
722
|
text = text.slice(0, lastEnd) + line + text.slice(lastEnd);
|
|
721
723
|
writeFileSync(appFile, text);
|
|
722
724
|
done.push(`src/app.ts (registered as ${plugin.local})`);
|
|
723
|
-
} else failed.push(`src/app.ts: import it as \`${plugin.local}\` from '../plugins/${plugin.name}
|
|
725
|
+
} else failed.push(`src/app.ts: import it as \`${plugin.local}\` from '../plugins/${plugin.name}/${plugin.entry ?? "index.ts"}' and add \`${entry}\` to the registry`);
|
|
724
726
|
}
|
|
725
727
|
} else failed.push(`src/app.ts: not found; register ${entry(plugin)} in the app's registry`);
|
|
726
728
|
return {
|