This repository has been archived by the owner on Feb 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #304 from suzuka-kosen-festa/dev
v2.0.0-rc
- Loading branch information
Showing
229 changed files
with
6,675 additions
and
2,005 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,6 @@ on: | |
paths: | ||
- src/components/** | ||
- src/stories/** | ||
- package.json | ||
- yarn.lock | ||
|
||
jobs: | ||
run-chromatic-test: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -338,10 +338,6 @@ Cargo.lock | |
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
|
||
# Thumbnails | ||
._* | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
templates: `${__dirname}/.hygen`, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
to: "<%= have_props ? `${abs_path}/types/model.ts` : null %>" | ||
--- | ||
export type <%= upper_component_name %>Properties = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
to: <%= abs_path %>/<%= component_name %>.stories.tsx | ||
--- | ||
import type { ComponentStoryObj, ComponentMeta } from "@storybook/react"; | ||
import { ComponentPropsWithoutRef } from 'react'; | ||
import { <%= upper_component_name %> } from "."; | ||
|
||
type T = typeof <%= upper_component_name %>; | ||
type Story = ComponentStoryObj<T>; | ||
type Meta = ComponentMeta<T>; | ||
|
||
const args: ComponentPropsWithoutRef<T> = {}; | ||
|
||
export default { | ||
args, | ||
argTypes: {}, | ||
component: <%= upper_component_name %>, | ||
} as Meta; | ||
|
||
export const Default: Story = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
to: <%= abs_path %>/<%= component_name %>.test.tsx | ||
--- | ||
import { composeStories } from "@storybook/testing-react"; | ||
import "@testing-library/jest-dom"; | ||
import { render } from "@testing-library/react"; | ||
import * as stories from "./<%= component_name %>.stories"; | ||
|
||
const { Default } = composeStories(stories); | ||
|
||
describe("(components) <%= category %>/<%= component_name %>", () => { | ||
test("take snap shot", () => { | ||
const { container } = render(<Default />); | ||
expect(container).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
to: <%= abs_path %>/index.tsx | ||
--- | ||
import type { FC } from "react"; | ||
import tw from "twin.macro"; | ||
<% if (have_props) { -%> | ||
import type { <%= upper_component_name %>Properties } from "./types/model"; | ||
<% } -%> | ||
|
||
const <%= upper_component_name %>:<% if (have_props) { -%> FC<<%= upper_component_name %>Properties> <% } else { -%> FC <% } -%>= <%= props %> => ( | ||
<div></div> | ||
); | ||
|
||
export { <%= upper_component_name %> }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* | ||
* @param {string} text | ||
* @return {string} | ||
*/ | ||
function clearAndUpper(text) { | ||
return text.replace(/-/, "").toUpperCase(); | ||
} | ||
|
||
/** | ||
* | ||
* npm run new:fc | ||
*/ | ||
module.exports = { | ||
prompt: ({ inquirer }) => { | ||
const questions = [ | ||
{ | ||
type: "select", | ||
name: "category", | ||
message: "Which Atomic Design category?", | ||
choices: ["atoms", "molecules", "organisms", "templates"], | ||
}, | ||
{ | ||
type: "input", | ||
name: "component_name", | ||
message: "What is the name of component?", | ||
}, | ||
{ | ||
type: "input", | ||
name: "dir", | ||
message: "Where is the directory? (No problem in blank)", | ||
}, | ||
{ | ||
type: "confirm", | ||
name: "have_props", | ||
message: "Is it have props?", | ||
}, | ||
]; | ||
return inquirer.prompt(questions).then(answers => { | ||
const { category, component_name, dir, have_props } = answers; | ||
const path = `${category}/${dir ? `${dir}/` : ``}${component_name}`; | ||
const abs_path = `src/components/${path}`; | ||
const upper_component_name = component_name.replace(/(^\w|-\w)/g, clearAndUpper); | ||
const props = have_props ? "({})" : "()"; | ||
return { ...answers, path, abs_path, upper_component_name, props }; | ||
}); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<div id="portal"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
nodeLinker: node-modules | ||
|
||
yarnPath: .yarn/releases/yarn-3.2.3.cjs | ||
yarnPath: .yarn/releases/yarn-3.2.4.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.