@devrune/cli 1.0.2 → 1.0.4
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/generate-feature.js
CHANGED
|
@@ -37,7 +37,7 @@ async function main() {
|
|
|
37
37
|
ensureDir(node_path_1.default.join(ROOT_DIR_PATH, name, constants_1.API_DIR));
|
|
38
38
|
node_fs_1.default.writeFileSync(node_path_1.default.join(ROOT_DIR_PATH, name, constants_1.API_DIR, `${name}.api.ts`), `// export const ${toCamelCase(`${name}Api`)} = {}`);
|
|
39
39
|
ensureDir(node_path_1.default.join(ROOT_DIR_PATH, name, constants_1.UI_DIR));
|
|
40
|
-
node_fs_1.default.writeFileSync(node_path_1.default.join(ROOT_DIR_PATH, name, constants_1.UI_DIR, `${name}.ui.
|
|
40
|
+
node_fs_1.default.writeFileSync(node_path_1.default.join(ROOT_DIR_PATH, name, constants_1.UI_DIR, `${name}.ui.tsx`), `import type { ${toPascalCase(name)}Props } from '../types/${name}.type';\n\nexport const ${toPascalCase(name)} = ({}: ${toPascalCase(name)}Props) => { \n return null;\n};`);
|
|
41
41
|
ensureDir(node_path_1.default.join(ROOT_DIR_PATH, name, constants_1.HOOKS_DIR));
|
|
42
42
|
node_fs_1.default.writeFileSync(node_path_1.default.join(ROOT_DIR_PATH, name, constants_1.HOOKS_DIR, `use-${name}.hook.ts`), `// export const ${toCamelCase(`use${toPascalCase(name)}`)} = () => {}`);
|
|
43
43
|
ensureDir(node_path_1.default.join(ROOT_DIR_PATH, name, constants_1.UTILS_DIR));
|
|
@@ -45,7 +45,7 @@ async function main() {
|
|
|
45
45
|
ensureDir(node_path_1.default.join(ROOT_DIR_PATH, name, constants_1.TYPES_DIR));
|
|
46
46
|
node_fs_1.default.writeFileSync(node_path_1.default.join(ROOT_DIR_PATH, name, constants_1.TYPES_DIR, `${name}.type.ts`), `// export type ${toPascalCase(name)}ModalProps = {};\nexport type ${toPascalCase(name)}Props = {};`);
|
|
47
47
|
ensureDir(node_path_1.default.join(ROOT_DIR_PATH, name, constants_1.MODALS_DIR));
|
|
48
|
-
node_fs_1.default.writeFileSync(node_path_1.default.join(ROOT_DIR_PATH, name, constants_1.MODALS_DIR, `${name}.modal.
|
|
48
|
+
node_fs_1.default.writeFileSync(node_path_1.default.join(ROOT_DIR_PATH, name, constants_1.MODALS_DIR, `${name}.modal.tsx`), `// import type { ${toPascalCase(name)}ModalProps } from '../types/${name}.type';\n\n// export const ${toPascalCase(name)}Modal = ({}: ${toPascalCase(name)}ModalProps) => {\n// return null;\n// };`);
|
|
49
49
|
}
|
|
50
50
|
main()
|
|
51
51
|
.catch((e) => {
|
package/package.json
CHANGED
|
@@ -46,7 +46,7 @@ async function main() {
|
|
|
46
46
|
ensureDir(path.join(ROOT_DIR_PATH, name, API_DIR));
|
|
47
47
|
fs.writeFileSync(path.join(ROOT_DIR_PATH, name, API_DIR, `${name}.api.ts`), `// export const ${toCamelCase(`${name}Api`)} = {}`);
|
|
48
48
|
ensureDir(path.join(ROOT_DIR_PATH, name, UI_DIR));
|
|
49
|
-
fs.writeFileSync(path.join(ROOT_DIR_PATH, name, UI_DIR, `${name}.ui.
|
|
49
|
+
fs.writeFileSync(path.join(ROOT_DIR_PATH, name, UI_DIR, `${name}.ui.tsx`), `import type { ${toPascalCase(name)}Props } from '../types/${name}.type';\n\nexport const ${toPascalCase(name)} = ({}: ${toPascalCase(name)}Props) => { \n return null;\n};`);
|
|
50
50
|
ensureDir(path.join(ROOT_DIR_PATH, name, HOOKS_DIR));
|
|
51
51
|
fs.writeFileSync(path.join(ROOT_DIR_PATH, name, HOOKS_DIR, `use-${name}.hook.ts`), `// export const ${toCamelCase(`use${toPascalCase(name)}`)} = () => {}`);
|
|
52
52
|
ensureDir(path.join(ROOT_DIR_PATH, name, UTILS_DIR));
|
|
@@ -54,7 +54,7 @@ async function main() {
|
|
|
54
54
|
ensureDir(path.join(ROOT_DIR_PATH, name, TYPES_DIR));
|
|
55
55
|
fs.writeFileSync(path.join(ROOT_DIR_PATH, name, TYPES_DIR, `${name}.type.ts`), `// export type ${toPascalCase(name)}ModalProps = {};\nexport type ${toPascalCase(name)}Props = {};`);
|
|
56
56
|
ensureDir(path.join(ROOT_DIR_PATH, name, MODALS_DIR));
|
|
57
|
-
fs.writeFileSync(path.join(ROOT_DIR_PATH, name, MODALS_DIR, `${name}.modal.
|
|
57
|
+
fs.writeFileSync(path.join(ROOT_DIR_PATH, name, MODALS_DIR, `${name}.modal.tsx`), `// import type { ${toPascalCase(name)}ModalProps } from '../types/${name}.type';\n\n// export const ${toPascalCase(name)}Modal = ({}: ${toPascalCase(name)}ModalProps) => {\n// return null;\n// };`);
|
|
58
58
|
|
|
59
59
|
}
|
|
60
60
|
|