Plugins are switched on and off in a Plugins tab, the server keeps the state in data/plugins/plugins.json, and switched-off plugins are never delivered (#114)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
57a97ba94f
commit
c17b2b5426
17 files changed
+994
-129
No files matched your search
+5
-7
@@ -6,24 +6,22 @@
|
||||
*
|
||||
* Usage: node tools/seed-e2e.mjs [projectId] [baseUrl]
|
||||
*/
|
||||
import { copyFileSync, mkdirSync, readdirSync } from 'node:fs';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { sineWav } from './lib/audio.mjs';
|
||||
import { edge, node, port, sceneObject, variable } from './lib/builders.mjs';
|
||||
import { publishPlugins } from './lib/plugins.mjs';
|
||||
import { PROJECTS, cliArgs, uploadFont, uploadSound, writeProject } from './lib/projects.mjs';
|
||||
import { adjustColorsShader } from './lib/shaders.mjs';
|
||||
|
||||
const { projectId, baseUrl } = cliArgs('seed-e2e.mjs', PROJECTS.fixture);
|
||||
|
||||
/**
|
||||
* The plugins that ship with the repository, where the editor loads them from – the build does the
|
||||
* same, this makes a run after a plain checkout independent of it. The server is this checkout
|
||||
* The plugins that ship with the repository, where the editor loads them from and switched on –
|
||||
* the build does the same, this makes a run after a plain checkout independent of it, and puts the
|
||||
* demo plugin back on after a step (or a person) switched it off. The server is this checkout
|
||||
* (locally and in CI), so a file copy is enough.
|
||||
*/
|
||||
const ROOT = fileURLToPath(new URL('..', import.meta.url));
|
||||
mkdirSync(`${ROOT}data/plugins`, { recursive: true });
|
||||
for (const file of readdirSync(`${ROOT}plugins`).filter((f) => f.endsWith('.js')))
|
||||
copyFileSync(`${ROOT}plugins/${file}`, `${ROOT}data/plugins/${file}`);
|
||||
publishPlugins(fileURLToPath(new URL('..', import.meta.url)), { force: true });
|
||||
|
||||
/**
|
||||
* Two typefaces for the font step to pick and to drop. They are put on the server but not made
|
||||
|
||||
Reference in new issue
Block a user