create-flexireact 4.0.0 → 4.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/dist/templates/default.d.ts +3 -1
- package/dist/templates/default.d.ts.map +1 -1
- package/dist/templates/default.js +200 -160
- package/dist/templates/default.js.map +1 -1
- package/dist/templates/fullstack.d.ts +5 -0
- package/dist/templates/fullstack.d.ts.map +1 -0
- package/dist/templates/fullstack.js +606 -0
- package/dist/templates/fullstack.js.map +1 -0
- package/dist/templates/index.d.ts +4 -4
- package/dist/templates/index.d.ts.map +1 -1
- package/dist/templates/index.js +13 -8
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/minimal.d.ts +3 -1
- package/dist/templates/minimal.d.ts.map +1 -1
- package/dist/templates/minimal.js +42 -10
- package/dist/templates/minimal.js.map +1 -1
- package/package.json +1 -1
package/dist/templates/index.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Template definitions for create-flexireact
|
|
3
|
-
*/
|
|
4
1
|
import { defaultTemplate } from './default.js';
|
|
5
2
|
import { minimalTemplate } from './minimal.js';
|
|
6
3
|
import { appRouterTemplate } from './app-router.js';
|
|
4
|
+
import { fullstackTemplate } from './fullstack.js';
|
|
7
5
|
export const TEMPLATES = {
|
|
8
6
|
default: {
|
|
9
7
|
name: 'Default',
|
|
10
|
-
description: 'Full-featured template with
|
|
8
|
+
description: 'Full-featured template with routing and components',
|
|
11
9
|
icon: '⚡',
|
|
12
10
|
},
|
|
11
|
+
fullstack: {
|
|
12
|
+
name: 'Fullstack App',
|
|
13
|
+
description: 'Includes FlexiGuard Auth, Drizzle ORM, and API',
|
|
14
|
+
icon: '🚀',
|
|
15
|
+
},
|
|
13
16
|
minimal: {
|
|
14
17
|
name: 'Minimal',
|
|
15
18
|
description: 'Bare minimum FlexiReact setup',
|
|
@@ -18,17 +21,19 @@ export const TEMPLATES = {
|
|
|
18
21
|
'app-router': {
|
|
19
22
|
name: 'App Router',
|
|
20
23
|
description: 'Next.js style app/ directory routing',
|
|
21
|
-
icon: '
|
|
24
|
+
icon: '📂',
|
|
22
25
|
},
|
|
23
26
|
};
|
|
24
|
-
export function getTemplateFiles(templateKey, projectName) {
|
|
27
|
+
export function getTemplateFiles(templateKey, projectName, options = {}) {
|
|
25
28
|
switch (templateKey) {
|
|
29
|
+
case 'fullstack':
|
|
30
|
+
return fullstackTemplate(projectName, options);
|
|
26
31
|
case 'minimal':
|
|
27
|
-
return minimalTemplate(projectName);
|
|
32
|
+
return minimalTemplate(projectName, options);
|
|
28
33
|
case 'app-router':
|
|
29
34
|
return appRouterTemplate(projectName);
|
|
30
35
|
default:
|
|
31
|
-
return defaultTemplate(projectName);
|
|
36
|
+
return defaultTemplate(projectName, options);
|
|
32
37
|
}
|
|
33
38
|
}
|
|
34
39
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAQnD,MAAM,CAAC,MAAM,SAAS,GAA6B;IACjD,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,oDAAoD;QACjE,IAAI,EAAE,GAAG;KACV;IACD,SAAS,EAAE;QACT,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,gDAAgD;QAC7D,IAAI,EAAE,IAAI;KACX;IACD,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,+BAA+B;QAC5C,IAAI,EAAE,IAAI;KACX;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,sCAAsC;QACnD,IAAI,EAAE,IAAI;KACX;CACF,CAAC;AAQF,MAAM,UAAU,gBAAgB,CAAC,WAAmB,EAAE,WAAmB,EAAE,UAA2B,EAAE;IACtG,QAAQ,WAAW,EAAE,CAAC;QACpB,KAAK,WAAW;YACd,OAAO,iBAAiB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QACjD,KAAK,SAAS;YACZ,OAAO,eAAe,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAC/C,KAAK,YAAY;YACf,OAAO,iBAAiB,CAAC,WAAW,CAAC,CAAC;QACxC;YACE,OAAO,eAAe,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;AACH,CAAC"}
|
|
@@ -2,5 +2,7 @@
|
|
|
2
2
|
* Minimal Template - Bare minimum FlexiReact setup
|
|
3
3
|
*/
|
|
4
4
|
import type { TemplateFiles } from './index.js';
|
|
5
|
-
export declare function minimalTemplate(projectName: string
|
|
5
|
+
export declare function minimalTemplate(projectName: string, options?: {
|
|
6
|
+
styling?: 'tailwind' | 'css';
|
|
7
|
+
}): TemplateFiles;
|
|
6
8
|
//# sourceMappingURL=minimal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"minimal.d.ts","sourceRoot":"","sources":["../../src/templates/minimal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"minimal.d.ts","sourceRoot":"","sources":["../../src/templates/minimal.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,UAAU,GAAG,KAAK,CAAA;CAAO,GAAG,aAAa,CAyGlH"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Minimal Template - Bare minimum FlexiReact setup
|
|
3
3
|
*/
|
|
4
|
-
export function minimalTemplate(projectName) {
|
|
4
|
+
export function minimalTemplate(projectName, options = {}) {
|
|
5
|
+
const isTailwind = options.styling === 'tailwind';
|
|
5
6
|
return {
|
|
6
7
|
'package.json': JSON.stringify({
|
|
7
8
|
name: projectName,
|
|
@@ -9,19 +10,26 @@ export function minimalTemplate(projectName) {
|
|
|
9
10
|
private: true,
|
|
10
11
|
type: 'module',
|
|
11
12
|
scripts: {
|
|
12
|
-
dev: 'flexireact dev',
|
|
13
|
-
build: 'flexireact build',
|
|
13
|
+
dev: isTailwind ? 'npm run css && flexireact dev' : 'flexireact dev',
|
|
14
|
+
build: isTailwind ? 'npm run css && flexireact build' : 'flexireact build',
|
|
14
15
|
start: 'flexireact start',
|
|
16
|
+
...(isTailwind ? { css: 'tailwindcss -i ./styles.css -o ./public/styles.css --minify' } : {}),
|
|
15
17
|
},
|
|
16
18
|
dependencies: {
|
|
17
|
-
react: '^
|
|
18
|
-
'react-dom': '^
|
|
19
|
-
'@flexireact/core': '^
|
|
19
|
+
react: '^19.0.0',
|
|
20
|
+
'react-dom': '^19.0.0',
|
|
21
|
+
'@flexireact/core': '^4.0.0',
|
|
22
|
+
...(isTailwind ? { 'clsx': '^2.1.0', 'tailwind-merge': '^2.2.0' } : {}),
|
|
20
23
|
},
|
|
21
24
|
devDependencies: {
|
|
22
|
-
'@types/react': '^
|
|
23
|
-
'@types/react-dom': '^
|
|
25
|
+
'@types/react': '^19.0.0',
|
|
26
|
+
'@types/react-dom': '^19.0.0',
|
|
24
27
|
typescript: '^5.3.0',
|
|
28
|
+
...(isTailwind ? {
|
|
29
|
+
tailwindcss: '^4.0.0',
|
|
30
|
+
'@tailwindcss/cli': '^4.0.0',
|
|
31
|
+
'@tailwindcss/postcss': '^4.0.0',
|
|
32
|
+
} : {}),
|
|
25
33
|
},
|
|
26
34
|
}, null, 2),
|
|
27
35
|
'tsconfig.json': JSON.stringify({
|
|
@@ -41,11 +49,34 @@ export function minimalTemplate(projectName) {
|
|
|
41
49
|
include: ['**/*.ts', '**/*.tsx'],
|
|
42
50
|
exclude: ['node_modules', '.flexi'],
|
|
43
51
|
}, null, 2),
|
|
52
|
+
...(isTailwind ? {
|
|
53
|
+
'postcss.config.js': `export default {
|
|
54
|
+
plugins: {
|
|
55
|
+
"@tailwindcss/postcss": {},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
`,
|
|
59
|
+
'styles.css': `@import "tailwindcss";`,
|
|
60
|
+
} : {}),
|
|
44
61
|
'flexireact.config.js': `export default {
|
|
45
|
-
server: { port: 3000 }
|
|
62
|
+
server: { port: 3000 }${isTailwind ? ',\n styles: ["/styles.css"]' : ''}
|
|
46
63
|
};
|
|
47
64
|
`,
|
|
48
|
-
'routes/(public)/home.tsx': `import React from 'react';
|
|
65
|
+
'routes/(public)/home.tsx': isTailwind ? `import React from 'react';
|
|
66
|
+
|
|
67
|
+
export default function HomePage() {
|
|
68
|
+
return (
|
|
69
|
+
<div className="min-h-screen flex flex-col items-center justify-center p-8 text-center font-sans">
|
|
70
|
+
<h1 className="text-4xl font-bold mb-4">
|
|
71
|
+
Welcome to FlexiReact
|
|
72
|
+
</h1>
|
|
73
|
+
<p className="text-gray-500">
|
|
74
|
+
Edit <code className="bg-gray-100 px-1 py-0.5 rounded">routes/(public)/home.tsx</code> to get started.
|
|
75
|
+
</p>
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
` : `import React from 'react';
|
|
49
80
|
|
|
50
81
|
export default function HomePage() {
|
|
51
82
|
return (
|
|
@@ -64,6 +95,7 @@ export default function HomePage() {
|
|
|
64
95
|
'.gitignore': `node_modules/
|
|
65
96
|
.flexi/
|
|
66
97
|
dist/
|
|
98
|
+
public/styles.css
|
|
67
99
|
*.log
|
|
68
100
|
`,
|
|
69
101
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"minimal.js","sourceRoot":"","sources":["../../src/templates/minimal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"minimal.js","sourceRoot":"","sources":["../../src/templates/minimal.ts"],"names":[],"mappings":"AACA;;GAEG;AAIH,MAAM,UAAU,eAAe,CAAC,WAAmB,EAAE,UAA4C,EAAE;IACjG,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,KAAK,UAAU,CAAC;IAElD,OAAO;QACL,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC;YAC7B,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC,gBAAgB;gBACpE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,kBAAkB;gBAC1E,KAAK,EAAE,kBAAkB;gBACzB,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,6DAA6D,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC9F;YACD,YAAY,EAAE;gBACZ,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,SAAS;gBACtB,kBAAkB,EAAE,QAAQ;gBAC5B,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACxE;YACD,eAAe,EAAE;gBACf,cAAc,EAAE,SAAS;gBACzB,kBAAkB,EAAE,SAAS;gBAC7B,UAAU,EAAE,QAAQ;gBACpB,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;oBACf,WAAW,EAAE,QAAQ;oBACrB,kBAAkB,EAAE,QAAQ;oBAC5B,sBAAsB,EAAE,QAAQ;iBACjC,CAAC,CAAC,CAAC,EAAE,CAA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