From b1bf6b80a00ecd88f2ea6198e5e379d2c9971c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Tue, 16 Apr 2024 19:48:15 +0900 Subject: [PATCH] refactor: Rename `swc-plugin-registry` to `swc-plugins` (#40) --- swc-plugin-registry/package.json | 24 ------------ swc-plugin-registry/postcss.config.js | 6 --- .../.eslintrc.json | 0 .../.gitignore | 1 + swc-plugins/README.md | 36 ++++++++++++++++++ .../app/favicon.ico | Bin .../app/globals.css | 6 +++ .../app/layout.tsx | 6 +-- .../app/page.tsx | 24 ++++++------ .../next.config.mjs | 2 +- swc-plugins/package.json | 26 +++++++++++++ swc-plugins/postcss.config.mjs | 8 ++++ .../public/next.svg | 0 .../public/vercel.svg | 0 .../tailwind.config.ts | 0 .../tsconfig.json | 1 - 16 files changed, 93 insertions(+), 47 deletions(-) delete mode 100644 swc-plugin-registry/package.json delete mode 100644 swc-plugin-registry/postcss.config.js rename {swc-plugin-registry => swc-plugins}/.eslintrc.json (100%) rename {swc-plugin-registry => swc-plugins}/.gitignore (94%) create mode 100644 swc-plugins/README.md rename {swc-plugin-registry => swc-plugins}/app/favicon.ico (100%) rename {swc-plugin-registry => swc-plugins}/app/globals.css (88%) rename {swc-plugin-registry => swc-plugins}/app/layout.tsx (95%) rename {swc-plugin-registry => swc-plugins}/app/page.tsx (76%) rename swc-plugin-registry/next.config.js => swc-plugins/next.config.mjs (69%) create mode 100644 swc-plugins/package.json create mode 100644 swc-plugins/postcss.config.mjs rename {swc-plugin-registry => swc-plugins}/public/next.svg (100%) rename {swc-plugin-registry => swc-plugins}/public/vercel.svg (100%) rename {swc-plugin-registry => swc-plugins}/tailwind.config.ts (100%) rename {swc-plugin-registry => swc-plugins}/tsconfig.json (96%) diff --git a/swc-plugin-registry/package.json b/swc-plugin-registry/package.json deleted file mode 100644 index 2cca46f..0000000 --- a/swc-plugin-registry/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "@dudykr/swc-plugin-registry", - "private": true, - "scripts": { - "dev": "next dev -p 50000", - "build:next": "next build", - "start": "next start", - "lint": "next lint" - }, - "dependencies": { - "@types/node": "20.11.16", - "@types/react": "18.2.55", - "@types/react-dom": "18.2.7", - "autoprefixer": "10.4.16", - "eslint": "8.49.0", - "eslint-config-next": "13.5.2", - "next": "14.1.0", - "postcss": "8.4.30", - "react": "18.2.0", - "react-dom": "18.2.0", - "tailwindcss": "3.3.3", - "typescript": "5.2.2" - } -} diff --git a/swc-plugin-registry/postcss.config.js b/swc-plugin-registry/postcss.config.js deleted file mode 100644 index 12a703d..0000000 --- a/swc-plugin-registry/postcss.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, -}; diff --git a/swc-plugin-registry/.eslintrc.json b/swc-plugins/.eslintrc.json similarity index 100% rename from swc-plugin-registry/.eslintrc.json rename to swc-plugins/.eslintrc.json diff --git a/swc-plugin-registry/.gitignore b/swc-plugins/.gitignore similarity index 94% rename from swc-plugin-registry/.gitignore rename to swc-plugins/.gitignore index 8f322f0..fd3dbb5 100644 --- a/swc-plugin-registry/.gitignore +++ b/swc-plugins/.gitignore @@ -4,6 +4,7 @@ /node_modules /.pnp .pnp.js +.yarn/install-state.gz # testing /coverage diff --git a/swc-plugins/README.md b/swc-plugins/README.md new file mode 100644 index 0000000..c403366 --- /dev/null +++ b/swc-plugins/README.md @@ -0,0 +1,36 @@ +This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +# or +pnpm dev +# or +bun dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. + +This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. + +## 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) - 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_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/swc-plugin-registry/app/favicon.ico b/swc-plugins/app/favicon.ico similarity index 100% rename from swc-plugin-registry/app/favicon.ico rename to swc-plugins/app/favicon.ico diff --git a/swc-plugin-registry/app/globals.css b/swc-plugins/app/globals.css similarity index 88% rename from swc-plugin-registry/app/globals.css rename to swc-plugins/app/globals.css index fd81e88..875c01e 100644 --- a/swc-plugin-registry/app/globals.css +++ b/swc-plugins/app/globals.css @@ -25,3 +25,9 @@ body { ) rgb(var(--background-start-rgb)); } + +@layer utilities { + .text-balance { + text-wrap: balance; + } +} diff --git a/swc-plugin-registry/app/layout.tsx b/swc-plugins/app/layout.tsx similarity index 95% rename from swc-plugin-registry/app/layout.tsx rename to swc-plugins/app/layout.tsx index 5732299..3314e47 100644 --- a/swc-plugin-registry/app/layout.tsx +++ b/swc-plugins/app/layout.tsx @@ -1,6 +1,6 @@ -import "./globals.css"; import type { Metadata } from "next"; import { Inter } from "next/font/google"; +import "./globals.css"; const inter = Inter({ subsets: ["latin"] }); @@ -11,9 +11,9 @@ export const metadata: Metadata = { export default function RootLayout({ children, -}: { +}: Readonly<{ children: React.ReactNode; -}) { +}>) { return ( {children} diff --git a/swc-plugin-registry/app/page.tsx b/swc-plugins/app/page.tsx similarity index 76% rename from swc-plugin-registry/app/page.tsx rename to swc-plugins/app/page.tsx index 5842fc6..ff6a97a 100644 --- a/swc-plugin-registry/app/page.tsx +++ b/swc-plugins/app/page.tsx @@ -4,11 +4,11 @@ export default function Home() { return (
-

+

Get started by editing  app/page.tsx

-
+
-
+
-

+

Docs{" "} ->

-

+

Find in-depth information about Next.js features and API.

@@ -63,13 +63,13 @@ export default function Home() { target="_blank" rel="noopener noreferrer" > -

+

Learn{" "} ->

-

+

Learn about Next.js in an interactive course with quizzes!

@@ -80,14 +80,14 @@ export default function Home() { target="_blank" rel="noopener noreferrer" > -

+

Templates{" "} ->

-

- Explore the Next.js 13 playground. +

+ Explore starter templates for Next.js.

@@ -97,13 +97,13 @@ export default function Home() { target="_blank" rel="noopener noreferrer" > -

+

Deploy{" "} ->

-

+

Instantly deploy your Next.js site to a shareable URL with Vercel.

diff --git a/swc-plugin-registry/next.config.js b/swc-plugins/next.config.mjs similarity index 69% rename from swc-plugin-registry/next.config.js rename to swc-plugins/next.config.mjs index 658404a..4678774 100644 --- a/swc-plugin-registry/next.config.js +++ b/swc-plugins/next.config.mjs @@ -1,4 +1,4 @@ /** @type {import('next').NextConfig} */ const nextConfig = {}; -module.exports = nextConfig; +export default nextConfig; diff --git a/swc-plugins/package.json b/swc-plugins/package.json new file mode 100644 index 0000000..3818605 --- /dev/null +++ b/swc-plugins/package.json @@ -0,0 +1,26 @@ +{ + "name": "swc-plugins", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "next dev -p 50000", + "build:next": "next build", + "start": "next start", + "lint": "next lint" + }, + "dependencies": { + "react": "^18", + "react-dom": "^18", + "next": "14.2.1" + }, + "devDependencies": { + "typescript": "^5", + "@types/node": "^20", + "@types/react": "^18", + "@types/react-dom": "^18", + "postcss": "^8", + "tailwindcss": "^3.4.1", + "eslint": "^8", + "eslint-config-next": "14.2.1" + } +} diff --git a/swc-plugins/postcss.config.mjs b/swc-plugins/postcss.config.mjs new file mode 100644 index 0000000..1a69fd2 --- /dev/null +++ b/swc-plugins/postcss.config.mjs @@ -0,0 +1,8 @@ +/** @type {import('postcss-load-config').Config} */ +const config = { + plugins: { + tailwindcss: {}, + }, +}; + +export default config; diff --git a/swc-plugin-registry/public/next.svg b/swc-plugins/public/next.svg similarity index 100% rename from swc-plugin-registry/public/next.svg rename to swc-plugins/public/next.svg diff --git a/swc-plugin-registry/public/vercel.svg b/swc-plugins/public/vercel.svg similarity index 100% rename from swc-plugin-registry/public/vercel.svg rename to swc-plugins/public/vercel.svg diff --git a/swc-plugin-registry/tailwind.config.ts b/swc-plugins/tailwind.config.ts similarity index 100% rename from swc-plugin-registry/tailwind.config.ts rename to swc-plugins/tailwind.config.ts diff --git a/swc-plugin-registry/tsconfig.json b/swc-plugins/tsconfig.json similarity index 96% rename from swc-plugin-registry/tsconfig.json rename to swc-plugins/tsconfig.json index c714696..e7ff90f 100644 --- a/swc-plugin-registry/tsconfig.json +++ b/swc-plugins/tsconfig.json @@ -1,6 +1,5 @@ { "compilerOptions": { - "target": "es5", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true,