Skip to content

Commit a18cfe7

Browse files
authored
Initial steps (#2)
## Why is this change necessary? Basic framework in place ## How does this change address the issue? Creates basic folders for frontend and backend ## What side effects does this change have? None ## How is this change tested? Downstream repo ## Other Pulls in some misc updates from upstream template
1 parent 17c3f44 commit a18cfe7

17 files changed

+384
-245
lines changed

.copier-answers.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: v0.0.9
2+
_commit: v0.0.10
33
_src_path: gh:LabAutomationAndScreening/copier-base-template.git
44
description: A web app that is hosted within a local intranet. Nuxt frontend, python
55
backend, docker-compose
@@ -10,6 +10,8 @@ python_version: 3.12.7
1010
repo_name: copier-nuxt-python-intranet-app
1111
repo_org_name: LabAutomationAndScreening
1212
ssh_port_number: 65425
13+
template_uses_javascript: true
1314
template_uses_pulumi: false
1415
template_uses_python: true
16+
template_uses_vuejs: true
1517

.devcontainer/devcontainer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"features": {
66
"ghcr.io/devcontainers/features/aws-cli:1": {
77
// view latest version https://raw.githubusercontent.com/aws/aws-cli/v2/CHANGELOG.rst
8-
"version": "2.19.3"
8+
"version": "2.24.24"
99
},
1010
"ghcr.io/devcontainers/features/python:1": {
1111
// https://github.com/devcontainers/features/tree/main/src/python
@@ -31,6 +31,8 @@
3131
3232
3333

34+
35+
3436
// Misc file formats
3537
3638

.pre-commit-config.yaml

Lines changed: 141 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -2,190 +2,206 @@ minimum_pre_commit_version: 4.0.1
22
# run `pre-commit autoupdate --freeze` to update all hooks
33
default_install_hook_types: [pre-commit, post-checkout]
44
repos:
5+
# Git-related
6+
- repo: https://github.com/jumanjihouse/pre-commit-hooks
7+
rev: 38980559e3a605691d6579f96222c30778e5a69e # frozen: 3.0.0
8+
hooks:
9+
- id: git-dirty
510

6-
# Git-related
7-
- repo: https://github.com/jumanjihouse/pre-commit-hooks
8-
rev: 38980559e3a605691d6579f96222c30778e5a69e # frozen: 3.0.0
9-
hooks:
10-
- id: git-dirty
11-
12-
# package management
13-
- repo: local
14-
hooks:
15-
- id: uv-check
16-
name: check pyproject.toml for valid uv config
17-
entry: bash -c 'uv lock --check'
18-
language: system
19-
pass_filenames: false
20-
verbose: true
21-
files: '^pyproject.toml$|^uv.lock$'
22-
23-
- id: sync-dependencies-on-commit
24-
name: ensure python dependencies are up to date during commits
25-
stages: [pre-commit]
26-
# When the install does change things, it exits 0, so needed to check for the phrase 'operations' in stdout in order to cause things pre-commit command to fail
27-
entry: python -c "import subprocess,sys; results=subprocess.run(['uv', 'sync', '--frozen'],timeout=360,capture_output=True); print ('stdout- ' + results.stdout.decode('utf-8', 'strict')); print ('stderr- ' + results.stderr.decode('utf-8', 'strict')); sys.exit(int(results.returncode or int('Installed' in results.stdout.decode('utf-8', 'strict'))));"
28-
# don't pass filenames else the command line sees them twice
29-
pass_filenames: false
30-
language: system
31-
files: 'uv.lock$'
32-
verbose: true
33-
34-
- id: sync-dependencies-post-checkout
35-
name: ensure python dependencies are up to date during checkouts
36-
stages: [post-checkout]
37-
entry: bash -c 'uv sync --frozen'
38-
pass_filenames: false
39-
language: system
40-
always_run: true
41-
verbose: true
42-
43-
44-
# Reformatting (should generally come before any file format or other checks, because reformatting can change things)
45-
- repo: https://github.com/crate-ci/typos
46-
rev: 2300ad1b6b5c37da54bcafb1a06211196503eac9 # frozen: v1
11+
# package management
12+
- repo: local
13+
hooks:
14+
- id: uv-check
15+
name: check pyproject.toml for valid uv config
16+
entry: bash -c 'uv lock --check'
17+
language: system
18+
pass_filenames: false
19+
verbose: true
20+
files: "^pyproject.toml$|^uv.lock$"
21+
22+
- id: sync-dependencies-on-commit
23+
name: ensure python dependencies are up to date during commits
24+
stages:
25+
[pre-commit]
26+
# When the install does change things, it exits 0, so needed to check for the phrase 'operations' in stdout in order to cause things pre-commit command to fail
27+
entry: python -c "import subprocess,sys; results=subprocess.run(['uv', 'sync', '--frozen'],timeout=360,capture_output=True); print ('stdout- ' + results.stdout.decode('utf-8', 'strict')); print ('stderr- ' + results.stderr.decode('utf-8', 'strict')); sys.exit(int(results.returncode or int('Installed' in results.stdout.decode('utf-8', 'strict'))));"
28+
# don't pass filenames else the command line sees them twice
29+
pass_filenames: false
30+
language: system
31+
files: "uv.lock$"
32+
verbose: true
33+
34+
- id: sync-dependencies-post-checkout
35+
name: ensure python dependencies are up to date during checkouts
36+
stages: [post-checkout]
37+
entry: bash -c 'uv sync --frozen'
38+
pass_filenames: false
39+
language: system
40+
always_run: true
41+
verbose: true
42+
43+
# Reformatting (should generally come before any file format or other checks, because reformatting can change things)
44+
- repo: https://github.com/crate-ci/typos
45+
rev: 2300ad1b6b5c37da54bcafb1a06211196503eac9 # frozen: v1
4746
hooks:
4847
- id: typos
49-
- repo: https://github.com/pre-commit/pre-commit-hooks
50-
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
48+
- repo: https://github.com/pre-commit/pre-commit-hooks
49+
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
5150
hooks:
5251
- id: trailing-whitespace
5352
- id: end-of-file-fixer
5453
# the XML formatter hook doesn't leave a blank line at the end, so excluding XML files from this hook to avoid conflicts
55-
exclude: | # the extra trailing newline in the pull request template makes it easier to click there in the github console. The CLI that programmatically generates devcontainer-lock.json always ends the file incompatible with this hook.
56-
(?x)^(
57-
.github/pull_request_template.md|
58-
template/.github/pull_request_template.md|
59-
template/.copier-answers.yml.jinja-base|
60-
template/template/.copier-answers.yml.jinja|
61-
template/.copier-answers.yml.jinja|
62-
.devcontainer/devcontainer-lock.json|
63-
.copier-answers.yml|
64-
.*\.xml|
65-
)$
54+
exclude:
55+
| # the extra trailing newline in the pull request template makes it easier to click there in the github console. The CLI that programmatically generates devcontainer-lock.json always ends the file incompatible with this hook.
56+
(?x)^(
57+
.github/pull_request_template.md|
58+
template/.github/pull_request_template.md|
59+
template/.copier-answers.yml.jinja-base|
60+
template/template/.copier-answers.yml.jinja|
61+
template/.copier-answers.yml.jinja|
62+
.devcontainer/devcontainer-lock.json|
63+
.copier-answers.yml|
64+
.*\.xml|
65+
)$
6666
- id: pretty-format-json
6767
exclude: |
68-
(?x)^(
69-
.devcontainer/devcontainer.json|
70-
.devcontainer/devcontainer-lock.json|
71-
.*devcontainer.json|
72-
.*pyrightconfig.json|
73-
.*tsconfig.json|
74-
)$
68+
(?x)^(
69+
.devcontainer/devcontainer.json|
70+
.devcontainer/devcontainer-lock.json|
71+
.*devcontainer.json|
72+
.*pyrightconfig.json|
73+
.*tsconfig.json|
74+
)$
7575
args: [--autofix, --no-sort-keys]
7676

77-
- repo: https://github.com/myint/docformatter
77+
- repo: https://github.com/pre-commit/mirrors-prettier # TODO: switch to a different approach...this was archived in 2024
78+
rev: f12edd9c7be1c20cfa42420fd0e6df71e42b51ea # frozen: v4.0.0-alpha.8
79+
hooks:
80+
- id: prettier
81+
# TODO: get template YAML and MD files more in line with prettier expectations so we can start using prettier on those too
82+
exclude: |
83+
(?x)^(
84+
.devcontainer/devcontainer.json|
85+
.devcontainer/devcontainer-lock.json|
86+
.*devcontainer.json|
87+
.*pyrightconfig.json|
88+
.*tsconfig.json|
89+
.*.yaml|
90+
.*.yml|
91+
.*.md|
92+
)$
93+
94+
- repo: https://github.com/myint/docformatter
7895
# black seems to be working on formatting docstrings, but use this for now
79-
rev: eb1df347edd128b30cd3368dddc3aa65edcfac38 # tip of main that is compatible with pre-commit v4
96+
rev: eb1df347edd128b30cd3368dddc3aa65edcfac38 # tip of main that is compatible with pre-commit v4
8097
hooks:
8198
- id: docformatter
8299
exclude: (tests*)|(exceptions\.py)|(warnings\.py)
83100
args:
84-
- --in-place
85-
- --wrap-summaries=150
86-
- --wrap-descriptions=150
101+
- --in-place
102+
- --wrap-summaries=150
103+
- --wrap-descriptions=150
87104

88-
- repo: https://github.com/pamoller/xmlformatter
89-
rev: 47ae0fb9cf2a515f8a2666050fac66fd719ae530 # frozen: v0.2.8
105+
- repo: https://github.com/pamoller/xmlformatter
106+
rev: 47ae0fb9cf2a515f8a2666050fac66fd719ae530 # frozen: v0.2.8
90107
hooks:
91108
- id: xml-formatter
92109
exclude: |
93-
(?x)^(
94-
.*/__snapshots__/.*|
95-
)$
96-
110+
(?x)^(
111+
.*/__snapshots__/.*|
112+
)$
97113
98-
# Invalid File Checks
99-
- repo: https://github.com/pre-commit/pre-commit-hooks
100-
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
114+
# Invalid File Checks
115+
- repo: https://github.com/pre-commit/pre-commit-hooks
116+
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
101117
hooks:
102-
- id: check-added-large-files
103-
args: ['--maxkb=123']
118+
- id: check-added-large-files
119+
args: ["--maxkb=123"]
104120
exclude: (uv.lock)|(pnpm-lock.yaml)
105-
- id: check-json
121+
- id: check-json
106122
# exclude JSON5 or JSONC files with comments
107-
exclude: |
108-
(?x)^(
109-
.devcontainer/devcontainer.json|
110-
.devcontainer/devcontainer-lock.json|
111-
.*devcontainer.json|
112-
.*pyrightconfig.json|
113-
.*tsconfig.json|
114-
)$
115-
- id: check-yaml
123+
exclude: |
124+
(?x)^(
125+
.devcontainer/devcontainer.json|
126+
.devcontainer/devcontainer-lock.json|
127+
.*devcontainer.json|
128+
.*pyrightconfig.json|
129+
.*tsconfig.json|
130+
)$
131+
- id: check-yaml
116132
exclude: .copier-answers.yml # This is an autogenerated YAML file by Copier that throws 'found unhashable key' errors
117-
- id: check-xml
118-
- id: check-merge-conflict
119-
- id: check-case-conflict
133+
- id: check-xml
134+
- id: check-merge-conflict
135+
- id: check-case-conflict
120136

121-
- repo: https://github.com/maresb/check-json5
137+
- repo: https://github.com/maresb/check-json5
122138
rev: 893a2b5a0a27c3540bd8fcafe2968ccc05237179 # 1.0
123139
hooks:
124-
- id: check-json5
140+
- id: check-json5
125141
files: |
126-
(?x)^(
127-
.devcontainer/devcontainer.json|
128-
.devcontainer/devcontainer-lock.json|
129-
.*devcontainer.json|
130-
.*pyrightconfig.json|
131-
.*tsconfig.json|
132-
)$
133-
134-
- repo: local
142+
(?x)^(
143+
.devcontainer/devcontainer.json|
144+
.devcontainer/devcontainer-lock.json|
145+
.*devcontainer.json|
146+
.*pyrightconfig.json|
147+
.*tsconfig.json|
148+
)$
149+
150+
- repo: local
135151
hooks:
136-
- id: forbidden-files
152+
- id: forbidden-files
137153
name: forbidden files
138154
entry: found copier update rejection files; review them and remove them
139155
language: fail
140156
files: "\\.rej$"
141157

142-
# Safety/Security Issues
143-
- repo: https://github.com/pre-commit/pre-commit-hooks
144-
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
158+
# Safety/Security Issues
159+
- repo: https://github.com/pre-commit/pre-commit-hooks
160+
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
145161
hooks:
146-
- id: detect-private-key
162+
- id: detect-private-key
147163

148-
# Linting
164+
# Linting
149165

150-
- repo: https://github.com/Lucas-C/pre-commit-hooks-markup
166+
- repo: https://github.com/Lucas-C/pre-commit-hooks-markup
151167
rev: 501f3d60cee13c712492103343bc23efdc7b3d1f #v1.0.1
152168
hooks:
153-
- id: rst-linter
169+
- id: rst-linter
154170
# this hook fails on Sphinx documentation https://github.com/Lucas-C/pre-commit-hooks-markup/issues/13
155171
exclude: docs/.*\.rst$
156172

157-
- repo: https://github.com/hadolint/hadolint
158-
rev: c3dc18df7a501f02a560a2cc7ba3c69a85ca01d3 # frozen: v2.13.1-beta
173+
- repo: https://github.com/hadolint/hadolint
174+
rev: c3dc18df7a501f02a560a2cc7ba3c69a85ca01d3 # frozen: v2.13.1-beta
159175
hooks:
160-
- id: hadolint-docker
176+
- id: hadolint-docker
161177
name: Lint Dockerfiles
162178
description: Runs hadolint to lint Dockerfiles
163179

164-
- repo: https://github.com/astral-sh/ruff-pre-commit
165-
rev: 41d2daf392fbf43341a77f24a9c6481a4b66af98 # frozen: v0.9.10
180+
- repo: https://github.com/astral-sh/ruff-pre-commit
181+
rev: 99abe27a5a16f301d9e0a3828181399dfbf54ebd # frozen: v0.11.0
166182
hooks:
167-
- id: ruff
183+
- id: ruff
168184
name: ruff-src
169-
args: [ --fix, --config=./ruff.toml ]
185+
args: [--fix, --config=./ruff.toml]
170186
files: src/.+\.py$
171-
- id: ruff
187+
- id: ruff
172188
name: ruff-tests
173-
args: [ --fix, --config=./ruff-test.toml ]
189+
args: [--fix, --config=./ruff-test.toml]
174190
files: tests?/.+\.py$
175-
- id: ruff-format
191+
- id: ruff-format
176192

177-
- repo: https://github.com/pylint-dev/pylint
178-
rev: aaab3ccb541532d2bcdf0410ab93ff4fafc266f5 # frozen: v3.3.5
193+
- repo: https://github.com/pylint-dev/pylint
194+
rev: aaab3ccb541532d2bcdf0410ab93ff4fafc266f5 # frozen: v3.3.5
179195
hooks:
180-
- id: pylint
196+
- id: pylint
181197
name: pylint
182198
args:
183-
- --rcfile=./pylintrc.toml
199+
- --rcfile=./pylintrc.toml
184200
verbose: true
185201

186-
- repo: local
202+
- repo: local
187203
hooks:
188-
- id: pyright
204+
- id: pyright
189205
name: pyright
190206
entry: bash -c "uv run pyright"
191207
files: '.+\.py$'

.prettierrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"printWidth": 120,
3+
"singleQuote": false,
4+
"trailingComma": "all",
5+
"semi": true,
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"arrowParens": "always",
9+
"bracketSpacing": true,
10+
"quoteProps": "as-needed",
11+
"proseWrap": "preserve"
12+
}

copier.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ use_windows_in_ci:
2121
help: Should CI in the instantiated template also use Windows runners?
2222
default: no
2323

24+
node_version:
25+
type: str
26+
help: What version of NodeJS is used for development?
27+
default: 22.14.0
28+
29+
pnpm_version:
30+
type: str
31+
help: What version of pnpm is used for development?
32+
default: 10.6.3
33+
34+
35+
2436
python_version:
2537
type: str
2638
help: What version of Python is used for development?

0 commit comments

Comments
 (0)