create-flow-os 0.0.1-dev.1771840262 → 0.0.1-dev.1771979366
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/package.json +8 -23
- package/{profiles/server/packages/style → src/create}/index.ts +31 -30
- package/src/index.ts +14 -0
- package/src/init/index.ts +66 -0
- package/src/init/lib.ts +36 -0
- package/src/init/scaffold.ts +43 -0
- package/LICENSE +0 -97
- package/README.md +0 -26
- package/bin/index.js +0 -1215
- package/config.json +0 -89
- package/lib/utils.ts +0 -91
- package/packages/client/client/root.css +0 -9
- package/packages/client/client/root.tsx +0 -6
- package/packages/client/client/routes/404.tsx +0 -24
- package/packages/client/client/routes/index.tsx +0 -48
- package/packages/server/server/routes/hello.get.ts +0 -3
- package/profiles/client/.dockerignore +0 -12
- package/profiles/client/.oxfmtrc.json +0 -7
- package/profiles/client/.oxlintrc.json +0 -13
- package/profiles/client/.vscode/settings.json +0 -12
- package/profiles/client/Dockerfile +0 -26
- package/profiles/client/README.md +0 -34
- package/profiles/client/bun.lock +0 -352
- package/profiles/client/client/root.css +0 -9
- package/profiles/client/client/root.tsx +0 -6
- package/profiles/client/client/routes/404.tsx +0 -24
- package/profiles/client/client/routes/about.tsx +0 -7
- package/profiles/client/client/routes/index.tsx +0 -48
- package/profiles/client/flow.config.ts +0 -6
- package/profiles/client/index.html +0 -5
- package/profiles/client/package.json +0 -32
- package/profiles/client/packages/client/LICENSE +0 -97
- package/profiles/client/packages/client/build/config.ts +0 -211
- package/profiles/client/packages/client/build/vite.ts +0 -98
- package/profiles/client/packages/client/features/attrs.ts +0 -32
- package/profiles/client/packages/client/features/class-flow.ts +0 -116
- package/profiles/client/packages/client/features/index.ts +0 -8
- package/profiles/client/packages/client/features/pseudo-injector.ts +0 -40
- package/profiles/client/packages/client/features/style-flow.ts +0 -106
- package/profiles/client/packages/client/features/style.ts +0 -27
- package/profiles/client/packages/client/features/utils.ts +0 -4
- package/profiles/client/packages/client/features/viewport.ts +0 -20
- package/profiles/client/packages/client/index.ts +0 -7
- package/profiles/client/packages/client/package.json +0 -48
- package/profiles/client/packages/client/runtime/dom.ts +0 -2
- package/profiles/client/packages/client/runtime/jsx-dev-runtime.ts +0 -1
- package/profiles/client/packages/client/runtime/jsx-runtime.ts +0 -1
- package/profiles/client/packages/client/runtime/jsx-types.d.ts +0 -66
- package/profiles/client/packages/client/runtime/jsx.ts +0 -101
- package/profiles/client/packages/client/scripts/build.ts +0 -14
- package/profiles/client/packages/client/scripts/preview.ts +0 -14
- package/profiles/client/packages/client/scripts/start-dev.ts +0 -49
- package/profiles/client/packages/core/LICENSE +0 -97
- package/profiles/client/packages/core/dom.ts +0 -43
- package/profiles/client/packages/core/for.ts +0 -42
- package/profiles/client/packages/core/index.ts +0 -5
- package/profiles/client/packages/core/lifecycle.ts +0 -6
- package/profiles/client/packages/core/package.json +0 -16
- package/profiles/client/packages/core/show-switch.ts +0 -56
- package/profiles/client/packages/core/state.ts +0 -56
- package/profiles/client/packages/router/LICENSE +0 -97
- package/profiles/client/packages/router/index.ts +0 -20
- package/profiles/client/packages/router/matcher.ts +0 -105
- package/profiles/client/packages/router/package.json +0 -15
- package/profiles/client/packages/router/router.ts +0 -185
- package/profiles/client/packages/router/types.ts +0 -34
- package/profiles/client/packages/router/utils.ts +0 -45
- package/profiles/client/packages/style/LICENSE +0 -97
- package/profiles/client/packages/style/breakpoints.ts +0 -20
- package/profiles/client/packages/style/extension/.vscodeignore +0 -5
- package/profiles/client/packages/style/extension/flow-style-colors-0.0.1.vsix +0 -0
- package/profiles/client/packages/style/extension/out/extension.js +0 -130
- package/profiles/client/packages/style/extension/package.json +0 -24
- package/profiles/client/packages/style/extension/src/extension.ts +0 -146
- package/profiles/client/packages/style/extension/tsconfig.json +0 -12
- package/profiles/client/packages/style/index.ts +0 -30
- package/profiles/client/packages/style/package.json +0 -20
- package/profiles/client/packages/style/react.ts +0 -68
- package/profiles/client/packages/style/resolve.ts +0 -127
- package/profiles/client/packages/style/server.ts +0 -299
- package/profiles/client/packages/style/shorthand.ts +0 -96
- package/profiles/client/packages/style/style-builder/button.ts +0 -41
- package/profiles/client/packages/style/style-builder/constants.ts +0 -16
- package/profiles/client/packages/style/style-builder/dom.ts +0 -18
- package/profiles/client/packages/style/style-builder/index.ts +0 -48
- package/profiles/client/packages/style/style-builder/panel.ts +0 -69
- package/profiles/client/packages/style/style-builder/position.ts +0 -25
- package/profiles/client/packages/style/visual-builder.ts +0 -822
- package/profiles/client/packages/style/vite-plugin.ts +0 -86
- package/profiles/client/tsconfig.json +0 -30
- package/profiles/full/.dockerignore +0 -12
- package/profiles/full/.oxfmtrc.json +0 -7
- package/profiles/full/.oxlintrc.json +0 -13
- package/profiles/full/.vscode/settings.json +0 -12
- package/profiles/full/Dockerfile +0 -26
- package/profiles/full/README.md +0 -34
- package/profiles/full/bun.lock +0 -352
- package/profiles/full/client/root.css +0 -9
- package/profiles/full/client/root.tsx +0 -6
- package/profiles/full/client/routes/404.tsx +0 -24
- package/profiles/full/client/routes/about.tsx +0 -7
- package/profiles/full/client/routes/index.tsx +0 -48
- package/profiles/full/flow.config.ts +0 -6
- package/profiles/full/index.html +0 -5
- package/profiles/full/package.json +0 -33
- package/profiles/full/packages/client/LICENSE +0 -97
- package/profiles/full/packages/client/build/config.ts +0 -211
- package/profiles/full/packages/client/build/vite.ts +0 -98
- package/profiles/full/packages/client/features/attrs.ts +0 -32
- package/profiles/full/packages/client/features/class-flow.ts +0 -116
- package/profiles/full/packages/client/features/index.ts +0 -8
- package/profiles/full/packages/client/features/pseudo-injector.ts +0 -40
- package/profiles/full/packages/client/features/style-flow.ts +0 -106
- package/profiles/full/packages/client/features/style.ts +0 -27
- package/profiles/full/packages/client/features/utils.ts +0 -4
- package/profiles/full/packages/client/features/viewport.ts +0 -20
- package/profiles/full/packages/client/index.ts +0 -7
- package/profiles/full/packages/client/package.json +0 -48
- package/profiles/full/packages/client/runtime/dom.ts +0 -2
- package/profiles/full/packages/client/runtime/jsx-dev-runtime.ts +0 -1
- package/profiles/full/packages/client/runtime/jsx-runtime.ts +0 -1
- package/profiles/full/packages/client/runtime/jsx-types.d.ts +0 -66
- package/profiles/full/packages/client/runtime/jsx.ts +0 -101
- package/profiles/full/packages/client/scripts/build.ts +0 -14
- package/profiles/full/packages/client/scripts/preview.ts +0 -14
- package/profiles/full/packages/client/scripts/start-dev.ts +0 -49
- package/profiles/full/packages/core/LICENSE +0 -97
- package/profiles/full/packages/core/dom.ts +0 -43
- package/profiles/full/packages/core/for.ts +0 -42
- package/profiles/full/packages/core/index.ts +0 -5
- package/profiles/full/packages/core/lifecycle.ts +0 -6
- package/profiles/full/packages/core/package.json +0 -16
- package/profiles/full/packages/core/show-switch.ts +0 -56
- package/profiles/full/packages/core/state.ts +0 -56
- package/profiles/full/packages/router/LICENSE +0 -97
- package/profiles/full/packages/router/index.ts +0 -20
- package/profiles/full/packages/router/matcher.ts +0 -105
- package/profiles/full/packages/router/package.json +0 -15
- package/profiles/full/packages/router/router.ts +0 -185
- package/profiles/full/packages/router/types.ts +0 -34
- package/profiles/full/packages/router/utils.ts +0 -45
- package/profiles/full/packages/server/LICENSE +0 -97
- package/profiles/full/packages/server/core.ts +0 -140
- package/profiles/full/packages/server/index.ts +0 -24
- package/profiles/full/packages/server/package.json +0 -32
- package/profiles/full/packages/server/plugin.ts +0 -79
- package/profiles/full/packages/server/production.ts +0 -75
- package/profiles/full/packages/server/scripts/start.ts +0 -11
- package/profiles/full/packages/style/LICENSE +0 -97
- package/profiles/full/packages/style/breakpoints.ts +0 -20
- package/profiles/full/packages/style/extension/.vscodeignore +0 -5
- package/profiles/full/packages/style/extension/flow-style-colors-0.0.1.vsix +0 -0
- package/profiles/full/packages/style/extension/out/extension.js +0 -130
- package/profiles/full/packages/style/extension/package.json +0 -24
- package/profiles/full/packages/style/extension/src/extension.ts +0 -146
- package/profiles/full/packages/style/extension/tsconfig.json +0 -12
- package/profiles/full/packages/style/index.ts +0 -30
- package/profiles/full/packages/style/package.json +0 -20
- package/profiles/full/packages/style/react.ts +0 -68
- package/profiles/full/packages/style/resolve.ts +0 -127
- package/profiles/full/packages/style/server.ts +0 -299
- package/profiles/full/packages/style/shorthand.ts +0 -96
- package/profiles/full/packages/style/style-builder/button.ts +0 -41
- package/profiles/full/packages/style/style-builder/constants.ts +0 -16
- package/profiles/full/packages/style/style-builder/dom.ts +0 -18
- package/profiles/full/packages/style/style-builder/index.ts +0 -48
- package/profiles/full/packages/style/style-builder/panel.ts +0 -69
- package/profiles/full/packages/style/style-builder/position.ts +0 -25
- package/profiles/full/packages/style/visual-builder.ts +0 -822
- package/profiles/full/packages/style/vite-plugin.ts +0 -86
- package/profiles/full/server/routes/hello.get.ts +0 -3
- package/profiles/full/tsconfig.json +0 -30
- package/profiles/server/.dockerignore +0 -12
- package/profiles/server/.oxfmtrc.json +0 -7
- package/profiles/server/.oxlintrc.json +0 -13
- package/profiles/server/.vscode/settings.json +0 -12
- package/profiles/server/Dockerfile +0 -26
- package/profiles/server/README.md +0 -34
- package/profiles/server/bun.lock +0 -352
- package/profiles/server/flow.config.ts +0 -7
- package/profiles/server/index.html +0 -5
- package/profiles/server/package.json +0 -30
- package/profiles/server/packages/core/LICENSE +0 -97
- package/profiles/server/packages/core/dom.ts +0 -43
- package/profiles/server/packages/core/for.ts +0 -42
- package/profiles/server/packages/core/index.ts +0 -5
- package/profiles/server/packages/core/lifecycle.ts +0 -6
- package/profiles/server/packages/core/package.json +0 -16
- package/profiles/server/packages/core/show-switch.ts +0 -56
- package/profiles/server/packages/core/state.ts +0 -56
- package/profiles/server/packages/router/LICENSE +0 -97
- package/profiles/server/packages/router/index.ts +0 -20
- package/profiles/server/packages/router/matcher.ts +0 -105
- package/profiles/server/packages/router/package.json +0 -15
- package/profiles/server/packages/router/router.ts +0 -185
- package/profiles/server/packages/router/types.ts +0 -34
- package/profiles/server/packages/router/utils.ts +0 -45
- package/profiles/server/packages/server/LICENSE +0 -97
- package/profiles/server/packages/server/core.ts +0 -140
- package/profiles/server/packages/server/index.ts +0 -24
- package/profiles/server/packages/server/package.json +0 -32
- package/profiles/server/packages/server/plugin.ts +0 -79
- package/profiles/server/packages/server/production.ts +0 -75
- package/profiles/server/packages/server/scripts/start.ts +0 -11
- package/profiles/server/packages/style/LICENSE +0 -97
- package/profiles/server/packages/style/breakpoints.ts +0 -20
- package/profiles/server/packages/style/extension/.vscodeignore +0 -5
- package/profiles/server/packages/style/extension/flow-style-colors-0.0.1.vsix +0 -0
- package/profiles/server/packages/style/extension/out/extension.js +0 -130
- package/profiles/server/packages/style/extension/package.json +0 -24
- package/profiles/server/packages/style/extension/src/extension.ts +0 -146
- package/profiles/server/packages/style/extension/tsconfig.json +0 -12
- package/profiles/server/packages/style/package.json +0 -20
- package/profiles/server/packages/style/react.ts +0 -68
- package/profiles/server/packages/style/resolve.ts +0 -127
- package/profiles/server/packages/style/server.ts +0 -299
- package/profiles/server/packages/style/shorthand.ts +0 -96
- package/profiles/server/packages/style/style-builder/button.ts +0 -41
- package/profiles/server/packages/style/style-builder/constants.ts +0 -16
- package/profiles/server/packages/style/style-builder/dom.ts +0 -18
- package/profiles/server/packages/style/style-builder/index.ts +0 -48
- package/profiles/server/packages/style/style-builder/panel.ts +0 -69
- package/profiles/server/packages/style/style-builder/position.ts +0 -25
- package/profiles/server/packages/style/visual-builder.ts +0 -822
- package/profiles/server/packages/style/vite-plugin.ts +0 -86
- package/profiles/server/server/routes/hello.get.ts +0 -3
- package/profiles/server/tsconfig.json +0 -30
- package/templates/flow.config.client.ts +0 -6
- package/templates/flow.config.full.ts +0 -6
- package/templates/flow.config.server.ts +0 -7
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin Vite: avvia il server di patch, pagina builder (iframe), transform per data-flow-style-line.
|
|
3
|
-
*/
|
|
4
|
-
import type { Plugin } from 'vite';
|
|
5
|
-
import { writeFileSync } from 'node:fs';
|
|
6
|
-
import path from 'node:path';
|
|
7
|
-
import { createStyleFlowServer } from './server.js';
|
|
8
|
-
import type { StyleFlowServerOptions } from './server.js';
|
|
9
|
-
|
|
10
|
-
const PATCH_PORT = 3757;
|
|
11
|
-
let pluginRoot = '';
|
|
12
|
-
const BUILDER_ENTRY_ID = '\0flowStyleBuilder-entry';
|
|
13
|
-
|
|
14
|
-
const BUILDER_HTML = `<!DOCTYPE html>
|
|
15
|
-
<html lang="it">
|
|
16
|
-
<head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Style Builder</title>
|
|
17
|
-
<style>html,body{margin:0;padding:0;height:100%;overflow:hidden}</style></head>
|
|
18
|
-
<body><script type="module" src="/__flowStyleBuilder-entry"></script></body>
|
|
19
|
-
</html>`;
|
|
20
|
-
|
|
21
|
-
const BUILDER_ENTRY_CODE = `import { initFlowStyleBuilder } from '@flow.os/style';
|
|
22
|
-
const iframe = document.createElement('iframe');
|
|
23
|
-
iframe.src = '/';
|
|
24
|
-
iframe.setAttribute('data-flow-preview', '1');
|
|
25
|
-
iframe.style.cssText = 'position:fixed;top:0;left:0;width:100%;height:100vh;border:0;z-index:1';
|
|
26
|
-
document.body.appendChild(iframe);
|
|
27
|
-
initFlowStyleBuilder({ previewIframe: iframe });
|
|
28
|
-
`;
|
|
29
|
-
|
|
30
|
-
export type StyleFlowServerPluginOptions = StyleFlowServerOptions;
|
|
31
|
-
|
|
32
|
-
export function styleFlowServerPlugin(options: StyleFlowServerPluginOptions = {}): Plugin {
|
|
33
|
-
return {
|
|
34
|
-
name: 'flowStyleBuilder-server',
|
|
35
|
-
apply: 'serve',
|
|
36
|
-
configResolved(config) {
|
|
37
|
-
pluginRoot = config.root ?? process.cwd();
|
|
38
|
-
writeFileSync(path.resolve(pluginRoot, 'builder.html'), BUILDER_HTML);
|
|
39
|
-
},
|
|
40
|
-
resolveId(id) {
|
|
41
|
-
if (id === '/__flowStyleBuilder-entry') return BUILDER_ENTRY_ID;
|
|
42
|
-
return null;
|
|
43
|
-
},
|
|
44
|
-
load(id) {
|
|
45
|
-
if (id === BUILDER_ENTRY_ID) return BUILDER_ENTRY_CODE;
|
|
46
|
-
return null;
|
|
47
|
-
},
|
|
48
|
-
transform(code, id) {
|
|
49
|
-
if (!id.endsWith('.tsx') && !id.endsWith('.jsx')) return null;
|
|
50
|
-
const relativeFile = path.relative(pluginRoot || process.cwd(), id).replace(/\\/g, '/');
|
|
51
|
-
const out = code.replace(/\s(s|styleFlow)\s*=\s*\{/g, (match, _p1, offset) => {
|
|
52
|
-
const line = code.slice(0, offset).split(/\r?\n/).length;
|
|
53
|
-
return ` data-flow-style-line="${line}" data-flow-style-file="${relativeFile}" ${match.trim()}`;
|
|
54
|
-
});
|
|
55
|
-
return out === code ? null : { code: out, map: null };
|
|
56
|
-
},
|
|
57
|
-
configureServer(server) {
|
|
58
|
-
const root = server.config.root ?? process.cwd();
|
|
59
|
-
(server as { __flowStyleServerUrl?: string }).__flowStyleServerUrl = `http://127.0.0.1:${PATCH_PORT}`;
|
|
60
|
-
const { server: patchServer, port } = createStyleFlowServer({ ...options, root, port: PATCH_PORT });
|
|
61
|
-
patchServer.listen(port, '127.0.0.1');
|
|
62
|
-
// Servi /builder.html per primo (prima del SPA fallback di Vite)
|
|
63
|
-
const handleBuilder = (
|
|
64
|
-
req: import('node:http').IncomingMessage,
|
|
65
|
-
res: import('node:http').ServerResponse,
|
|
66
|
-
next: () => void
|
|
67
|
-
) => {
|
|
68
|
-
const url = req.url ?? '';
|
|
69
|
-
if (url === '/builder.html' || url.startsWith('/builder.html?')) {
|
|
70
|
-
res.setHeader('Content-Type', 'text/html; charset=utf-8');
|
|
71
|
-
res.end(BUILDER_HTML);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
next();
|
|
75
|
-
};
|
|
76
|
-
const app = server.middlewares as { stack?: { route: string; handle: (req: import('node:http').IncomingMessage, res: import('node:http').ServerResponse, next: () => void) => void }[] };
|
|
77
|
-
if (Array.isArray(app.stack)) {
|
|
78
|
-
app.stack.unshift({ route: '', handle: handleBuilder });
|
|
79
|
-
} else {
|
|
80
|
-
server.middlewares.use(handleBuilder);
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export const STYLE_PATCH_SERVER_URL = `http://127.0.0.1:${PATCH_PORT}`;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ESNext",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"noEmit": true,
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
"isolatedModules": true,
|
|
10
|
-
"esModuleInterop": true,
|
|
11
|
-
"resolveJsonModule": true,
|
|
12
|
-
"allowSyntheticDefaultImports": true,
|
|
13
|
-
"forceConsistentCasingInFileNames": true,
|
|
14
|
-
"noUncheckedIndexedAccess": true,
|
|
15
|
-
"noImplicitOverride": true,
|
|
16
|
-
"noPropertyAccessFromIndexSignature": true,
|
|
17
|
-
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
|
18
|
-
"types": ["vite/client"],
|
|
19
|
-
"jsx": "react-jsx",
|
|
20
|
-
"jsxImportSource": "@flow.os/client",
|
|
21
|
-
"baseUrl": ".",
|
|
22
|
-
"paths": {
|
|
23
|
-
"~/*": ["client/*"],
|
|
24
|
-
"~server/*": ["server/*"],
|
|
25
|
-
"@flow.os/core": ["packages/core/index.ts"],
|
|
26
|
-
"@flow.os/*": ["packages/*"]
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
"include": ["client", "server", "packages/*", "vite.config.ts"]
|
|
30
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Server-only: no Vite client. When you add a frontend (e.g. React), add flow.config.ts:
|
|
3
|
-
* import { config } from '@flow.os/client';
|
|
4
|
-
* export default config({ server: true });
|
|
5
|
-
* (Or server: flowServer() from '@flow.os/server' for Vite plugins.)
|
|
6
|
-
*/
|
|
7
|
-
export default {};
|