handoff-app 1.0.4 → 1.0.5
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/Changelog.md +6 -0
- package/README.md +93 -57
- package/dist/cli.js +1 -1
- package/dist/commands/index.d.ts +1 -1
- package/dist/commands/index.js +2 -0
- package/dist/commands/init/index.d.ts +5 -0
- package/dist/commands/init/index.js +26 -0
- package/dist/create.d.ts +5 -0
- package/dist/create.js +293 -0
- package/package.json +1 -1
- package/src/cli.ts +1 -1
- package/src/commands/index.ts +2 -0
- package/src/commands/init/index.ts +17 -0
- package/src/create.ts +302 -0
- package/templates/default/README.md.tpl +15 -0
- package/templates/default/components/button/Button.tsx.tpl +92 -0
- package/templates/default/components/button/button.js.tpl +62 -0
- package/templates/default/env.tpl +2 -0
- package/templates/default/gitignore.tpl +7 -0
- package/templates/default/handoff.config.js.tpl +181 -0
- package/templates/default/handoff.config.with-examples.js.tpl +182 -0
- package/templates/default/package.json.tpl +20 -0
- package/templates/default/tsconfig.json.tpl +24 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/** @type {import('handoff-app').Config} */
|
|
5
|
+
module.exports = {
|
|
6
|
+
app: {
|
|
7
|
+
theme: "default",
|
|
8
|
+
title: "{{projectName}} Design System",
|
|
9
|
+
client: "{{projectName}}",
|
|
10
|
+
google_tag_manager: null,
|
|
11
|
+
attribution: true,
|
|
12
|
+
type_copy: "Almost before we knew it, we had left the ground.",
|
|
13
|
+
type_sort: [
|
|
14
|
+
"Heading 1",
|
|
15
|
+
"Heading 2",
|
|
16
|
+
"Heading 3",
|
|
17
|
+
"Heading 4",
|
|
18
|
+
"Heading 5",
|
|
19
|
+
"Heading 6",
|
|
20
|
+
"Paragraph",
|
|
21
|
+
"Subheading",
|
|
22
|
+
"Blockquote",
|
|
23
|
+
"Input Labels",
|
|
24
|
+
"Link"
|
|
25
|
+
],
|
|
26
|
+
color_sort: [
|
|
27
|
+
"primary",
|
|
28
|
+
"secondary",
|
|
29
|
+
"extra",
|
|
30
|
+
"system"
|
|
31
|
+
],
|
|
32
|
+
component_sort: [
|
|
33
|
+
"primary",
|
|
34
|
+
"secondary",
|
|
35
|
+
"transparent"
|
|
36
|
+
],
|
|
37
|
+
base_path: "",
|
|
38
|
+
breakpoints: {
|
|
39
|
+
sm: { size: 576, name: "Small" },
|
|
40
|
+
md: { size: 768, name: "Medium" },
|
|
41
|
+
lg: { size: 992, name: "Large" },
|
|
42
|
+
xl: { size: 1200, name: "Extra Large" }
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
entries: {
|
|
47
|
+
/**
|
|
48
|
+
* Array of component paths to be included in the build
|
|
49
|
+
* Add your component directories here
|
|
50
|
+
*/
|
|
51
|
+
components: ["components/button"]
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
hooks: {
|
|
55
|
+
/**
|
|
56
|
+
* Optional validation callback for components
|
|
57
|
+
* @param component - The component instance to validate
|
|
58
|
+
* @returns A record of validation results where keys are validation types and values are detailed validation results
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* validateComponent: async (component) => ({
|
|
62
|
+
* a11y: {
|
|
63
|
+
* description: 'Accessibility validation check',
|
|
64
|
+
* passed: true,
|
|
65
|
+
* messages: ['No accessibility issues found']
|
|
66
|
+
* },
|
|
67
|
+
* responsive: {
|
|
68
|
+
* description: 'Responsive design validation',
|
|
69
|
+
* passed: false,
|
|
70
|
+
* messages: ['Component breaks at mobile breakpoint']
|
|
71
|
+
* }
|
|
72
|
+
* })
|
|
73
|
+
*/
|
|
74
|
+
// validateComponent: async (component) => {
|
|
75
|
+
// // Add your custom validation logic here
|
|
76
|
+
// return {};
|
|
77
|
+
// },
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Optional hook to override the SSR build configuration used in the ssrRenderPlugin
|
|
81
|
+
* @param config - The default esbuild configuration
|
|
82
|
+
* @returns Modified esbuild configuration
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ssrBuildConfig: (config) => {
|
|
86
|
+
* // Modify the esbuild config as needed
|
|
87
|
+
* return config;
|
|
88
|
+
* }
|
|
89
|
+
*/
|
|
90
|
+
// ssrBuildConfig: (config) => {
|
|
91
|
+
// // Add your custom SSR build configuration here
|
|
92
|
+
// return config;
|
|
93
|
+
// },
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Optional hook to override the client-side build configuration used in the ssrRenderPlugin
|
|
97
|
+
* @param config - The default esbuild configuration
|
|
98
|
+
* @returns Modified esbuild configuration
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* clientBuildConfig: (config) => {
|
|
102
|
+
* // Modify the esbuild config as needed
|
|
103
|
+
* return config;
|
|
104
|
+
* }
|
|
105
|
+
*/
|
|
106
|
+
// clientBuildConfig: (config) => {
|
|
107
|
+
// // Add your custom client build configuration here
|
|
108
|
+
// return config;
|
|
109
|
+
// },
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Optional hook to specify which export property contains the schema
|
|
113
|
+
* @param exports - The module exports object containing the schema
|
|
114
|
+
* @returns The schema object from the exports
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* getSchemaFromExports: (exports) => exports.customSchema || exports.default
|
|
118
|
+
*/
|
|
119
|
+
// getSchemaFromExports: (exports) => {
|
|
120
|
+
// // Add your custom schema extraction logic here
|
|
121
|
+
// return exports.default;
|
|
122
|
+
// },
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Optional hook to transform the schema into properties
|
|
126
|
+
* @param schema - The schema object to transform
|
|
127
|
+
* @returns The transformed properties object
|
|
128
|
+
*/
|
|
129
|
+
// schemaToProperties: (schema) => {
|
|
130
|
+
// // Add your custom schema to properties transformation here
|
|
131
|
+
// return {};
|
|
132
|
+
// },
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Optional hook to override the JavaScript Vite configuration
|
|
136
|
+
* @param config - The default Vite configuration
|
|
137
|
+
* @returns Modified Vite configuration
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* jsBuildConfig: (config) => {
|
|
141
|
+
* // Modify the Vite config as needed
|
|
142
|
+
* return config;
|
|
143
|
+
* }
|
|
144
|
+
*/
|
|
145
|
+
// jsBuildConfig: (config) => {
|
|
146
|
+
// // Add your custom JavaScript build configuration here
|
|
147
|
+
// return config;
|
|
148
|
+
// },
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Optional hook to override the CSS Vite configuration
|
|
152
|
+
* @param config - The default Vite configuration
|
|
153
|
+
* @returns Modified Vite configuration
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* cssBuildConfig: (config) => {
|
|
157
|
+
* // Modify the Vite config as needed
|
|
158
|
+
* return config;
|
|
159
|
+
* }
|
|
160
|
+
*/
|
|
161
|
+
// cssBuildConfig: (config) => {
|
|
162
|
+
// // Add your custom CSS build configuration here
|
|
163
|
+
// return config;
|
|
164
|
+
// },
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Optional hook to override the HTML Vite configuration
|
|
168
|
+
* @param config - The default Vite configuration
|
|
169
|
+
* @returns Modified Vite configuration
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* htmlBuildConfig: (config) => {
|
|
173
|
+
* // Modify the Vite config as needed
|
|
174
|
+
* return config;
|
|
175
|
+
* }
|
|
176
|
+
*/
|
|
177
|
+
// htmlBuildConfig: (config) => {
|
|
178
|
+
// // Add your custom HTML build configuration here
|
|
179
|
+
// return config;
|
|
180
|
+
// },
|
|
181
|
+
},
|
|
182
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{projectName}}",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A handoff app project",
|
|
5
|
+
"private": true,
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "handoff-app start",
|
|
8
|
+
"dev": "handoff-app dev",
|
|
9
|
+
"build": "handoff-app build:app",
|
|
10
|
+
"fetch": "handoff-app fetch"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"handoff-app": "^1.0.1"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {},
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=16.0.0",
|
|
18
|
+
"npm": ">=8.0.0"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
5
|
+
"jsx": "react-jsx",
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"moduleResolution": "bundler",
|
|
8
|
+
"resolveJsonModule": true,
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
"strict": true,
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"forceConsistentCasingInFileNames": true,
|
|
14
|
+
"allowSyntheticDefaultImports": true,
|
|
15
|
+
"isolatedModules": true,
|
|
16
|
+
"noEmit": true
|
|
17
|
+
},
|
|
18
|
+
"include": [
|
|
19
|
+
"components/**/*"
|
|
20
|
+
],
|
|
21
|
+
"exclude": [
|
|
22
|
+
"node_modules"
|
|
23
|
+
]
|
|
24
|
+
}
|