generated from abelflopes/lerna-monorepo-template
-
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.
refactor: isolate all components into separate packages
- Loading branch information
1 parent
b5468c6
commit ed052aa
Showing
167 changed files
with
1,094 additions
and
54 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Banner |
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 = { | ||
extends: "@rck/babel-config", | ||
}; |
File renamed without changes.
File renamed without changes.
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 @@ | ||
export { config as default } from "@rck/jest-config"; |
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,38 @@ | ||
{ | ||
"name": "@rck/banner", | ||
"private": false, | ||
"version": "1.0.0", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"/dist" | ||
], | ||
"homepage": "https://github.com/abelflopes/rck/tree/master/packages/components/banner#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/abelflopes/rck.git" | ||
}, | ||
"scripts": { | ||
"build": "NODE_ENV=production webpack", | ||
"test": "npx -y npm-run-all -s test:*", | ||
"test:unit": "jest --testPathPattern=\".unit.*\"", | ||
"test:snapshot": "jest --testPathPattern=\".snapshot.*\"", | ||
"test:snapshot:update": "jest --testPathPattern=\".snapshot.*\" -u" | ||
}, | ||
"devDependencies": { | ||
"@rck/babel-config": "^1.0.0", | ||
"@rck/jest-config": "^1.0.0", | ||
"@rck/typescript-config": "^1.0.0", | ||
"@rck/webpack-config": "^1.0.0", | ||
"@types/react": "^18.2.33" | ||
}, | ||
"peerDependencies": { | ||
"react": "^18.2.0" | ||
}, | ||
"dependencies": { | ||
"@rck/container": "^1.0.0", | ||
"@rck/overlay": "^1.0.0", | ||
"@rck/theme": "^1.0.0", | ||
"classnames": "^2.3.2" | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
packages/components/banner/specs/__snapshots__/index.snapshot.test.tsx.snap
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,19 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Snapshot Banner renders correctly 1`] = ` | ||
<div | ||
className="root" | ||
> | ||
<div | ||
className="root horizontal vertical big container" | ||
> | ||
Banner | ||
</div> | ||
<img | ||
className="image" | ||
/> | ||
<div | ||
className="root dark" | ||
/> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from "react"; | ||
import { Banner } from "../src/index"; | ||
import renderer from "react-test-renderer"; | ||
|
||
describe("Snapshot Banner", () => { | ||
test("renders correctly", async () => { | ||
const tree = renderer.create(<Banner>Banner</Banner>).toJSON(); | ||
expect(tree).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,13 @@ | ||
import React from "react"; | ||
import { Banner } from "../src/index"; | ||
import { render, screen } from "@testing-library/react"; | ||
import "@testing-library/jest-dom"; | ||
|
||
describe("Unit Banner", () => { | ||
test("renders correctly", async () => { | ||
const content = "Banner"; | ||
render(<Banner>{content}</Banner>); | ||
const find = await screen.findByText(content); | ||
expect(find).toBeInTheDocument(); | ||
}); | ||
}); |
4 changes: 2 additions & 2 deletions
4
packages/components/all/src/banner/index.tsx → packages/components/banner/src/index.tsx
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
2 changes: 1 addition & 1 deletion
2
packages/components/button/specs/__snapshots__/index.snapshot.test.tsx.snap
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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
# Card |
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 = { | ||
extends: "@rck/babel-config", | ||
}; |
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 @@ | ||
declare module "*.module.scss" { | ||
const content: Record<string, string>; | ||
export default content; | ||
} |
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,2 @@ | ||
// Hack for module resolution of non built packages | ||
export * from "./src/index"; |
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 @@ | ||
export { config as default } from "@rck/jest-config"; |
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,36 @@ | ||
{ | ||
"name": "@rck/card", | ||
"private": false, | ||
"version": "1.0.0", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"/dist" | ||
], | ||
"homepage": "https://github.com/abelflopes/rck/tree/master/packages/components/card#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/abelflopes/rck.git" | ||
}, | ||
"scripts": { | ||
"build": "NODE_ENV=production webpack", | ||
"test": "npx -y npm-run-all -s test:*", | ||
"test:unit": "jest --testPathPattern=\".unit.*\"", | ||
"test:snapshot": "jest --testPathPattern=\".snapshot.*\"", | ||
"test:snapshot:update": "jest --testPathPattern=\".snapshot.*\" -u" | ||
}, | ||
"devDependencies": { | ||
"@rck/babel-config": "^1.0.0", | ||
"@rck/jest-config": "^1.0.0", | ||
"@rck/typescript-config": "^1.0.0", | ||
"@rck/webpack-config": "^1.0.0", | ||
"@types/react": "^18.2.33" | ||
}, | ||
"peerDependencies": { | ||
"react": "^18.2.0" | ||
}, | ||
"dependencies": { | ||
"@rck/theme": "^1.0.0", | ||
"classnames": "^2.3.2" | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/components/card/specs/__snapshots__/index.snapshot.test.tsx.snap
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,9 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Snapshot Card renders correctly 1`] = ` | ||
<div | ||
className="root" | ||
> | ||
Card | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from "react"; | ||
import { Card } from "../src/index"; | ||
import renderer from "react-test-renderer"; | ||
|
||
describe("Snapshot Card", () => { | ||
test("renders correctly", async () => { | ||
const tree = renderer.create(<Card>Card</Card>).toJSON(); | ||
expect(tree).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,13 @@ | ||
import React from "react"; | ||
import { Card } from "../src/index"; | ||
import { render, screen } from "@testing-library/react"; | ||
import "@testing-library/jest-dom"; | ||
|
||
describe("Unit Card", () => { | ||
test("renders correctly", async () => { | ||
const content = "Card"; | ||
render(<Card>{content}</Card>); | ||
const find = await screen.findByText(content); | ||
expect(find).toBeInTheDocument(); | ||
}); | ||
}); |
2 changes: 1 addition & 1 deletion
2
packages/components/all/src/card/index.tsx → packages/components/card/src/index.tsx
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
File renamed without changes.
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,7 @@ | ||
{ | ||
"extends": "@rck/typescript-config/tsconfig.build.json", | ||
"compilerOptions": { | ||
"outDir": "./dist" | ||
}, | ||
"include": ["./*.d.ts", "./src/**/*", "./src/index.ts*"] | ||
} |
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 @@ | ||
{ | ||
"extends": "@rck/typescript-config/tsconfig.json", | ||
"include": ["./**/*"] | ||
} |
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,6 @@ | ||
import { getWebpackConfig } from "@rck/webpack-config"; | ||
import packageJson from "./package.json"; | ||
|
||
export default getWebpackConfig({ | ||
cssHashSalt: packageJson.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 @@ | ||
# Chip |
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 = { | ||
extends: "@rck/babel-config", | ||
}; |
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 @@ | ||
declare module "*.module.scss" { | ||
const content: Record<string, string>; | ||
export default content; | ||
} |
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,2 @@ | ||
// Hack for module resolution of non built packages | ||
export * from "./src/index"; |
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 @@ | ||
export { config as default } from "@rck/jest-config"; |
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,36 @@ | ||
{ | ||
"name": "@rck/chip", | ||
"private": false, | ||
"version": "1.0.0", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"/dist" | ||
], | ||
"homepage": "https://github.com/abelflopes/rck/tree/master/packages/components/chip#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/abelflopes/rck.git" | ||
}, | ||
"scripts": { | ||
"build": "NODE_ENV=production webpack", | ||
"test": "npx -y npm-run-all -s test:*", | ||
"test:unit": "jest --testPathPattern=\".unit.*\"", | ||
"test:snapshot": "jest --testPathPattern=\".snapshot.*\"", | ||
"test:snapshot:update": "jest --testPathPattern=\".snapshot.*\" -u" | ||
}, | ||
"devDependencies": { | ||
"@rck/babel-config": "^1.0.0", | ||
"@rck/jest-config": "^1.0.0", | ||
"@rck/typescript-config": "^1.0.0", | ||
"@rck/webpack-config": "^1.0.0", | ||
"@types/react": "^18.2.33" | ||
}, | ||
"peerDependencies": { | ||
"react": "^18.2.0" | ||
}, | ||
"dependencies": { | ||
"@rck/theme": "^1.0.0", | ||
"classnames": "^2.3.2" | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/components/chip/specs/__snapshots__/index.snapshot.test.tsx.snap
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,9 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Snapshot Chip renders correctly 1`] = ` | ||
<div | ||
className="root" | ||
> | ||
Chip | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from "react"; | ||
import { Chip } from "../src/index"; | ||
import renderer from "react-test-renderer"; | ||
|
||
describe("Snapshot Chip", () => { | ||
test("renders correctly", async () => { | ||
const tree = renderer.create(<Chip>Chip</Chip>).toJSON(); | ||
expect(tree).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,13 @@ | ||
import React from "react"; | ||
import { Chip } from "../src/index"; | ||
import { render, screen } from "@testing-library/react"; | ||
import "@testing-library/jest-dom"; | ||
|
||
describe("Unit Chip", () => { | ||
test("renders correctly", async () => { | ||
const content = "Chip"; | ||
render(<Chip>{content}</Chip>); | ||
const find = await screen.findByText(content); | ||
expect(find).toBeInTheDocument(); | ||
}); | ||
}); |
2 changes: 1 addition & 1 deletion
2
packages/components/all/src/chip/index.tsx → packages/components/chip/src/index.tsx
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
File renamed without changes.
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,7 @@ | ||
{ | ||
"extends": "@rck/typescript-config/tsconfig.build.json", | ||
"compilerOptions": { | ||
"outDir": "./dist" | ||
}, | ||
"include": ["./*.d.ts", "./src/**/*", "./src/index.ts*"] | ||
} |
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 @@ | ||
{ | ||
"extends": "@rck/typescript-config/tsconfig.json", | ||
"include": ["./**/*"] | ||
} |
Oops, something went wrong.