Skip to content

Commit

Permalink
Removed acme
Browse files Browse the repository at this point in the history
  • Loading branch information
williamlmao committed Jan 6, 2023
1 parent 8d874ce commit 5e8b652
Show file tree
Hide file tree
Showing 37 changed files with 1,770 additions and 1,344 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"linked": [],
"access": "public",
"updateInternalDependencies": "patch",
"ignore": ["@acme/docs"]
"ignore": ["docs"]
}
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
root: true,
// This tells ESLint to load the config from the package `eslint-config-acme`
extends: ["acme"],
// This tells ESLint to load the config from the package `eslint-config-chimera`
extends: ["chimera"],
settings: {
next: {
rootDir: ["apps/*/"],
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ Using Turborepo simplifes managing your design system monorepo, as you can have
This Turborepo includes the following packages and applications:

- `apps/docs`: Component documentation site with Storybook
- `packages/@acme/core`: Core React components
- `packages/@acme/utils`: Shared React utilities
- `packages/@acme/tsconfig`: Shared `tsconfig.json`s used throughout the Turborepo
- `packages/eslint-config-acme`: ESLint preset
- `packages/core`: Core React components
- `packages/utils`: Shared React utilities
- `packages/tsconfig`: Shared `tsconfig.json`s used throughout the Turborepo
- `packages/eslint-config-chimera`: ESLint preset

Each package and app is 100% [TypeScript](https://www.typescriptlang.org/). Workspaces enables us to "hoist" dependencies that are shared between packages to the root `package.json`. This means smaller `node_modules` folders and a better local dev experience. To install a dependency for the entire monorepo, use the `-w` workspaces flag with `pnpm add`.

Expand All @@ -70,7 +70,7 @@ tsup src/index.tsx --format esm,cjs --dts --external react

```json:acme-core/package.json
{
"name": "@acme/core",
"name": "core",
"version": "0.0.0",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
root: true,
extends: ["acme"],
extends: ["chimera"],
};
7 changes: 2 additions & 5 deletions apps/docs/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ module.exports = {
resolve: {
alias: [
{
find: "@acme/core",
replacement: path.resolve(
__dirname,
"../../../packages/acme-core/"
),
find: "core",
replacement: path.resolve(__dirname, "../../../packages/ui/"),
},
],
},
Expand Down
8 changes: 4 additions & 4 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@acme/docs",
"name": "docs",
"version": "0.0.0",
"private": true,
"scripts": {
Expand All @@ -9,20 +9,20 @@
"clean": "rm -rf .turbo && rm -rf node_modules"
},
"dependencies": {
"@acme/core": "workspace:0.0.0",
"chimera-tw": "workspace:0.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@acme/tsconfig": "workspace:0.0.0",
"tsconfig": "workspace:0.0.0",
"@storybook/addon-actions": "^6.5.14",
"@storybook/addon-docs": "^6.5.14",
"@storybook/addon-essentials": "^6.5.14",
"@storybook/addon-links": "^6.5.14",
"@storybook/builder-vite": "^0.1.41",
"@storybook/react": "^6.5.14",
"@vitejs/plugin-react": "^1.3.2",
"eslint-config-acme": "workspace:0.0.0",
"eslint-config-chimera": "workspace:0.0.0",
"serve": "^13.0.4",
"typescript": "^4.9.3",
"vite": "^2.9.15"
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/stories/button.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button } from "@acme/core/src";
import { Button } from "core/src";
import { Meta, Story, Canvas, ArgsTable } from "@storybook/addon-docs";

<Meta title="Components/Button" component={Button} />
Expand Down
4 changes: 4 additions & 0 deletions apps/web/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: ["eslint-config-chimera"],
};
30 changes: 30 additions & 0 deletions apps/web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Getting Started

First, run the development server:

```bash
yarn dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn/foundations/about-nextjs) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
5 changes: 5 additions & 0 deletions apps/web/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
6 changes: 6 additions & 0 deletions apps/web/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
reactStrictMode: true,
experimental: {
transpilePackages: ["ui"],
},
};
27 changes: 27 additions & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "web",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"next": "13.0.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"chimera-tw": "workspace:*"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"eslint-config-chimera": "workspace:*",
"eslint": "7.32.0",
"tsconfig": "workspace:*",
"@types/node": "^17.0.12",
"@types/react": "^18.0.22",
"@types/react-dom": "^18.0.7",
"typescript": "^4.5.3"
}
}
9 changes: 9 additions & 0 deletions apps/web/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// import { Button } from "core";

export default function Web() {
return (
<div>
<h1>Web</h1>
</div>
);
}
5 changes: 5 additions & 0 deletions apps/web/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "tsconfig/nextjs.json",
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"build": "turbo run build",
"dev": "turbo run dev --no-cache --parallel --continue",
"lint": "turbo run lint",
"web": "turbo run dev --filter",
"clean": "turbo run clean && rm -rf node_modules",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"changeset": "changeset",
Expand All @@ -13,9 +14,9 @@
"devDependencies": {
"@changesets/cli": "^2.25.2",
"eslint": "^8.29.0",
"eslint-config-acme": "workspace:0.0.0",
"eslint-config-chimera": "workspace:0.0.0",
"prettier": "^2.8.0",
"turbo": "latest"
"turbo": "^1.6.3"
},
"packageManager": "[email protected]"
}
5 changes: 0 additions & 5 deletions packages/acme-core/tsconfig.json

This file was deleted.

9 changes: 0 additions & 9 deletions packages/acme-tsconfig/package.json

This file was deleted.

4 changes: 0 additions & 4 deletions packages/acme-utils/.eslintrc.js

This file was deleted.

31 changes: 0 additions & 31 deletions packages/acme-utils/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions packages/acme-utils/src/index.tsx

This file was deleted.

18 changes: 0 additions & 18 deletions packages/acme-utils/src/toSlug.ts

This file was deleted.

13 changes: 0 additions & 13 deletions packages/acme-utils/src/useIsomorphicLayoutEffect.tsx

This file was deleted.

17 changes: 0 additions & 17 deletions packages/acme-utils/src/usePrevious.tsx

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "eslint-config-acme",
"name": "eslint-config-chimera",
"version": "0.0.0",
"main": "index.js",
"license": "MIT",
Expand Down
File renamed without changes.
22 changes: 22 additions & 0 deletions packages/tsconfig/nextjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Next.js",
"extends": "./base.json",
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"incremental": true,
"esModuleInterop": true,
"module": "esnext",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
},
"include": ["src", "next-env.d.ts"],
"exclude": ["node_modules"]
}
File renamed without changes.
11 changes: 11 additions & 0 deletions packages/tsconfig/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "tsconfig",
"version": "0.0.0",
"private": true,
"files": [
"base.json",
"nextjs.json",
"react-library.json",
"nextjs.json"
]
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
root: true,
extends: ["acme"],
extends: ["chimera"],
};
6 changes: 3 additions & 3 deletions packages/acme-core/package.json → packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@acme/core",
"name": "chimera-tw",
"version": "0.0.0",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand All @@ -16,11 +16,11 @@
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
},
"devDependencies": {
"@acme/tsconfig": "workspace:*",
"tsconfig": "workspace:*",
"@types/react": "^18.0.9",
"@types/react-dom": "^18.0.4",
"eslint": "^8.15.0",
"eslint-config-acme": "workspace:*",
"eslint-config-chimera": "workspace:*",
"react": "^18.1.0",
"tsup": "^5.10.1",
"typescript": "^4.5.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface ButtonProps {
}

export function Button(props: ButtonProps) {
return <button>{props.children}</button>;
return <button>{props.children} hi</button>;
}

Button.displayName = "Button";
File renamed without changes.
Loading

1 comment on commit 5e8b652

@vercel
Copy link

@vercel vercel bot commented on 5e8b652 Jan 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.