From cf83cfac05ce08fef6367d4a86ee0ca190a91c62 Mon Sep 17 00:00:00 2001 From: donniean <12584040+donniean@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:27:57 +0800 Subject: [PATCH] chore: migrate code from src to snippets and remove unused files (#795) Signed-off-by: donniean --- .gitignore | 2 +- configs.config.mjs | 4 +++- package.json | 2 +- {src => snippets}/1password-to-apple-passwords/constants.ts | 0 {src => snippets}/1password-to-apple-passwords/index.ts | 0 {src => snippets}/1password-to-apple-passwords/main.ts | 0 {src => snippets}/1password-to-apple-passwords/schemas.ts | 0 {src => snippets}/1password-to-apple-passwords/types.ts | 0 {src => snippets}/algorithm/binary-search.js | 0 {src => snippets}/algorithm/bubble-sort.js | 0 {src => snippets}/algorithm/letter-count.js | 0 {src => snippets}/algorithm/max-count-letters.js | 0 {src => snippets}/algorithm/quick-sort.js | 0 {src => snippets}/algorithm/tree.js | 0 {src => snippets}/call-apply-bind/index.js | 0 {src => snippets}/clone/index.js | 0 {src => snippets}/curry/index.js | 0 {src => snippets}/debounce-throttle/index.js | 0 {src => snippets}/event-emitter/index.js | 0 {src => snippets}/flat/index.js | 0 {src => snippets}/instanceof/index.js | 0 {src => snippets}/math/index.js | 0 {src => snippets}/new-create/index.js | 0 {src => snippets}/notion/mac-apps.ts | 0 {src => snippets}/promise/cache-request.js | 0 {src => snippets}/promise/control-promise.js | 0 {src => snippets}/promise/index.js | 0 {src => snippets}/promise/methods.js | 0 {src => snippets}/promise/promisify.js | 0 {src => snippets}/pub-sub/index.js | 0 {src => snippets}/react-hooks/index.js | 0 {src => snippets}/styles/index.html | 0 {src => snippets}/styles/index.js | 0 {src => snippets}/styles/iphone.css | 0 {src => snippets}/styles/typography.css | 0 tsconfig.json | 4 ++-- 36 files changed, 7 insertions(+), 5 deletions(-) rename {src => snippets}/1password-to-apple-passwords/constants.ts (100%) rename {src => snippets}/1password-to-apple-passwords/index.ts (100%) rename {src => snippets}/1password-to-apple-passwords/main.ts (100%) rename {src => snippets}/1password-to-apple-passwords/schemas.ts (100%) rename {src => snippets}/1password-to-apple-passwords/types.ts (100%) rename {src => snippets}/algorithm/binary-search.js (100%) rename {src => snippets}/algorithm/bubble-sort.js (100%) rename {src => snippets}/algorithm/letter-count.js (100%) rename {src => snippets}/algorithm/max-count-letters.js (100%) rename {src => snippets}/algorithm/quick-sort.js (100%) rename {src => snippets}/algorithm/tree.js (100%) rename {src => snippets}/call-apply-bind/index.js (100%) rename {src => snippets}/clone/index.js (100%) rename {src => snippets}/curry/index.js (100%) rename {src => snippets}/debounce-throttle/index.js (100%) rename {src => snippets}/event-emitter/index.js (100%) rename {src => snippets}/flat/index.js (100%) rename {src => snippets}/instanceof/index.js (100%) rename {src => snippets}/math/index.js (100%) rename {src => snippets}/new-create/index.js (100%) rename {src => snippets}/notion/mac-apps.ts (100%) rename {src => snippets}/promise/cache-request.js (100%) rename {src => snippets}/promise/control-promise.js (100%) rename {src => snippets}/promise/index.js (100%) rename {src => snippets}/promise/methods.js (100%) rename {src => snippets}/promise/promisify.js (100%) rename {src => snippets}/pub-sub/index.js (100%) rename {src => snippets}/react-hooks/index.js (100%) rename {src => snippets}/styles/index.html (100%) rename {src => snippets}/styles/index.js (100%) rename {src => snippets}/styles/iphone.css (100%) rename {src => snippets}/styles/typography.css (100%) diff --git a/.gitignore b/.gitignore index 9c899439..26daa277 100644 --- a/.gitignore +++ b/.gitignore @@ -85,4 +85,4 @@ next-env.d.ts # Vercel .vercel/ -src/1password-to-apple-passwords/1password-data.json +snippets/1password-to-apple-passwords/1password-data.json diff --git a/configs.config.mjs b/configs.config.mjs index a4f0adca..35f4643d 100644 --- a/configs.config.mjs +++ b/configs.config.mjs @@ -3,7 +3,9 @@ import { defineConfig } from '@donniean/configs'; export default defineConfig({ features: { gitignore: { - ignorePatterns: ['src/1password-to-apple-passwords/1password-data.json'], + ignorePatterns: [ + 'snippets/1password-to-apple-passwords/1password-data.json', + ], }, gitattributes: true, editorconfig: true, diff --git a/package.json b/package.json index d36f4090..7eb7af73 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "lint:tsc": "tsc --noEmit", "pre-commit": "lint-staged --concurrent false", "prepare": "husky", - "serve": "serve src/styles/" + "serve": "serve snippets/styles/" }, "dependencies": { "@notionhq/client": "^2.2.15", diff --git a/src/1password-to-apple-passwords/constants.ts b/snippets/1password-to-apple-passwords/constants.ts similarity index 100% rename from src/1password-to-apple-passwords/constants.ts rename to snippets/1password-to-apple-passwords/constants.ts diff --git a/src/1password-to-apple-passwords/index.ts b/snippets/1password-to-apple-passwords/index.ts similarity index 100% rename from src/1password-to-apple-passwords/index.ts rename to snippets/1password-to-apple-passwords/index.ts diff --git a/src/1password-to-apple-passwords/main.ts b/snippets/1password-to-apple-passwords/main.ts similarity index 100% rename from src/1password-to-apple-passwords/main.ts rename to snippets/1password-to-apple-passwords/main.ts diff --git a/src/1password-to-apple-passwords/schemas.ts b/snippets/1password-to-apple-passwords/schemas.ts similarity index 100% rename from src/1password-to-apple-passwords/schemas.ts rename to snippets/1password-to-apple-passwords/schemas.ts diff --git a/src/1password-to-apple-passwords/types.ts b/snippets/1password-to-apple-passwords/types.ts similarity index 100% rename from src/1password-to-apple-passwords/types.ts rename to snippets/1password-to-apple-passwords/types.ts diff --git a/src/algorithm/binary-search.js b/snippets/algorithm/binary-search.js similarity index 100% rename from src/algorithm/binary-search.js rename to snippets/algorithm/binary-search.js diff --git a/src/algorithm/bubble-sort.js b/snippets/algorithm/bubble-sort.js similarity index 100% rename from src/algorithm/bubble-sort.js rename to snippets/algorithm/bubble-sort.js diff --git a/src/algorithm/letter-count.js b/snippets/algorithm/letter-count.js similarity index 100% rename from src/algorithm/letter-count.js rename to snippets/algorithm/letter-count.js diff --git a/src/algorithm/max-count-letters.js b/snippets/algorithm/max-count-letters.js similarity index 100% rename from src/algorithm/max-count-letters.js rename to snippets/algorithm/max-count-letters.js diff --git a/src/algorithm/quick-sort.js b/snippets/algorithm/quick-sort.js similarity index 100% rename from src/algorithm/quick-sort.js rename to snippets/algorithm/quick-sort.js diff --git a/src/algorithm/tree.js b/snippets/algorithm/tree.js similarity index 100% rename from src/algorithm/tree.js rename to snippets/algorithm/tree.js diff --git a/src/call-apply-bind/index.js b/snippets/call-apply-bind/index.js similarity index 100% rename from src/call-apply-bind/index.js rename to snippets/call-apply-bind/index.js diff --git a/src/clone/index.js b/snippets/clone/index.js similarity index 100% rename from src/clone/index.js rename to snippets/clone/index.js diff --git a/src/curry/index.js b/snippets/curry/index.js similarity index 100% rename from src/curry/index.js rename to snippets/curry/index.js diff --git a/src/debounce-throttle/index.js b/snippets/debounce-throttle/index.js similarity index 100% rename from src/debounce-throttle/index.js rename to snippets/debounce-throttle/index.js diff --git a/src/event-emitter/index.js b/snippets/event-emitter/index.js similarity index 100% rename from src/event-emitter/index.js rename to snippets/event-emitter/index.js diff --git a/src/flat/index.js b/snippets/flat/index.js similarity index 100% rename from src/flat/index.js rename to snippets/flat/index.js diff --git a/src/instanceof/index.js b/snippets/instanceof/index.js similarity index 100% rename from src/instanceof/index.js rename to snippets/instanceof/index.js diff --git a/src/math/index.js b/snippets/math/index.js similarity index 100% rename from src/math/index.js rename to snippets/math/index.js diff --git a/src/new-create/index.js b/snippets/new-create/index.js similarity index 100% rename from src/new-create/index.js rename to snippets/new-create/index.js diff --git a/src/notion/mac-apps.ts b/snippets/notion/mac-apps.ts similarity index 100% rename from src/notion/mac-apps.ts rename to snippets/notion/mac-apps.ts diff --git a/src/promise/cache-request.js b/snippets/promise/cache-request.js similarity index 100% rename from src/promise/cache-request.js rename to snippets/promise/cache-request.js diff --git a/src/promise/control-promise.js b/snippets/promise/control-promise.js similarity index 100% rename from src/promise/control-promise.js rename to snippets/promise/control-promise.js diff --git a/src/promise/index.js b/snippets/promise/index.js similarity index 100% rename from src/promise/index.js rename to snippets/promise/index.js diff --git a/src/promise/methods.js b/snippets/promise/methods.js similarity index 100% rename from src/promise/methods.js rename to snippets/promise/methods.js diff --git a/src/promise/promisify.js b/snippets/promise/promisify.js similarity index 100% rename from src/promise/promisify.js rename to snippets/promise/promisify.js diff --git a/src/pub-sub/index.js b/snippets/pub-sub/index.js similarity index 100% rename from src/pub-sub/index.js rename to snippets/pub-sub/index.js diff --git a/src/react-hooks/index.js b/snippets/react-hooks/index.js similarity index 100% rename from src/react-hooks/index.js rename to snippets/react-hooks/index.js diff --git a/src/styles/index.html b/snippets/styles/index.html similarity index 100% rename from src/styles/index.html rename to snippets/styles/index.html diff --git a/src/styles/index.js b/snippets/styles/index.js similarity index 100% rename from src/styles/index.js rename to snippets/styles/index.js diff --git a/src/styles/iphone.css b/snippets/styles/iphone.css similarity index 100% rename from src/styles/iphone.css rename to snippets/styles/iphone.css diff --git a/src/styles/typography.css b/snippets/styles/typography.css similarity index 100% rename from src/styles/typography.css rename to snippets/styles/typography.css diff --git a/tsconfig.json b/tsconfig.json index 7d4a82fd..568d4c4e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -26,8 +26,8 @@ "outDir": "dist/", "baseUrl": "./", "paths": { - "@/*": ["src/*"] + "@/*": ["snippets/*"] } }, - "include": ["src/"] + "include": ["snippets/"] }