Skip to content

Commit

Permalink
Add new template for scss modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank1513 committed Apr 9, 2024
1 parent f5230d2 commit 9d06332
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 6 deletions.
22 changes: 17 additions & 5 deletions .tkb
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,19 @@
"id": "3Jpxwcb60dUx093hDLZ6F",
"description": "Add script to remove remix example and add sass \n- add keep-remix option",
"columnId": "column-todo"
},
"iXE3kCY0L1r_4TD-zRgVh": {
"id": "iXE3kCY0L1r_4TD-zRgVh",
"description": "React Loaders\n- improve step by step --- incremental improvements\n- Purposes\n-- Provide a good demo - demonstrating the full potential of the setup\n-- Give learners opportunity to contribute to open source",
"columnId": "column-rHWkySHomUOsd93fyS05p"
}
},
"columns": [
{
"id": "column-todo",
"title": "To do",
"id": "column-rHWkySHomUOsd93fyS05p",
"title": "To do ",
"tasksIds": [
"uUjYvxGR0oOu3Q1iJQler",
"MfiZXiLbzHnZ3GSE4SVe8",
"3Jpxwcb60dUx093hDLZ6F"
"iXE3kCY0L1r_4TD-zRgVh"
]
},
{
Expand All @@ -55,6 +58,15 @@
"id": "column-S6UGsrZqn5uTUGxNq5qGJ",
"title": "Will not do",
"tasksIds": []
},
{
"id": "column-todo",
"title": "Archive",
"tasksIds": [
"uUjYvxGR0oOu3Q1iJQler",
"MfiZXiLbzHnZ3GSE4SVe8",
"3Jpxwcb60dUx093hDLZ6F"
]
}
]
}
1 change: 1 addition & 0 deletions lib/fork-me/src/declaration.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
declare module "*.module.css";
declare module "*.module.scss";
5 changes: 5 additions & 0 deletions lib/fork-me/turbo/generators/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ function getActions(data: InquirerDataType) {
path: `${root}{{kebabCase name}}/{{kebabCase name}}.test.tsx`,
templateFile: "templates/component.test.hbs",
},
{
type: "add",
path: `${root}{{kebabCase name}}/{{kebabCase name}}.module.scss`,
templateFile: "templates/component.module.hbs",
},
{
type: "append",
path: `${root}index.ts`,
Expand Down
3 changes: 2 additions & 1 deletion lib/fork-me/turbo/generators/templates/component.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from "react";
import styles from "./{{ kebabCase name }}.module.scss";

interface {{ pascalCase name }}Props {
children?: React.ReactNode;
Expand All @@ -10,7 +11,7 @@ interface {{ pascalCase name }}Props {
*/
export function {{ pascalCase name }}({ children }: {{ pascalCase name }}Props) {
return (
<div>
<div className={styles.container}>
<h1 data-testid="{{ kebabCase name }}-h1">{{ name }}</h1>
{children}
</div>
Expand Down
3 changes: 3 additions & 0 deletions lib/fork-me/turbo/generators/templates/component.module.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.container {
/* create your container styles here */
}

0 comments on commit 9d06332

Please sign in to comment.