diff --git a/.copier-answers.yaml b/.copier-answers.yaml index 6565727..02f0bd6 100644 --- a/.copier-answers.yaml +++ b/.copier-answers.yaml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: 0.10.0 +_commit: 0.11.0 _src_path: gh:quickplates/meta accountname: quickplates description: Next.js app template ⚫ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 76524a7..cfa3b8e 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -145,7 +145,7 @@ }, "ghcr.io/devcontainers/features/nix:1.2.0": { "extraNixConfig": "experimental-features = nix-command flakes", - "version": "2.32.4" + "version": "2.28.5" } }, "mounts": [ diff --git a/.github/workflows/example.yaml b/.github/workflows/example.yaml index 8f1c732..fc86d5e 100644 --- a/.github/workflows/example.yaml +++ b/.github/workflows/example.yaml @@ -48,16 +48,16 @@ jobs: uses: cachix/install-nix-action@v31.8.4 with: github_access_token: ${{ github.token }} - install_url: https://releases.nixos.org/nix/nix-2.32.4/install + install_url: https://releases.nixos.org/nix/nix-2.28.5/install # See: https://github.com/cachix/install-nix-action/issues/56 - name: Import Nix store cache if: steps.cache-nix.outputs.cache-hit == 'true' - run: > + run: >- nix-store --import < ${{ env.NIX_CACHE_DIR }}/archive.nar - name: Build template files - run: > + run: >- nix develop ./#template @@ -76,7 +76,7 @@ jobs: 'description=Next.js app example ⚫' # Create archive to retain file permissions - name: Create archive - run: > + run: >- tar --directory build/ @@ -94,7 +94,7 @@ jobs: # See: https://github.com/cachix/install-nix-action/issues/56 - name: Export Nix store cache if: "!cancelled()" - run: > + run: >- mkdir --parents ${{ env.NIX_CACHE_DIR }} @@ -116,7 +116,7 @@ jobs: with: name: build - name: Extract archive - run: > + run: >- mkdir --parents build/ @@ -139,7 +139,7 @@ jobs: # Configure git to use GitHub Actions bot as committer - name: Configure git working-directory: example/ - run: > + run: >- git config user.name @@ -151,14 +151,14 @@ jobs: "41898282+github-actions[bot]@users.noreply.github.com" - name: Reset example repository to first commit working-directory: example/ - run: > + run: >- git reset --hard "$(git rev-list --max-parents=0 HEAD)" - name: Push changes working-directory: example/ - run: > + run: >- git push --force @@ -166,33 +166,33 @@ jobs: HEAD - name: Create new branch working-directory: example/ - run: > + run: >- git checkout -b build - name: Copy build output - run: > + run: >- cp --recursive build/. example/ - name: Add changes working-directory: example/ - run: > + run: >- git add ./ - name: Commit changes working-directory: example/ - run: > + run: >- git commit --message 'Added template files' - name: Push changes working-directory: example/ - run: > + run: >- git push --force @@ -202,7 +202,7 @@ jobs: working-directory: example/ env: GITHUB_TOKEN: ${{ secrets.EXAMPLES_ACCESS_TOKEN }} - run: > + run: >- gh pr create @@ -224,7 +224,7 @@ jobs: working-directory: example/ env: GITHUB_TOKEN: ${{ secrets.EXAMPLES_ACCESS_TOKEN }} - run: > + run: >- gh release list @@ -252,7 +252,7 @@ jobs: working-directory: example/ env: GITHUB_TOKEN: ${{ secrets.EXAMPLES_ACCESS_TOKEN }} - run: > + run: >- gh pr merge @@ -261,7 +261,7 @@ jobs: --squash - name: Fetch changes from origin working-directory: example/ - run: > + run: >- git fetch --prune @@ -271,7 +271,7 @@ jobs: working-directory: example/ env: GITHUB_TOKEN: ${{ secrets.EXAMPLES_ACCESS_TOKEN }} - run: > + run: >- gh release create diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index f91dd1b..db3a49d 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -32,7 +32,7 @@ jobs: # We need to fetch upstream so Trunk can compare against it - name: Fetch upstream if: github.event_name == 'pull_request' - run: > + run: >- git fetch origin @@ -52,11 +52,11 @@ jobs: uses: cachix/install-nix-action@v31.8.4 with: github_access_token: ${{ github.token }} - install_url: https://releases.nixos.org/nix/nix-2.32.4/install + install_url: https://releases.nixos.org/nix/nix-2.28.5/install # See: https://github.com/cachix/install-nix-action/issues/56 - name: Import Nix store cache if: steps.cache-nix.outputs.cache-hit == 'true' - run: > + run: >- nix-store --import < ${{ env.NIX_CACHE_DIR }}/archive.nar @@ -65,7 +65,7 @@ jobs: if: github.event_name == 'pull_request' env: TRUNK_CACHE: ${{ env.TRUNK_CACHE_DIR }} - run: > + run: >- nix develop ./#lint @@ -82,7 +82,7 @@ jobs: if: github.event_name != 'pull_request' env: TRUNK_CACHE: ${{ env.TRUNK_CACHE_DIR }} - run: > + run: >- nix develop ./#lint @@ -95,7 +95,7 @@ jobs: # See: https://github.com/cachix/install-nix-action/issues/56 - name: Export Nix store cache if: "!cancelled()" - run: > + run: >- mkdir --parents ${{ env.NIX_CACHE_DIR }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fa17cff..2e1a315 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -62,18 +62,18 @@ jobs: uses: cachix/install-nix-action@v31.8.4 with: github_access_token: ${{ github.token }} - install_url: https://releases.nixos.org/nix/nix-2.32.4/install + install_url: https://releases.nixos.org/nix/nix-2.28.5/install # See: https://github.com/cachix/install-nix-action/issues/56 - name: Import Nix store cache if: steps.cache-nix.outputs.cache-hit == 'true' - run: > + run: >- nix-store --import < ${{ env.NIX_CACHE_DIR }}/archive.nar - name: Run tests env: TRUNK_CACHE: ${{ env.TRUNK_CACHE_DIR }} - run: > + run: >- nix develop ./#test @@ -84,7 +84,7 @@ jobs: # See: https://github.com/cachix/install-nix-action/issues/56 - name: Export Nix store cache if: "!cancelled()" - run: > + run: >- mkdir --parents ${{ env.NIX_CACHE_DIR }} diff --git a/.trunk/configs/ruff.toml b/.trunk/configs/ruff.toml index c44ae95..08649cf 100644 --- a/.trunk/configs/ruff.toml +++ b/.trunk/configs/ruff.toml @@ -1,3 +1,6 @@ +# Python version to target +target-version = "py313" + select = [ # Enable all rules "ALL", diff --git a/Taskfile.dist.yaml b/Taskfile.dist.yaml index 8c032d7..6fb6c30 100644 --- a/Taskfile.dist.yaml +++ b/Taskfile.dist.yaml @@ -8,7 +8,7 @@ tasks: GIT_CONFIG_GLOBAL: "" GIT_CONFIG_SYSTEM: "" cmds: - - > + - >- copier update --answers-file @@ -17,7 +17,7 @@ tasks: flake: desc: Update flake.lock cmds: - - > + - >- nix --accept-flake-config --extra-experimental-features @@ -29,28 +29,28 @@ tasks: fmt: desc: Format files cmds: - - > + - >- trunk fmt {{ .CLI_ARGS }} lint: desc: Lint files cmds: - - > + - >- trunk check {{ .CLI_ARGS }} clean: desc: Clean build outputs cmds: - - > + - >- rm --recursive --force {{ .CLI_ARGS }} build/ status: - - > + - >- test '!' -d @@ -78,7 +78,7 @@ tasks: - task: clean vars: CLI_ARGS: "" - - > + - >- copier copy --overwrite @@ -100,13 +100,13 @@ tasks: GIT_COMMITTER_EMAIL: test@example.org dir: build/ cmds: - - > + - >- git init --initial-branch main --quiet - - > + - >- git commit --allow-empty @@ -114,7 +114,7 @@ tasks: 'Initial commit' --quiet status: - - > + - >- test -d .git/ @@ -126,13 +126,13 @@ tasks: GIT_CONFIG_SYSTEM: "" dir: build/ cmds: - - > + - >- git add --all {{ .CLI_ARGS }} status: - - > + - >- test -z "$(git ls-files --others --exclude-standard)" @@ -158,7 +158,7 @@ tasks: test: desc: Test the project cmds: - - > + - >- pytest tests/ {{ .CLI_ARGS }} diff --git a/copier.yaml b/copier.yaml index 5b38868..f7625ca 100644 --- a/copier.yaml +++ b/copier.yaml @@ -2,7 +2,7 @@ accountname: type: str - help: The name of the organization on GitHub + help: The name of the account on GitHub appname: type: str diff --git a/flake.nix b/flake.nix index 6ca2f8c..8a75451 100644 --- a/flake.nix +++ b/flake.nix @@ -35,6 +35,7 @@ system, ... }: let + nix = pkgs.nix; nil = pkgs.nil; task = pkgs.go-task; coreutils = pkgs.coreutils; @@ -64,6 +65,7 @@ name = "dev"; packages = [ + nix nil task coreutils @@ -81,6 +83,7 @@ name = "template"; packages = [ + nix task coreutils copier @@ -95,6 +98,7 @@ name = "lint"; packages = [ + nix task coreutils trunk @@ -109,6 +113,7 @@ name = "test"; packages = [ + nix task coreutils copier diff --git a/src/.dockerignore.jinja b/src/.dockerignore.jinja index ba96c52..edf6288 100644 --- a/src/.dockerignore.jinja +++ b/src/.dockerignore.jinja @@ -14,7 +14,7 @@ /build/ # Debug -npm-debug.log* +*.log # Typescript *.tsbuildinfo diff --git a/src/Dockerfile b/src/Dockerfile index 02a5895..9cfff79 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -1,5 +1,5 @@ # Use generic base image with Nix installed -FROM nixos/nix:2.32.4 AS base-env +FROM nixos/nix:2.28.5 AS base-env # Configure Nix RUN echo "extra-experimental-features = nix-command flakes" >> /etc/nix/nix.conf diff --git a/src/Taskfile.dist.yaml.jinja b/src/Taskfile.dist.yaml.jinja index bfdc959..aaec503 100644 --- a/src/Taskfile.dist.yaml.jinja +++ b/src/Taskfile.dist.yaml.jinja @@ -8,7 +8,7 @@ tasks: GIT_CONFIG_GLOBAL: "" GIT_CONFIG_SYSTEM: "" cmds: - - > + - >- copier update --answers-file @@ -17,7 +17,7 @@ tasks: flake: desc: Update flake.lock cmds: - - > + - >- nix --accept-flake-config --extra-experimental-features @@ -37,7 +37,7 @@ tasks: - task: install-internal vars: CLI_ARGS: "" - - > + - >- trunk fmt {{ '{{ .CLI_ARGS }}' }} @@ -52,7 +52,7 @@ tasks: - task: install-internal vars: CLI_ARGS: "" - - > + - >- trunk check {{ '{{ .CLI_ARGS }}' }} @@ -70,7 +70,7 @@ tasks: generates: - node_modules/**/* cmds: - - > + - >- npm install {{ '{{ .CLI_ARGS }}' }} @@ -81,7 +81,7 @@ tasks: cmds: - task: install-docs vars: - CLI_ARGS: > + CLI_ARGS: >- --prefer-offline --no-audit --no-fund @@ -91,7 +91,7 @@ tasks: desc: Update docs package-lock.json dir: docs/ cmds: - - > + - >- npm update {{ '{{ .CLI_ARGS }}' }} @@ -103,7 +103,7 @@ tasks: - task: install-docs-internal vars: CLI_ARGS: "" - - > + - >- npm exec -- @@ -122,7 +122,7 @@ tasks: generates: - node_modules/**/* cmds: - - > + - >- npm install {{ '{{ .CLI_ARGS }}' }} @@ -132,7 +132,7 @@ tasks: cmds: - task: install vars: - CLI_ARGS: > + CLI_ARGS: >- --prefer-offline --no-audit --no-fund @@ -141,21 +141,21 @@ tasks: update: desc: Update package-lock.json cmds: - - > + - >- npm update {{ '{{ .CLI_ARGS }}' }} clean: desc: Clean build outputs cmds: - - > + - >- rm --recursive --force {{ '{{ .CLI_ARGS }}' }} build/ status: - - > + - >- test '!' -d @@ -181,7 +181,7 @@ tasks: - task: install-internal vars: CLI_ARGS: "" - - > + - >- npm exec -- @@ -201,7 +201,7 @@ tasks: - task: install-internal vars: CLI_ARGS: "" - - > + - >- npm exec -- @@ -228,7 +228,7 @@ tasks: - task: install-internal vars: CLI_ARGS: "" - - > + - >- npm exec -- @@ -244,7 +244,7 @@ tasks: - task: install-internal vars: CLI_ARGS: "" - - > + - >- npm run -- @@ -260,7 +260,7 @@ tasks: - task: build-internal vars: CLI_ARGS: "" - - > + - >- npm run -- @@ -270,7 +270,7 @@ tasks: desc: Run in docker container interactive: true cmds: - - > + - >- docker compose up diff --git a/src/flake.nix.jinja b/src/flake.nix.jinja index 7b75ce1..2becd7d 100644 --- a/src/flake.nix.jinja +++ b/src/flake.nix.jinja @@ -35,13 +35,14 @@ system, ... }: let + nix = pkgs.nix; node = pkgs.nodejs; cacert = pkgs.cacert; nil = pkgs.nil; task = pkgs.go-task; coreutils = pkgs.coreutils; trunk = pkgs.trunk-io; - copier = pkgs.copier; + copier = pkgs.python313.withPackages (ps: [ps.copier]); tini = pkgs.tini; su-exec = pkgs.su-exec; in { @@ -67,6 +68,7 @@ name = "dev"; packages = [ + nix node cacert nil @@ -81,21 +83,6 @@ ''; }; - package = pkgs.mkShell { - name = "package"; - - packages = [ - node - cacert - task - coreutils - ]; - - shellHook = '' - export TMPDIR=/tmp - ''; - }; - build = pkgs.mkShell { name = "build"; @@ -126,25 +113,13 @@ ''; }; - template = pkgs.mkShell { - name = "template"; - - packages = [ - task - coreutils - copier - ]; - - shellHook = '' - export TMPDIR=/tmp - ''; - }; - lint = pkgs.mkShell { name = "lint"; packages = [ + nix node + cacert task coreutils trunk diff --git a/src/{% if true %}.devcontainer{% endif %}/devcontainer.json b/src/{% if true %}.devcontainer{% endif %}/devcontainer.json index d65d83e..528ab1e 100644 --- a/src/{% if true %}.devcontainer{% endif %}/devcontainer.json +++ b/src/{% if true %}.devcontainer{% endif %}/devcontainer.json @@ -51,7 +51,7 @@ }, "ghcr.io/devcontainers/features/nix:1.2.0": { "extraNixConfig": "experimental-features = nix-command flakes", - "version": "2.32.4" + "version": "2.28.5" } }, "mounts": [ diff --git a/src/{% if true %}.github{% endif %}/workflows/lint.yaml.jinja b/src/{% if true %}.github{% endif %}/workflows/lint.yaml.jinja index 494b71f..1512449 100644 --- a/src/{% if true %}.github{% endif %}/workflows/lint.yaml.jinja +++ b/src/{% if true %}.github{% endif %}/workflows/lint.yaml.jinja @@ -32,7 +32,7 @@ jobs: # We need to fetch upstream so Trunk can compare against it - name: Fetch upstream if: github.event_name == 'pull_request' - run: > + run: >- git fetch origin @@ -64,11 +64,11 @@ jobs: uses: cachix/install-nix-action@v31.8.4 with: github_access_token: {{ '${{ github.token }}' }} - install_url: https://releases.nixos.org/nix/nix-2.32.4/install + install_url: https://releases.nixos.org/nix/nix-2.28.5/install # See: https://github.com/cachix/install-nix-action/issues/56 - name: Import Nix store cache if: steps.cache-nix.outputs.cache-hit == 'true' - run: > + run: >- nix-store --import < {{ '${{ env.NIX_CACHE_DIR }}/archive.nar' }} @@ -77,7 +77,7 @@ jobs: if: github.event_name == 'pull_request' env: TRUNK_CACHE: {{ '${{ env.TRUNK_CACHE_DIR }}' }} - run: > + run: >- nix develop ./#lint @@ -94,7 +94,7 @@ jobs: if: github.event_name != 'pull_request' env: TRUNK_CACHE: {{ '${{ env.TRUNK_CACHE_DIR }}' }} - run: > + run: >- nix develop ./#lint @@ -107,7 +107,7 @@ jobs: # See: https://github.com/cachix/install-nix-action/issues/56 - name: Export Nix store cache if: "!cancelled()" - run: > + run: >- mkdir --parents {{ '${{ env.NIX_CACHE_DIR }}' }} diff --git a/src/{% if true %}.github{% endif %}/workflows/{% if docs %}docs.yaml{% endif %} b/src/{% if true %}.github{% endif %}/workflows/{% if docs %}docs.yaml{% endif %} index 8628100..400bce8 100644 --- a/src/{% if true %}.github{% endif %}/workflows/{% if docs %}docs.yaml{% endif %} +++ b/src/{% if true %}.github{% endif %}/workflows/{% if docs %}docs.yaml{% endif %} @@ -54,16 +54,16 @@ jobs: uses: cachix/install-nix-action@v31.8.4 with: github_access_token: ${{ github.token }} - install_url: https://releases.nixos.org/nix/nix-2.32.4/install + install_url: https://releases.nixos.org/nix/nix-2.28.5/install # See: https://github.com/cachix/install-nix-action/issues/56 - name: Import Nix store cache if: steps.cache-nix.outputs.cache-hit == 'true' - run: > + run: >- nix-store --import < ${{ env.NIX_CACHE_DIR }}/archive.nar - name: Build docs - run: > + run: >- nix develop ./#docs @@ -84,7 +84,7 @@ jobs: # See: https://github.com/cachix/install-nix-action/issues/56 - name: Export Nix store cache if: "!cancelled()" - run: > + run: >- mkdir --parents ${{ env.NIX_CACHE_DIR }} diff --git a/src/{% if true %}.trunk{% endif %}/trunk.yaml b/src/{% if true %}.trunk{% endif %}/trunk.yaml index dc28178..c6e6fb1 100644 --- a/src/{% if true %}.trunk{% endif %}/trunk.yaml +++ b/src/{% if true %}.trunk{% endif %}/trunk.yaml @@ -70,8 +70,6 @@ lint: enabled: # GitHub Actions linting - actionlint@1.7.8 - # .env files linting - - dotenv-linter@4.0.0 # JavaScript and TypeScript linting - eslint@9.39.1 # Check for whitespace errors