-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
94 lines (76 loc) · 2.79 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# add node bin script path for recipes
export PATH := "./node_modules/.bin:" + env_var('PATH')
typesBaseURL := "https://raw.github.com/pryv/data-types/master/dist/"
eventTypesURL := typesBaseURL + "event-types.json"
flatTypesURL := typesBaseURL + "flat.json"
typesSourceTarget := "./src/event-types/_source"
# Default: display available recipes
_help:
@just --list
# –––––––––––––----------------------------------------------------------------
# Setup
# –––––––––––––----------------------------------------------------------------
# Set up the dev environment
setup:
scripts/setup
# –––––––––––––----------------------------------------------------------------
# Build & related
# –––––––––––––----------------------------------------------------------------
# Build the site from `src/` into `dist/`
build *params:
node build.js {{params}}
# Build the site then watch and update when source files change
watch *params:
node build.js --watch {{params}}
# Retrieve event types from their repo
retrieve-types:
@echo ""
@echo "Retrieving data types from {{typesBaseURL}}..."
@echo ""
@cd {{typesSourceTarget}} && curl -LO {{eventTypesURL}} -LO {{flatTypesURL}}
# Retrieve test results from their repo
retrieve-tests:
@echo ""
@echo "Retrieving test results from repo..."
@echo ""
@cd dependencies/test-results && git pull
# Clean up the contents of `dist/`
clean:
rm -rf dist/*
# Build & publish on `pryv.github.io` (a.k.a. `pryv.github.io`)
publish: retrieve-types retrieve-tests clean build
#!/bin/sh
set -e
cd dist
git add --all
git commit -m "Updated generated files"
git push
# Start a `rec.la` web server on `dist/`
serve:
rec.la ./dist
# Run code linting
lint *params:
semistandard {{params}}
# –––––––––––––----------------------------------------------------------------
# OpenAPI definitions
# –––––––––––––----------------------------------------------------------------
# Generate OpenAPI definitions (see `open-api/`)
open-api: _open-api-install _open-api-transpile _open-api-export
# Install module dependencies for OpenAPI definitions
_open-api-install:
@cd open-api && npm install
# Transpile source into `open-api/transpiled/` (code) and `open-api/rendered/` (JSON)
_open-api-transpile:
#!/bin/sh
set -e
cd open-api
coffee -c -o transpiled ../src/_reference
cp ../src/_reference/helpers.js transpiled/.
find transpiled \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i "" -e "s/\.coffee/\.js/g"
node src/render
# Export to `open-api/open-api-format/`
_open-api-export:
#!/bin/sh
set -e
cd open-api
node src/main