Merge branch 'origin/main'
This commit is contained in:
commit
10a8f5d2f2
.woodpecker.ymlTaskfile.yml
api
web
.eslintignore.eslintrc
.yarn/cache
@ampproject-remapping-npm-2.2.0-114878fa50-d74d170d06.zip@ampproject-remapping-npm-2.3.0-559c14eee4-d3ad7b89d9.zip@babel-code-frame-npm-7.18.6-25229a7e34-195e2be317.zip@babel-code-frame-npm-7.25.7-40a9f53f43-f235cdf9c5.zip@babel-compat-data-npm-7.20.1-4eea2d1c20-989b9b7a6f.zip@babel-compat-data-npm-7.25.7-81c45097d1-d1188aed1f.zip@babel-core-npm-7.20.2-7fb00344fc-98faaaef26.zip@babel-core-npm-7.25.7-27df82c8ce-80560a962e.zip@babel-generator-npm-7.20.4-97edf6df16-967b59f18e.zip@babel-generator-npm-7.25.7-68dd72ad91-f81cf9dc01.zip@babel-helper-annotate-as-pure-npm-7.18.6-36e25293d8-88ccd15ced.zip@babel-helper-compilation-targets-npm-7.20.0-f842a8700a-bc183f2109.zip@babel-helper-compilation-targets-npm-7.25.7-912ef98d47-5b57e7d4b9.zip@babel-helper-environment-visitor-npm-7.18.9-9f5b3635a1-b25101f616.zip@babel-helper-function-name-npm-7.19.0-5bcf55236f-eac1f5db42.zip@babel-helper-hoist-variables-npm-7.18.6-6eb061f405-fd9c35bb43.zip@babel-helper-module-imports-npm-7.18.6-1031faa864-f393f8a3b3.zip@babel-helper-module-imports-npm-7.25.7-f7b3a083a0-a7255755e9.zip@babel-helper-module-transforms-npm-7.20.2-9a4905d6a2-33a60ca115.zip@babel-helper-module-transforms-npm-7.25.7-01310522f0-b1daeded78.zip@babel-helper-plugin-utils-npm-7.20.2-63f605bb73-f6cae53b7f.zip@babel-helper-plugin-utils-npm-7.25.7-0b7fcf14ca-eef4450361.zip@babel-helper-simple-access-npm-7.20.2-842ec98fbb-ad1e96ee2e.zip@babel-helper-simple-access-npm-7.25.7-3a9e5cd6e8-684d0b0330.zip@babel-helper-split-export-declaration-npm-7.18.6-53ebf8ad4c-c6d3dede53.zip@babel-helper-string-parser-npm-7.19.4-0db110dc3a-b2f8a3920b.zip@babel-helper-string-parser-npm-7.24.1-0a40ece7f8-8404e865b0.zip@babel-helper-string-parser-npm-7.25.7-352069de58-0835fda5ef.zip@babel-helper-validator-identifier-npm-7.16.7-8599fb00fc-dbb3db9d18.zip@babel-helper-validator-identifier-npm-7.19.1-d84f19e1dc-0eca5e86a7.zip@babel-helper-validator-identifier-npm-7.24.5-d1938535fe-75d6f9f475.zip@babel-helper-validator-identifier-npm-7.25.7-1c758f0472-062f55208d.zip@babel-helper-validator-option-npm-7.18.6-cc7d1a3315-f9cc6eb7cc.zip@babel-helper-validator-option-npm-7.25.7-8c969bf588-87b801fe7d.zip@babel-helpers-npm-7.20.1-3ab5411f3a-be35f78666.zip@babel-helpers-npm-7.25.7-267b4cec46-a732428509.zip@babel-highlight-npm-7.18.6-9d35ad2e27-92d8ee6154.zip@babel-highlight-npm-7.25.7-308b20da71-b6aa45c5bf.zip@babel-parser-npm-7.20.3-dba5e30700-33bcdb45de.zip@babel-parser-npm-7.24.5-a19c3b8c3b-a251ea41bf.zip@babel-parser-npm-7.25.7-3b9bdaa40d-7c40c2881e.zip@babel-plugin-syntax-jsx-npm-7.18.6-3e378d5f11-6d37ea9729.zip@babel-plugin-transform-react-display-name-npm-7.18.6-dad446a24b-51c087ab9e.zip@babel-plugin-transform-react-jsx-development-npm-7.18.6-1b4b00c77d-ec9fa65db6.zip@babel-plugin-transform-react-jsx-npm-7.19.0-a26bc7e3f9-d7d6f0b8f2.zip@babel-plugin-transform-react-jsx-self-npm-7.25.7-1a6e2e6ec0-bce354e287.zip@babel-plugin-transform-react-jsx-source-npm-7.25.7-1f60cac636-1f87d8fa16.zip@babel-plugin-transform-react-pure-annotations-npm-7.18.6-ed47d931a2-97c4873d40.zip@babel-preset-react-npm-7.18.6-d1cea43c32-540d9cf0a0.zip@babel-runtime-npm-7.25.7-67dab27f3f-1d6133ed1c.zip@babel-template-npm-7.18.10-b6d6fdbaf8-93a6aa094a.zip@babel-template-npm-7.25.7-4db3590fa2-83f025a4a7.zip@babel-traverse-npm-7.20.1-569a25513a-6696176d57.zip@babel-traverse-npm-7.25.7-0ca7b771fb-4d329b6e7a.zip@babel-types-npm-7.17.10-3d8801c555-40cfc3f43a.zip@babel-types-npm-7.20.2-0e6581f12d-57e76e5f21.zip@babel-types-npm-7.24.5-2710b35119-8eeeacd996.zip@babel-types-npm-7.25.7-067945f10b-a63a3ecdac.zip@emotion-is-prop-valid-npm-1.2.2-53f93f2b2d-61f6b128ea.zip@emotion-memoize-npm-0.8.1-9b1e35ff15-a19cc01a29.zip@emotion-unitless-npm-0.8.1-bcf0a8f565-385e21d184.zip@esbuild-darwin-arm64-npm-0.21.5-62349c1520-8.zip@eslint-community-eslint-utils-npm-4.4.0-d1791bd5a3-cdfe3ae42b.zip@eslint-community-regexpp-npm-4.11.1-37bbb67aaa-6986685529.zip@eslint-eslintrc-npm-2.1.4-1ff4b5f908-10957c7592.zip@eslint-js-npm-8.57.1-dec269f278-2afb77454c.zip@fluentui-react-component-event-listener-npm-0.63.1-c9f86c7846-9ad5657a08.zip@fluentui-react-component-ref-npm-0.63.1-e73ab076ce-e63ab04445.zip@gar-promisify-npm-1.1.3-ac1a325862-4059f790e2.zip@gilbarbara-deep-equal-npm-0.1.1-79df769738-d904761847.zip@humanwhocodes-config-array-npm-0.13.0-843095a032-eae69ff913.zip@humanwhocodes-module-importer-npm-1.0.1-9d07ed2e4a-0fd22007db.zip@humanwhocodes-object-schema-npm-2.0.3-4f0e508cd9-d3b78f6c58.zip@icons-material-npm-0.2.4-7c2363ec33-24baa360cb.zip@jridgewell-gen-mapping-npm-0.1.1-3bad172ac6-3bcc21fe78.zip@jridgewell-gen-mapping-npm-0.3.2-c64eeb4a4e-1832707a1c.zip@jridgewell-gen-mapping-npm-0.3.5-d8b85ebeaf-ff7a1764eb.zip@jridgewell-resolve-uri-npm-3.1.0-6ff2351e61-b5ceaaf9a1.zip@jridgewell-resolve-uri-npm-3.1.2-5bc4245992-83b85f72c5.zip@jridgewell-set-array-npm-1.1.2-45b82d7fb6-69a84d5980.zip@jridgewell-set-array-npm-1.2.1-2312928209-832e513a85.zip@jridgewell-sourcemap-codec-npm-1.4.14-f5f0630788-61100637b6.zip@jridgewell-sourcemap-codec-npm-1.4.15-a055fb62cf-b881c7e503.zip@jridgewell-trace-mapping-npm-0.3.17-57578fd48c-9d703b859c.zip@jridgewell-trace-mapping-npm-0.3.25-c076fd2279-9d3c40d225.zip@mdit-vue-plugin-component-npm-0.11.1-625d9b977d-dc56ed5f3b.zip@nodelib-fs.scandir-npm-2.1.5-89c67370dd-a970d595bd.zip@nodelib-fs.stat-npm-2.0.5-01f4dd3030-012480b5ca.zip@nodelib-fs.walk-npm-1.2.8-b4a89da548-190c643f15.zip@npmcli-fs-npm-2.1.2-08d434e77b-405074965e.zip@npmcli-move-file-npm-2.0.1-b593d8f741-52dc02259d.zip@pity-vite-plugin-react-markdown-npm-0.1.1-36e1a5f816-3f3bd836d5.zip@popperjs-core-npm-2.11.8-f1692e11a0-e5c69fdebf.zip
@ -8,13 +8,6 @@ steps:
|
||||
- VITE_API_URL=https://api.treadl.com
|
||||
- VITE_IMAGINARY_URL=https://images.treadl.com
|
||||
- VITE_SENTRY_DSN=https://7c88f77dd19c57bfb92bb9eb53e33c4b@o4508066290532352.ingest.de.sentry.io/4508075022090320
|
||||
- VITE_SOURCE_REPO_URL=https://git.wilw.dev/wilw/treadl
|
||||
- VITE_PATREON_URL=https://www.patreon.com/treadl
|
||||
- VITE_KOFI_URL=https://ko-fi.com/wilw88
|
||||
- VITE_IOS_APP_URL=https://apps.apple.com/gb/app/treadl/id1525094357
|
||||
- "VITE_ANDROID_APP_URL=https://play.google.com/store/apps/details/Treadl?id=com.treadl"
|
||||
- VITE_CONTACT_EMAIL=hello@treadl.com
|
||||
- VITE_APP_NAME=Treadl
|
||||
commands:
|
||||
- cd web
|
||||
- npm install
|
||||
|
22
Taskfile.yml
22
Taskfile.yml
@ -94,3 +94,25 @@ tasks:
|
||||
cmds:
|
||||
- echo "Building Docker image..."
|
||||
- docker build -f docker/Dockerfile -t wilw/treadl --platform linux/amd64,linux/arm64 .
|
||||
|
||||
deploy:
|
||||
desc: Deploy all
|
||||
deps:
|
||||
- deploy-web
|
||||
- deploy-api
|
||||
|
||||
deploy-web:
|
||||
desc: Deploy web front-end
|
||||
dir: 'web'
|
||||
cmds:
|
||||
- npm install
|
||||
- npx vite build
|
||||
- aws --profile personal s3 sync dist s3://treadl.com
|
||||
- 'curl -X POST -H "AccessKey: $BUNNY_PERSONAL" https://api.bunny.net/pullzone/782753/purgeCache'
|
||||
|
||||
deploy-api:
|
||||
desc: Deploy API
|
||||
dir: 'api'
|
||||
cmds:
|
||||
- docker build -t wilw/treadl-api --platform linux/amd64 .
|
||||
- docker push wilw/treadl-api
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM python:3.12-slim
|
||||
FROM amd64/python:3.12-slim
|
||||
|
||||
# set work directory
|
||||
WORKDIR /app
|
||||
|
@ -12,6 +12,7 @@ default_pattern = {
|
||||
"defaultColour": "178,53,111",
|
||||
"defaultSpacing": 1,
|
||||
"defaultThickness": 1,
|
||||
"guideFrequency": 8,
|
||||
},
|
||||
"weft": {
|
||||
"treadles": 8,
|
||||
@ -19,6 +20,7 @@ default_pattern = {
|
||||
"defaultColour": "53,69,178",
|
||||
"defaultSpacing": 1,
|
||||
"defaultThickness": 1,
|
||||
"guideFrequency": 8,
|
||||
},
|
||||
"tieups": [[]] * 8,
|
||||
"colours": [
|
||||
|
@ -233,6 +233,7 @@ def loads(wif_file):
|
||||
draft["warp"]["threading"][int(x) - 1] = {"shaft": shaft}
|
||||
if shaft > draft["warp"]["shafts"]:
|
||||
draft["warp"]["shafts"] = shaft
|
||||
draft["warp"]["guideFrequency"] = draft["warp"]["shafts"]
|
||||
try:
|
||||
warp_colours = config["warp colors"]
|
||||
for x in warp_colours:
|
||||
@ -269,6 +270,7 @@ def loads(wif_file):
|
||||
draft["weft"]["treadling"][int(x) - 1] = {"treadle": treadle}
|
||||
if treadle > draft["weft"]["treadles"]:
|
||||
draft["weft"]["treadles"] = treadle
|
||||
draft["weft"]["guideFrequency"] = draft["weft"]["treadles"]
|
||||
try:
|
||||
weft_colours = config["weft colors"]
|
||||
for x in weft_colours:
|
||||
@ -359,6 +361,9 @@ def draw_image(obj, with_plan=False):
|
||||
drawdown_left = warp_left if with_plan else 0
|
||||
drawdown_bottom = weft_bottom if with_plan else full_height
|
||||
|
||||
warp_guides = warp.get("guideFrequency") or 0
|
||||
weft_guides = weft.get("guideFrequency") or 0
|
||||
|
||||
WHITE = (255, 255, 255)
|
||||
GREY = (150, 150, 150)
|
||||
BLACK = (0, 0, 0)
|
||||
@ -384,7 +389,10 @@ def draw_image(obj, with_plan=False):
|
||||
width=1,
|
||||
joint=None,
|
||||
)
|
||||
col_index = 1
|
||||
for i, x in enumerate(range(len(warp["threading"]) - 1, 0, -1)):
|
||||
is_guide = warp_guides and col_index % warp_guides == 0
|
||||
col_index += 1
|
||||
thread = warp["threading"][i]
|
||||
xcoord = x * BASE_SIZE
|
||||
draw.line(
|
||||
@ -392,8 +400,8 @@ def draw_image(obj, with_plan=False):
|
||||
(xcoord, warp_top),
|
||||
(xcoord, warp_bottom),
|
||||
],
|
||||
fill=GREY,
|
||||
width=1,
|
||||
fill=BLACK if is_guide else GREY,
|
||||
width=2 if is_guide else 1,
|
||||
joint=None,
|
||||
)
|
||||
if thread.get("shaft", 0) > 0:
|
||||
@ -433,7 +441,10 @@ def draw_image(obj, with_plan=False):
|
||||
width=1,
|
||||
joint=None,
|
||||
)
|
||||
row_index = 0
|
||||
for i, y in enumerate(range(0, len(weft["treadling"]))):
|
||||
is_guide = weft_guides and row_index % weft_guides == 0
|
||||
row_index += 1
|
||||
thread = weft["treadling"][i]
|
||||
ycoord = weft_top + y * BASE_SIZE
|
||||
draw.line(
|
||||
@ -441,8 +452,8 @@ def draw_image(obj, with_plan=False):
|
||||
(weft_left, ycoord),
|
||||
(weft_right, ycoord),
|
||||
],
|
||||
fill=GREY,
|
||||
width=1,
|
||||
fill=BLACK if is_guide else GREY,
|
||||
width=2 if is_guide else 1,
|
||||
joint=None,
|
||||
)
|
||||
if thread.get("treadle", 0) > 0:
|
||||
@ -521,7 +532,9 @@ def draw_image(obj, with_plan=False):
|
||||
shaft = 0 if warp_thread["shaft"] > warp["shafts"] else warp_thread["shaft"]
|
||||
|
||||
# Work out if should be warp or weft in "front"
|
||||
tieup = tieups[treadle - 1] if treadle > 0 else []
|
||||
tieup = (
|
||||
tieups[treadle - 1] if (treadle > 0 and treadle <= len(tieups)) else []
|
||||
)
|
||||
tieup = [t for t in tieup if t <= warp["shafts"]]
|
||||
thread_type = "warp" if shaft in tieup else "weft"
|
||||
|
||||
|
@ -1,2 +0,0 @@
|
||||
node_modules/
|
||||
build/
|
@ -1,17 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true
|
||||
},
|
||||
"extends": ["react-app", "airbnb"],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 6,
|
||||
"sourceType": "module",
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"no-underscore-dangle": [2, { "allow": ["_id"] }],
|
||||
"max-len": 0
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user