diff --git a/.editorconfig b/.editorconfig index 9b73521..a0c53fc 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,9 +5,22 @@ root = true charset = utf-8 indent_style = space indent_size = 4 +end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true [*.md] max_line_length = off trim_trailing_whitespace = false + +[*.yaml] +indent_size = 2 + +[*.yml] +indent_size = 2 + +[*.sh] +indent_size = 2 + +[*.json] +indent_size = 2 diff --git a/.env b/.env index 194d95d..f8f8d26 100644 --- a/.env +++ b/.env @@ -1,7 +1,7 @@ -REACT_APP_BRAND_NAME=Tetromino -REACT_APP_GITHUB=https://github.com/reactgular/tetromino -REACT_APP_STORAGE_KEY=tetromino -REACT_APP_VERSION=1.0.0 +NEXT_PUBLIC_BRAND_NAME=Tetromino +NEXT_PUBLIC_GITHUB=https://github.com/reactgular/tetromino +NEXT_PUBLIC_STORAGE_KEY=tetromino +NEXT_PUBLIC_VERSION=2.0.0 # Base path for loading audio files -REACT_APP_BASE=/tetromino -REACT_APP_ANALYTICS= +NEXT_PUBLIC_BASE=/tetromino +NEXT_PUBLIC_ANALYTICS= diff --git a/.env.local b/.env.local new file mode 100644 index 0000000..40cf09e --- /dev/null +++ b/.env.local @@ -0,0 +1,3 @@ +NEXT_PUBLIC_BASE=http://localhost:3000/ +NEXT_PUBLIC_ANALYTICS= + diff --git a/.env.production b/.env.production index 3928a32..d25c161 100644 --- a/.env.production +++ b/.env.production @@ -1,2 +1,2 @@ # Please change to your Google Analytics ID -REACT_APP_ANALYTICS=UA-141015392-3 +NEXT_PUBLIC_ANALYTICS=UA-141015392-3 diff --git a/.eslintrc.json b/.eslintrc.json index 6d779d9..bffb357 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,50 +1,3 @@ { - "parser": "@typescript-eslint/parser", - "extends": [ - "plugin:@typescript-eslint/recommended", - "plugin:react/recommended", - "plugin:react-hooks/recommended", - "plugin:prettier/recommended", - "prettier", - "prettier/react", - "prettier/@typescript-eslint" - ], - "plugins": [ - "@typescript-eslint", - "react", - "react-hooks", - "prettier" - ], - "rules": { - "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/no-inferrable-types": "off", - "@typescript-eslint/no-namespace": "off", - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/no-explicit-any": "off", - "react/prop-types": "off", - "react/react-in-jsx-scope": "off", - "react/jsx-first-prop-new-line": [ - 1, - "multiline" - ], - "react/jsx-closing-bracket-location": [ - 2, - "tag-aligned" - ], - "no-restricted-imports": [ - "error", - { - "patterns": [ - "@material-ui/*/*/*", - "!@material-ui/core/test-utils/*", - "react-icons/all" - ] - } - ] - }, - "globals": { - "React": "writable" - } + "extends": "next/core-web-vitals" } diff --git a/.github/actions/install/README.md b/.github/actions/install/README.md new file mode 100644 index 0000000..9bd18fe --- /dev/null +++ b/.github/actions/install/README.md @@ -0,0 +1,38 @@ +# 📥 Install GitHub Action + +This GitHub Action is designed to install dependencies for your project. It does so by first attempting to cache the `node_modules` directory to improve subsequent installation speeds. If the dependencies have not changed (i.e., the `yarn.lock` file remains unchanged), it retrieves the cached `node_modules`. Otherwise, it performs a fresh install. + +## Features: + +1. 📦 **Caching of `node_modules`**: This step caches the `node_modules` directory to improve the speed of subsequent installations. It uses the `actions/cache@v4` action for this purpose. +2. 📥 **Installation of Dependencies**: If the cache was not hit (i.e., the dependencies or the `yarn.lock` file changed), it installs the dependencies using Yarn. + +## How it Works: + +1. **Cache Key Generation**: The key for the cache is generated using the operating system of the runner and a hash of the `yarn.lock` file. This ensures that the cache is only hit when the `yarn.lock` file remains unchanged across workflow runs. +2. **Cache Retrieval**: If the cache is hit, the `node_modules` directory is restored, skipping the installation step. +3. **Dependency Installation**: If the cache is not hit, it installs the dependencies using `yarn install --frozen-lockfile`. + +## Usage: + +To use this action in your workflow, add the following steps to your `.github/workflows/your-workflow-file.yml`: + +```yaml +name: Your Workflow Name + +on: + push: # or any other GitHub event + branches: + - main + +jobs: + install: + runs-on: ubuntu-latest # or any other runner + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: 📥 Install + uses: ./.github/actions/install +``` diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml new file mode 100644 index 0000000..92c61c2 --- /dev/null +++ b/.github/actions/install/action.yml @@ -0,0 +1,17 @@ +name: "📥 Install" +description: "📥 Install dependencies" + +runs: + using: "composite" + steps: + - name: "📦 Cache node_modules" + id: node-modules + uses: actions/cache@v4 + with: + path: '**/node_modules' + key: ${{ runner.os }}-${{ runner.arch }}-node-modules-${{ hashFiles('**/yarn.lock') }} + + - name: "📥 Install dependencies" + if: steps.node-modules.outputs.cache-hit != 'true' + shell: bash + run: yarn install --frozen-lockfile diff --git a/.github/actions/restore/README.md b/.github/actions/restore/README.md new file mode 100644 index 0000000..29ba037 --- /dev/null +++ b/.github/actions/restore/README.md @@ -0,0 +1,57 @@ +# 📦 Node Modules - GitHub Action + +This GitHub Action is designed to restore the `node_modules` cache, improving the speed of workflows by using cached versions of dependencies. It specifically targets Node.js projects and uses the cache based on the content of the `yarn.lock` file. + +## 🚀 Features + +- Uses the `actions/cache` action to manage the caching of `node_modules`. +- Takes into account the OS of the runner to ensure platform-specific dependencies are properly cached. +- Relies on the `yarn.lock` file to ensure that the cache is as up-to-date as your dependencies. + +## 📝 Usage + +To use this action in your workflow, follow the steps below: + +1. Create (if you haven't already) a workflow `.yml` file in your `.github/workflows` directory. +2. Incorporate the `📦 Node Modules` action from the local action path `./.github/actions/restore` as illustrated in the example below: + +```yaml +name: Your Workflow Name + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: 📦 Node Modules + uses: ./.github/actions/restore + + - name: Install dependencies + run: yarn install + + # Add your other steps like running tests, build, etc. +``` + +## 📌 Notes + +- The action uses the `fail-on-cache-miss: true` setting, which means the workflow will fail if the cache can't be restored. Depending on your use-case, you might want to adjust this behavior. + +## 💡 Example + +Considering you've installed the action in the `./.github/actions/restore` directory: + +Your workflow will automatically attempt to restore the `node_modules` cache before installing the dependencies using `yarn install`. If the cache is found and matches the current `yarn.lock`, it will restore the `node_modules` directory from the cache. If not, the workflow will proceed to install the dependencies normally and cache them for future use. + +## 📖 Conclusion + +By utilizing this action, you can potentially save significant time during your workflow runs, especially for projects with a large number of dependencies. Make sure your workflow is set up correctly to make the most out of the caching capabilities provided by this action. diff --git a/.github/actions/restore/action.yml b/.github/actions/restore/action.yml new file mode 100644 index 0000000..7774c47 --- /dev/null +++ b/.github/actions/restore/action.yml @@ -0,0 +1,12 @@ +name: "📦 Node Modules" +description: "🔍 Restore node_modules cache" + +runs: + using: "composite" + steps: + - name: "🔍 Restore node_modules cache" + uses: actions/cache/restore@v4 + with: + path: '**/node_modules' + key: ${{ runner.os }}-${{ runner.arch }}-node-modules-${{ hashFiles('**/yarn.lock') }} + fail-on-cache-miss: true diff --git a/.github/workflows/deploy-artifacts.yml b/.github/workflows/deploy-artifacts.yml new file mode 100644 index 0000000..762f20e --- /dev/null +++ b/.github/workflows/deploy-artifacts.yml @@ -0,0 +1,86 @@ +name: "🔧 Deploy to GitHub" + +on: + # When you push changes: only affected projects will be build/deploy + push: + branches: + - main + - v2.0.x + # When you manually trigger: all projects will be build/deploy + workflow_dispatch: + +concurrency: "deploy" + +jobs: + install: + runs-on: ubuntu-latest + steps: + - name: "📥 Checkout code" + uses: actions/checkout@v4 + + - name: "📦 Install dependencies" + uses: ./.github/actions/install + + lint: + runs-on: ubuntu-latest + needs: [ install ] + steps: + - name: "📥 Checkout code" + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: "💽 Restore node_modules cache" + uses: ./.github/actions/restore + + - name: "🔨 Lint" + run: yarn lint + + test: + runs-on: ubuntu-latest + needs: [ install ] + if: false + steps: + - name: "📥 Checkout code" + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: "💽 Restore node_modules cache" + uses: ./.github/actions/restore + + - name: "🔨 Test" + run: ${{ env.NX }} affected -t test + + storybooks: + runs-on: ubuntu-latest + needs: [ install ] + if: false + steps: + - name: "📥 Checkout code" + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: "💽 Restore node_modules cache" + uses: ./.github/actions/restore + + - name: "🔨 Build storybooks" + run: yarn build-storybook + + build: + runs-on: ubuntu-latest + #needs: [ lint, test, storybooks ] + needs: [ lint ] + steps: + - name: "📥 Checkout code" + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: "💽 Restore node_modules cache" + uses: ./.github/actions/restore + + - name: "🔨 Build projects" + run: yarn build + diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..e7038d8 --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,81 @@ +name: "🔄 Pull Request" + +on: + pull_request: + types: [ opened, synchronize, reopened, converted_to_draft, ready_for_review ] + +concurrency: + group: "${{ github.workflow }}-${{ github.event.pull_request.number }}" + cancel-in-progress: true + +jobs: + install: + runs-on: ubuntu-latest + steps: + - name: "📥 Checkout code" + uses: actions/checkout@v4 + + - name: "📦 Install dependencies" + uses: ./.github/actions/install + + lint: + runs-on: ubuntu-latest + needs: [ install ] + steps: + - name: "📥 Checkout code" + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: "💽 Restore node_modules cache" + uses: ./.github/actions/restore + + - name: "🔨 Lint" + run: yarn lint + + test: + runs-on: ubuntu-latest + needs: [ install ] + if: false + steps: + - name: "📥 Checkout code" + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: "💽 Restore node_modules cache" + uses: ./.github/actions/restore + + - name: "🔨 Test" + run: ${{ env.NX }} affected -t test + + storybooks: + runs-on: ubuntu-latest + needs: [ install ] + if: false + steps: + - name: "📥 Checkout code" + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: "💽 Restore node_modules cache" + uses: ./.github/actions/restore + + - name: "🔨 Build storybooks" + run: yarn build-storybook + + build: + runs-on: ubuntu-latest + needs: [ install ] + steps: + - name: "📥 Checkout code" + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: "💽 Restore node_modules cache" + uses: ./.github/actions/restore + + - name: "🔨 Build projects" + run: yarn build diff --git a/.gitignore b/.gitignore index 8064d09..c781312 100644 --- a/.gitignore +++ b/.gitignore @@ -4,24 +4,34 @@ /node_modules /.pnp .pnp.js +.yarn/install-state.gz # testing /coverage +# next.js +/.next/ +/out/ + # production /build # misc .DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local +*.pem +# debug npm-debug.log* yarn-debug.log* yarn-error.log* +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts + # IDEs and editors /.idea .project @@ -37,12 +47,3 @@ yarn-error.log* !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json - -*.log -/.sass-cache - -# testing - -# misc -*.pem -Thumbs.db diff --git a/docs/asset-manifest.json b/docs/asset-manifest.json deleted file mode 100644 index 6f96cf1..0000000 --- a/docs/asset-manifest.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "files": { - "main.css": "/tetromino/static/css/main.6aecde05.chunk.css", - "main.js": "/tetromino/static/js/main.b40626ab.chunk.js", - "main.js.map": "/tetromino/static/js/main.b40626ab.chunk.js.map", - "runtime-main.js": "/tetromino/static/js/runtime-main.f542b1c1.js", - "runtime-main.js.map": "/tetromino/static/js/runtime-main.f542b1c1.js.map", - "static/js/2.5a8c1228.chunk.js": "/tetromino/static/js/2.5a8c1228.chunk.js", - "static/js/2.5a8c1228.chunk.js.map": "/tetromino/static/js/2.5a8c1228.chunk.js.map", - "static/js/3.29fa8080.chunk.js": "/tetromino/static/js/3.29fa8080.chunk.js", - "static/js/3.29fa8080.chunk.js.map": "/tetromino/static/js/3.29fa8080.chunk.js.map", - "index.html": "/tetromino/index.html", - "static/css/main.6aecde05.chunk.css.map": "/tetromino/static/css/main.6aecde05.chunk.css.map", - "static/js/2.5a8c1228.chunk.js.LICENSE.txt": "/tetromino/static/js/2.5a8c1228.chunk.js.LICENSE.txt", - "static/media/index.css": "/tetromino/static/media/Segment7-4Gml.fd88e4c6.otf" - }, - "entrypoints": [ - "static/js/runtime-main.f542b1c1.js", - "static/js/2.5a8c1228.chunk.js", - "static/css/main.6aecde05.chunk.css", - "static/js/main.b40626ab.chunk.js" - ] -} \ No newline at end of file diff --git a/docs/audio/music/8-bit-perplexion.mp3 b/docs/audio/music/8-bit-perplexion.mp3 deleted file mode 100644 index 75dc171..0000000 Binary files a/docs/audio/music/8-bit-perplexion.mp3 and /dev/null differ diff --git a/docs/audio/music/arcade-puzzler.mp3 b/docs/audio/music/arcade-puzzler.mp3 deleted file mode 100644 index e37b291..0000000 Binary files a/docs/audio/music/arcade-puzzler.mp3 and /dev/null differ diff --git a/docs/audio/music/bonkers-for-arcades.mp3 b/docs/audio/music/bonkers-for-arcades.mp3 deleted file mode 100644 index 8fb34e9..0000000 Binary files a/docs/audio/music/bonkers-for-arcades.mp3 and /dev/null differ diff --git a/docs/audio/music/its-raining-pixels.mp3 b/docs/audio/music/its-raining-pixels.mp3 deleted file mode 100644 index 329e792..0000000 Binary files a/docs/audio/music/its-raining-pixels.mp3 and /dev/null differ diff --git a/docs/audio/music/the-ice-cream-man.mp3 b/docs/audio/music/the-ice-cream-man.mp3 deleted file mode 100644 index 478dd22..0000000 Binary files a/docs/audio/music/the-ice-cream-man.mp3 and /dev/null differ diff --git a/docs/audio/sounds/power-down-13.mp3 b/docs/audio/sounds/power-down-13.mp3 deleted file mode 100644 index f096323..0000000 Binary files a/docs/audio/sounds/power-down-13.mp3 and /dev/null differ diff --git a/docs/audio/sounds/retro-chip-power.mp3 b/docs/audio/sounds/retro-chip-power.mp3 deleted file mode 100644 index a287d60..0000000 Binary files a/docs/audio/sounds/retro-chip-power.mp3 and /dev/null differ diff --git a/docs/audio/sounds/ui-quirky-19.mp3 b/docs/audio/sounds/ui-quirky-19.mp3 deleted file mode 100644 index f64bc0e..0000000 Binary files a/docs/audio/sounds/ui-quirky-19.mp3 and /dev/null differ diff --git a/docs/audio/sounds/zapsplat_bambo_swoosh.mp3 b/docs/audio/sounds/zapsplat_bambo_swoosh.mp3 deleted file mode 100644 index ddac86f..0000000 Binary files a/docs/audio/sounds/zapsplat_bambo_swoosh.mp3 and /dev/null differ diff --git a/docs/audio/sounds/zapsplat_level_up.mp3 b/docs/audio/sounds/zapsplat_level_up.mp3 deleted file mode 100644 index 00e0e78..0000000 Binary files a/docs/audio/sounds/zapsplat_level_up.mp3 and /dev/null differ diff --git a/docs/favicon.ico b/docs/favicon.ico deleted file mode 100644 index 2f39800..0000000 Binary files a/docs/favicon.ico and /dev/null differ diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 0730dae..0000000 --- a/docs/index.html +++ /dev/null @@ -1 +0,0 @@ -