create-flow-os 0.0.1-dev.1771785969 → 0.0.1-dev.1771979233

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.
Files changed (186) hide show
  1. package/package.json +8 -23
  2. package/src/create/index.ts +31 -0
  3. package/src/index.ts +14 -0
  4. package/src/init/index.ts +66 -0
  5. package/src/init/lib.ts +36 -0
  6. package/src/init/scaffold.ts +43 -0
  7. package/LICENSE +0 -97
  8. package/README.md +0 -26
  9. package/bin/index.js +0 -1215
  10. package/config.json +0 -89
  11. package/lib/utils.ts +0 -91
  12. package/packages/client/client/root.css +0 -9
  13. package/packages/client/client/root.tsx +0 -13
  14. package/packages/client/client/routes/404.tsx +0 -24
  15. package/packages/client/client/routes/index.tsx +0 -47
  16. package/packages/server/server/routes/hello.get.ts +0 -3
  17. package/profiles/client/.dockerignore +0 -12
  18. package/profiles/client/.oxfmtrc.json +0 -7
  19. package/profiles/client/.oxlintrc.json +0 -13
  20. package/profiles/client/.vscode/settings.json +0 -12
  21. package/profiles/client/Dockerfile +0 -26
  22. package/profiles/client/README.md +0 -34
  23. package/profiles/client/bun.lock +0 -335
  24. package/profiles/client/client/root.css +0 -9
  25. package/profiles/client/client/root.tsx +0 -13
  26. package/profiles/client/client/routes/404.tsx +0 -24
  27. package/profiles/client/client/routes/index.tsx +0 -47
  28. package/profiles/client/flow.config.ts +0 -3
  29. package/profiles/client/index.html +0 -5
  30. package/profiles/client/package.json +0 -29
  31. package/profiles/client/packages/client/LICENSE +0 -97
  32. package/profiles/client/packages/client/build/config.ts +0 -166
  33. package/profiles/client/packages/client/build/vite.ts +0 -54
  34. package/profiles/client/packages/client/features/attrs.ts +0 -32
  35. package/profiles/client/packages/client/features/class-flow.ts +0 -116
  36. package/profiles/client/packages/client/features/index.ts +0 -8
  37. package/profiles/client/packages/client/features/pseudo-injector.ts +0 -40
  38. package/profiles/client/packages/client/features/style-flow.ts +0 -106
  39. package/profiles/client/packages/client/features/style.ts +0 -27
  40. package/profiles/client/packages/client/features/utils.ts +0 -4
  41. package/profiles/client/packages/client/features/viewport.ts +0 -20
  42. package/profiles/client/packages/client/index.ts +0 -6
  43. package/profiles/client/packages/client/package.json +0 -48
  44. package/profiles/client/packages/client/runtime/dom.ts +0 -2
  45. package/profiles/client/packages/client/runtime/jsx-dev-runtime.ts +0 -1
  46. package/profiles/client/packages/client/runtime/jsx-runtime.ts +0 -1
  47. package/profiles/client/packages/client/runtime/jsx-types.d.ts +0 -64
  48. package/profiles/client/packages/client/runtime/jsx.ts +0 -99
  49. package/profiles/client/packages/client/scripts/build.ts +0 -14
  50. package/profiles/client/packages/client/scripts/preview.ts +0 -14
  51. package/profiles/client/packages/client/scripts/start-dev.ts +0 -49
  52. package/profiles/client/packages/core/LICENSE +0 -97
  53. package/profiles/client/packages/core/dom.ts +0 -43
  54. package/profiles/client/packages/core/for.ts +0 -42
  55. package/profiles/client/packages/core/index.ts +0 -5
  56. package/profiles/client/packages/core/lifecycle.ts +0 -6
  57. package/profiles/client/packages/core/package.json +0 -16
  58. package/profiles/client/packages/core/show-switch.ts +0 -56
  59. package/profiles/client/packages/core/state.ts +0 -56
  60. package/profiles/client/packages/router/LICENSE +0 -97
  61. package/profiles/client/packages/router/index.ts +0 -174
  62. package/profiles/client/packages/router/package.json +0 -15
  63. package/profiles/client/packages/style/LICENSE +0 -97
  64. package/profiles/client/packages/style/breakpoints.ts +0 -20
  65. package/profiles/client/packages/style/extension/.vscodeignore +0 -5
  66. package/profiles/client/packages/style/extension/flow-style-colors-0.0.1.vsix +0 -0
  67. package/profiles/client/packages/style/extension/out/extension.js +0 -130
  68. package/profiles/client/packages/style/extension/package.json +0 -24
  69. package/profiles/client/packages/style/extension/src/extension.ts +0 -146
  70. package/profiles/client/packages/style/extension/tsconfig.json +0 -12
  71. package/profiles/client/packages/style/index.ts +0 -16
  72. package/profiles/client/packages/style/package.json +0 -15
  73. package/profiles/client/packages/style/resolve.ts +0 -84
  74. package/profiles/client/packages/style/shorthand.ts +0 -62
  75. package/profiles/client/tsconfig.json +0 -30
  76. package/profiles/full/.dockerignore +0 -12
  77. package/profiles/full/.oxfmtrc.json +0 -7
  78. package/profiles/full/.oxlintrc.json +0 -13
  79. package/profiles/full/.vscode/settings.json +0 -12
  80. package/profiles/full/Dockerfile +0 -26
  81. package/profiles/full/README.md +0 -34
  82. package/profiles/full/bun.lock +0 -335
  83. package/profiles/full/client/root.css +0 -9
  84. package/profiles/full/client/root.tsx +0 -13
  85. package/profiles/full/client/routes/404.tsx +0 -24
  86. package/profiles/full/client/routes/index.tsx +0 -47
  87. package/profiles/full/flow.config.ts +0 -8
  88. package/profiles/full/index.html +0 -5
  89. package/profiles/full/package.json +0 -30
  90. package/profiles/full/packages/client/LICENSE +0 -97
  91. package/profiles/full/packages/client/build/config.ts +0 -166
  92. package/profiles/full/packages/client/build/vite.ts +0 -54
  93. package/profiles/full/packages/client/features/attrs.ts +0 -32
  94. package/profiles/full/packages/client/features/class-flow.ts +0 -116
  95. package/profiles/full/packages/client/features/index.ts +0 -8
  96. package/profiles/full/packages/client/features/pseudo-injector.ts +0 -40
  97. package/profiles/full/packages/client/features/style-flow.ts +0 -106
  98. package/profiles/full/packages/client/features/style.ts +0 -27
  99. package/profiles/full/packages/client/features/utils.ts +0 -4
  100. package/profiles/full/packages/client/features/viewport.ts +0 -20
  101. package/profiles/full/packages/client/index.ts +0 -6
  102. package/profiles/full/packages/client/package.json +0 -48
  103. package/profiles/full/packages/client/runtime/dom.ts +0 -2
  104. package/profiles/full/packages/client/runtime/jsx-dev-runtime.ts +0 -1
  105. package/profiles/full/packages/client/runtime/jsx-runtime.ts +0 -1
  106. package/profiles/full/packages/client/runtime/jsx-types.d.ts +0 -64
  107. package/profiles/full/packages/client/runtime/jsx.ts +0 -99
  108. package/profiles/full/packages/client/scripts/build.ts +0 -14
  109. package/profiles/full/packages/client/scripts/preview.ts +0 -14
  110. package/profiles/full/packages/client/scripts/start-dev.ts +0 -49
  111. package/profiles/full/packages/core/LICENSE +0 -97
  112. package/profiles/full/packages/core/dom.ts +0 -43
  113. package/profiles/full/packages/core/for.ts +0 -42
  114. package/profiles/full/packages/core/index.ts +0 -5
  115. package/profiles/full/packages/core/lifecycle.ts +0 -6
  116. package/profiles/full/packages/core/package.json +0 -16
  117. package/profiles/full/packages/core/show-switch.ts +0 -56
  118. package/profiles/full/packages/core/state.ts +0 -56
  119. package/profiles/full/packages/router/LICENSE +0 -97
  120. package/profiles/full/packages/router/index.ts +0 -174
  121. package/profiles/full/packages/router/package.json +0 -15
  122. package/profiles/full/packages/server/LICENSE +0 -97
  123. package/profiles/full/packages/server/core.ts +0 -140
  124. package/profiles/full/packages/server/index.ts +0 -24
  125. package/profiles/full/packages/server/package.json +0 -32
  126. package/profiles/full/packages/server/plugin.ts +0 -79
  127. package/profiles/full/packages/server/production.ts +0 -75
  128. package/profiles/full/packages/server/scripts/start.ts +0 -11
  129. package/profiles/full/packages/style/LICENSE +0 -97
  130. package/profiles/full/packages/style/breakpoints.ts +0 -20
  131. package/profiles/full/packages/style/extension/.vscodeignore +0 -5
  132. package/profiles/full/packages/style/extension/flow-style-colors-0.0.1.vsix +0 -0
  133. package/profiles/full/packages/style/extension/out/extension.js +0 -130
  134. package/profiles/full/packages/style/extension/package.json +0 -24
  135. package/profiles/full/packages/style/extension/src/extension.ts +0 -146
  136. package/profiles/full/packages/style/extension/tsconfig.json +0 -12
  137. package/profiles/full/packages/style/index.ts +0 -16
  138. package/profiles/full/packages/style/package.json +0 -15
  139. package/profiles/full/packages/style/resolve.ts +0 -84
  140. package/profiles/full/packages/style/shorthand.ts +0 -62
  141. package/profiles/full/server/routes/hello.get.ts +0 -3
  142. package/profiles/full/tsconfig.json +0 -30
  143. package/profiles/server/.dockerignore +0 -12
  144. package/profiles/server/.oxfmtrc.json +0 -7
  145. package/profiles/server/.oxlintrc.json +0 -13
  146. package/profiles/server/.vscode/settings.json +0 -12
  147. package/profiles/server/Dockerfile +0 -26
  148. package/profiles/server/README.md +0 -34
  149. package/profiles/server/bun.lock +0 -335
  150. package/profiles/server/flow.config.ts +0 -6
  151. package/profiles/server/index.html +0 -5
  152. package/profiles/server/package.json +0 -27
  153. package/profiles/server/packages/core/LICENSE +0 -97
  154. package/profiles/server/packages/core/dom.ts +0 -43
  155. package/profiles/server/packages/core/for.ts +0 -42
  156. package/profiles/server/packages/core/index.ts +0 -5
  157. package/profiles/server/packages/core/lifecycle.ts +0 -6
  158. package/profiles/server/packages/core/package.json +0 -16
  159. package/profiles/server/packages/core/show-switch.ts +0 -56
  160. package/profiles/server/packages/core/state.ts +0 -56
  161. package/profiles/server/packages/router/LICENSE +0 -97
  162. package/profiles/server/packages/router/index.ts +0 -174
  163. package/profiles/server/packages/router/package.json +0 -15
  164. package/profiles/server/packages/server/LICENSE +0 -97
  165. package/profiles/server/packages/server/core.ts +0 -140
  166. package/profiles/server/packages/server/index.ts +0 -24
  167. package/profiles/server/packages/server/package.json +0 -32
  168. package/profiles/server/packages/server/plugin.ts +0 -79
  169. package/profiles/server/packages/server/production.ts +0 -75
  170. package/profiles/server/packages/server/scripts/start.ts +0 -11
  171. package/profiles/server/packages/style/LICENSE +0 -97
  172. package/profiles/server/packages/style/breakpoints.ts +0 -20
  173. package/profiles/server/packages/style/extension/.vscodeignore +0 -5
  174. package/profiles/server/packages/style/extension/flow-style-colors-0.0.1.vsix +0 -0
  175. package/profiles/server/packages/style/extension/out/extension.js +0 -130
  176. package/profiles/server/packages/style/extension/package.json +0 -24
  177. package/profiles/server/packages/style/extension/src/extension.ts +0 -146
  178. package/profiles/server/packages/style/extension/tsconfig.json +0 -12
  179. package/profiles/server/packages/style/index.ts +0 -16
  180. package/profiles/server/packages/style/package.json +0 -15
  181. package/profiles/server/packages/style/resolve.ts +0 -84
  182. package/profiles/server/packages/style/shorthand.ts +0 -62
  183. package/profiles/server/server/routes/hello.get.ts +0 -3
  184. package/profiles/server/tsconfig.json +0 -30
  185. package/templates/flow.config.client.ts +0 -3
  186. package/templates/flow.config.server.ts +0 -6
@@ -1,84 +0,0 @@
1
- import { isStyleKey, getStyleProp, toStyleValue } from './shorthand.js';
2
- import { VIEWPORT_KEYS, PSEUDO_KEYS } from './breakpoints.js';
3
-
4
- const DEFAULT_TOKENS = new Set(['primary', 'muted', 'primary-foreground']);
5
-
6
- /** Layer già "plain" (getter chiamati dal runtime). base + flat style/class. */
7
- export type PlainLayer = {
8
- base?: string;
9
- [key: string]: string | number | boolean | PlainLayer | undefined;
10
- };
11
-
12
- export type ResolvedLayer = { class: string; style: Record<string, string> };
13
-
14
- const RESERVED = new Set([
15
- ...VIEWPORT_KEYS,
16
- ...PSEUDO_KEYS,
17
- ]);
18
-
19
- function isReserved(key: string): boolean {
20
- return RESERVED.has(key as 'mob');
21
- }
22
-
23
- /** Risolve un layer plain in class + style. Non considera mob/tab/des/hover/active. */
24
- export function resolveLayer(plain: PlainLayer, tokens?: Set<string>): ResolvedLayer {
25
- const t = tokens ?? DEFAULT_TOKENS;
26
- const classes: string[] = [];
27
- const style: Record<string, string> = {};
28
-
29
- if (plain.base) classes.push(plain.base.trim());
30
-
31
- for (const [k, v] of Object.entries(plain)) {
32
- if (k === 'base' || isReserved(k)) continue;
33
- if (v === undefined || v === null) continue;
34
-
35
- if (isStyleKey(k)) {
36
- const prop = getStyleProp(k);
37
- if (prop) {
38
- let val = toStyleValue(v, t);
39
- if (k === 'scale' && typeof v === 'number') val = `scale(${v})`;
40
- style[prop] = val;
41
- }
42
- } else {
43
- if (v === true) classes.push(k);
44
- if (typeof v === 'string' && v) classes.push(v);
45
- }
46
- }
47
-
48
- return {
49
- class: classes.filter(Boolean).join(' '),
50
- style,
51
- };
52
- }
53
-
54
- /** Merge due resolved: second sovrascrive style, class è concatenata. */
55
- export function mergeResolved(a: ResolvedLayer, b: ResolvedLayer): ResolvedLayer {
56
- return {
57
- class: [a.class, b.class].filter(Boolean).join(' '),
58
- style: { ...a.style, ...b.style },
59
- };
60
- }
61
-
62
- /** Solo stile da un layer (per pseudo). Ignora base e classList. */
63
- export function resolvePseudoStyle(plain: PlainLayer, tokens?: Set<string>): Record<string, string> {
64
- const t = tokens ?? DEFAULT_TOKENS;
65
- const style: Record<string, string> = {};
66
- for (const [k, v] of Object.entries(plain)) {
67
- if (k === 'base' || isReserved(k)) continue;
68
- if (!isStyleKey(k)) continue;
69
- const prop = getStyleProp(k);
70
- if (prop && v !== undefined && v !== null) {
71
- let val = toStyleValue(v, t);
72
- if (k === 'scale' && typeof v === 'number') val = `scale(${v})`;
73
- style[prop] = val;
74
- }
75
- }
76
- return style;
77
- }
78
-
79
- /** Da oggetto stile a stringa CSS (per iniettare regola :hover). */
80
- export function styleToCssText(style: Record<string, string>): string {
81
- return Object.entries(style)
82
- .map(([k, v]) => `${k}: ${v}`)
83
- .join('; ');
84
- }
@@ -1,62 +0,0 @@
1
- /**
2
- * Shorthand → CSS property. Solo chiavi "pure" (no suffisso tipo mb-10).
3
- * Usato per decidere se una chiave è stile (valore number/string/getter) o classList (bool/getter).
4
- */
5
- export const SHORTHAND_MAP = {
6
- text: 'fontSize',
7
- mb: 'marginBottom',
8
- mt: 'marginTop',
9
- ml: 'marginLeft',
10
- mr: 'marginRight',
11
- mx: 'marginLeft',
12
- my: 'marginTop',
13
- m: 'margin',
14
- pb: 'paddingBottom',
15
- pt: 'paddingTop',
16
- pl: 'paddingLeft',
17
- pr: 'paddingRight',
18
- px: 'paddingLeft',
19
- py: 'paddingTop',
20
- p: 'padding',
21
- w: 'width',
22
- h: 'height',
23
- minW: 'minWidth',
24
- minH: 'minHeight',
25
- maxW: 'maxWidth',
26
- maxH: 'maxHeight',
27
- gap: 'gap',
28
- rounded: 'borderRadius',
29
- top: 'top',
30
- left: 'left',
31
- right: 'right',
32
- bottom: 'bottom',
33
- color: 'color',
34
- bg: 'background',
35
- scale: 'transform',
36
- outline: 'outline',
37
- opacity: 'opacity',
38
- flex: 'flex',
39
- display: 'display',
40
- } as const satisfies Record<string, string>;
41
-
42
- export type StyleShorthandKey = keyof typeof SHORTHAND_MAP;
43
-
44
- const SHORTHAND_SET = new Set<string>(Object.keys(SHORTHAND_MAP));
45
-
46
- export function isStyleKey(key: string): boolean {
47
- return key.startsWith('--') || SHORTHAND_SET.has(key);
48
- }
49
-
50
- export function getStyleProp(key: string): string | undefined {
51
- if (key.startsWith('--')) return key;
52
- return key in SHORTHAND_MAP ? SHORTHAND_MAP[key as StyleShorthandKey] : undefined;
53
- }
54
-
55
- /** Numero → "Npx", altrimenti stringa. Token "primary" → var(--color-primary) se in tokens. (scale gestito in resolve.) */
56
- export function toStyleValue(v: unknown, tokens?: Set<string>): string {
57
- if (v == null) return '';
58
- if (typeof v === 'number') return `${v}px`;
59
- const s = String(v);
60
- if (tokens && tokens.has(s)) return `var(--color-${s})`;
61
- return s;
62
- }
@@ -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,12 +0,0 @@
1
- node_modules
2
- dist
3
- .git
4
- *.local
5
- .env
6
- .env.*
7
- *.tsbuildinfo
8
- .oxlintrc.json
9
- .oxfmtrc.json
10
- .cursor
11
- packages/style/extension/out
12
- *.vsix
@@ -1,7 +0,0 @@
1
- {
2
- "printWidth": 100,
3
- "semi": true,
4
- "singleQuote": true,
5
- "trailingComma": "es5",
6
- "ignorePatterns": ["node_modules/**", "dist/**", "bun.lockb", "**/node_modules/**"]
7
- }
@@ -1,13 +0,0 @@
1
- {
2
- "ignorePatterns": [
3
- "node_modules/**",
4
- "dist/**",
5
- "**/node_modules/**",
6
- "*.config.js",
7
- "*.config.ts"
8
- ],
9
- "rules": {
10
- "unicorn/no-empty-file": "off",
11
- "@typescript-eslint/triple-slash-reference": "off"
12
- }
13
- }
@@ -1,12 +0,0 @@
1
- {
2
- "files.exclude": {
3
- "index.html": true,
4
- "**/node_modules": true,
5
- "bun.lock": true,
6
- "**/tsconfig.json": true,
7
- "**/tsconfig.tsbuildinfo": true,
8
- ".oxlintrc.json": true,
9
- ".oxfmtrc.json": true
10
- },
11
- "editor.colorDecorators": true
12
- }
@@ -1,26 +0,0 @@
1
- # DEV: packages/core → workaround Bun workspace (doppio install).
2
- # PROD: install → build → start (PORT da env)
3
-
4
- FROM oven/bun:1 AS builder
5
- WORKDIR /app
6
- COPY . .
7
- RUN if [ -d packages ] && [ -f packages/core/package.json ]; then \
8
- bun install || true && bun install; \
9
- else \
10
- bun install --frozen-lockfile; \
11
- fi
12
- RUN bun run build
13
- RUN mkdir -p out && cp package.json bun.lock* out/ && cp -r dist server out/ && ([ -d packages ] && cp -r packages out/ || true)
14
-
15
- FROM oven/bun:1
16
- WORKDIR /app
17
- ENV NODE_ENV=production
18
- ENV PORT=3000
19
- COPY --from=builder /app/out/ ./
20
- RUN if [ -d packages ] && [ -f packages/core/package.json ]; then \
21
- bun install --frozen-lockfile --production || true && bun install --frozen-lockfile --production; \
22
- else \
23
- bun install --frozen-lockfile --production; \
24
- fi
25
- EXPOSE 3000
26
- CMD ["bun", "run", "start"]
@@ -1,34 +0,0 @@
1
- # Flow OS
2
-
3
- Tutti i comandi dalla **root** del repo.
4
-
5
- ---
6
-
7
- ## Dev (sviluppo e canale dev)
8
-
9
- | Comando | Cosa fa |
10
- |---------|---------|
11
- | `bun run dev` | Avvia il server di sviluppo (client + server). |
12
- | `bun run gen` | Rigenera i template (profiles + packages in create-flow). Di solito non serve: lo fa già `publish:dev`. |
13
- | `bun run publish:dev` | Esegue **gen** + **build** create-flow e pubblica tutto su npm con tag **dev**. |
14
-
15
- **Pubblicare solo un package** (più veloce):
16
-
17
- ```bash
18
- bun run publish:dev -- --client
19
- ```
20
-
21
- (Stesso comando con `--style`, `--core`, `--router`, `--server` al posto di `--client`.)
22
-
23
- ---
24
-
25
- ## Prod (release su latest)
26
-
27
- | Comando | Cosa fa |
28
- |---------|---------|
29
- | `bun run version -- <patch|minor|major|X.Y.Z>` | Aggiorna la versione nei package. Es.: `patch` per tutti, oppure `bun run version -- 1.0.0` per impostare tutti a 1.0.0. |
30
- | `bun run version -- patch @flow.os/client create-flow-os` | Aggiorna solo i package indicati. |
31
- | `bun run release` | Pubblica su npm con tag **latest**. Va usato **dopo** aver lanciato `version`. |
32
- | `bun run release -- @flow.os/client create-flow-os` | Pubblica solo i package indicati. |
33
-
34
- **Ordine per una release prod:** prima `bun run version -- patch` (o minor/major), poi `bun run release`.