@sablier/devkit 1.12.1 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -13
- package/biome/ui.jsonc +3 -0
- package/just/base.just +1 -1
- package/just/vercel.just +109 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ Extend the base Biome configuration in your `biome.jsonc`:
|
|
|
26
26
|
|
|
27
27
|
```jsonc
|
|
28
28
|
{
|
|
29
|
-
"$schema": "https://biomejs.dev/schemas/
|
|
29
|
+
"$schema": "https://biomejs.dev/schemas/latest/schema.json",
|
|
30
30
|
"extends": ["@sablier/devkit/biome"],
|
|
31
31
|
}
|
|
32
32
|
```
|
|
@@ -116,25 +116,31 @@ Available modules:
|
|
|
116
116
|
| Module | Description |
|
|
117
117
|
| --------------- | ------------------------------- |
|
|
118
118
|
| `base.just` | Common development recipes |
|
|
119
|
-
| `
|
|
119
|
+
| `csv.just` | CSV/TSV validation with qsv |
|
|
120
120
|
| `evm.just` | EVM/Foundry tooling |
|
|
121
|
-
| `
|
|
121
|
+
| `npm.just` | NPM package management |
|
|
122
122
|
| `settings.just` | Just settings and configuration |
|
|
123
|
+
| `vercel.just` | Vercel build and deploy |
|
|
123
124
|
|
|
124
125
|
## ⚙️ Available Configs
|
|
125
126
|
|
|
126
|
-
| Tool
|
|
127
|
-
|
|
|
128
|
-
| 🔍 Biome
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
|
127
|
+
| Tool | Config File/Directory |
|
|
128
|
+
| ----------- | ---------------------------------------- |
|
|
129
|
+
| 🔍 Biome | [`biome/`](./biome/) |
|
|
130
|
+
| 🛠 Just | [`just/`](./just/) |
|
|
131
|
+
| ✨ Prettier | [`.prettierrc.json`](./.prettierrc.json) |
|
|
132
|
+
| 📦 TSConfig | [`tsconfig/`](./tsconfig/) |
|
|
133
|
+
| 🧪 Vitest | [`vitest/`](./vitest/) |
|
|
134
|
+
| 💻 VSCode | [`vscode/`](./vscode/) |
|
|
134
135
|
|
|
135
136
|
## 🐈⬛ GitHub Actions
|
|
136
137
|
|
|
137
|
-
|
|
138
|
+
Reusable composite actions for GitHub CI workflows.
|
|
139
|
+
|
|
140
|
+
| Action | Description |
|
|
141
|
+
| --------------------------------------------- | ------------------------------------------ |
|
|
142
|
+
| [`actions/setup`](./actions/setup/) | Install dependencies (Node.js, Just, etc.) |
|
|
143
|
+
| [`actions/node-cache`](./actions/node-cache/) | Cache Node.js dependencies |
|
|
138
144
|
|
|
139
145
|
```yaml
|
|
140
146
|
- uses: sablier-labs/devkit/actions/setup@main
|
|
@@ -150,4 +156,4 @@ Contributions are welcome! Please feel free to submit a Pull Request.
|
|
|
150
156
|
|
|
151
157
|
## 📄 License
|
|
152
158
|
|
|
153
|
-
This project is licensed under MIT.
|
|
159
|
+
This project is licensed under MIT — see the [LICENSE](LICENSE.md) file for details.
|
package/biome/ui.jsonc
CHANGED
|
@@ -37,6 +37,9 @@
|
|
|
37
37
|
"noSvgWithoutTitle": "off",
|
|
38
38
|
"useKeyWithClickEvents": "off"
|
|
39
39
|
},
|
|
40
|
+
"correctness": {
|
|
41
|
+
"useExhaustiveDependencies": "off" // doesn't work with React Compiler: https://github.com/biomejs/biome/issues/5293
|
|
42
|
+
},
|
|
40
43
|
"nursery": {
|
|
41
44
|
// Sort Tailwind CSS classes alphabetically
|
|
42
45
|
// See https://github.com/biomejs/biome/issues/1274#issuecomment-3490774696
|
package/just/base.just
CHANGED
package/just/vercel.just
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import "./settings.just"
|
|
2
|
+
|
|
3
|
+
# ---------------------------------------------------------------------------- #
|
|
4
|
+
# DEPENDENCIES #
|
|
5
|
+
# ---------------------------------------------------------------------------- #
|
|
6
|
+
|
|
7
|
+
# Ni: https://github.com/antfu-collective/ni
|
|
8
|
+
na := require("na")
|
|
9
|
+
|
|
10
|
+
# ---------------------------------------------------------------------------- #
|
|
11
|
+
# CONSTANTS #
|
|
12
|
+
# ---------------------------------------------------------------------------- #
|
|
13
|
+
|
|
14
|
+
# Consumer MUST override with a JSON map of app name → Vercel project ID.
|
|
15
|
+
# Example: '{"portal": "prj_xxx", "landing": "prj_yyy"}'
|
|
16
|
+
VERCEL_PROJECT_IDS := '{}'
|
|
17
|
+
|
|
18
|
+
# ---------------------------------------------------------------------------- #
|
|
19
|
+
# RECIPES #
|
|
20
|
+
# ---------------------------------------------------------------------------- #
|
|
21
|
+
|
|
22
|
+
# Build website for Vercel deployment
|
|
23
|
+
[arg("app", long)]
|
|
24
|
+
[arg("env", long)]
|
|
25
|
+
[group("vercel")]
|
|
26
|
+
build app env="staging":
|
|
27
|
+
@just _vercel-build "{{ app }}" "{{ env }}"
|
|
28
|
+
alias b := build
|
|
29
|
+
|
|
30
|
+
# Deploy website to Vercel
|
|
31
|
+
[arg("app", long)]
|
|
32
|
+
[arg("env", long)]
|
|
33
|
+
[arg("skip_build", long="skip-build", value="true")]
|
|
34
|
+
[confirm("Are you sure you want to deploy? [y/N]")]
|
|
35
|
+
[group("vercel")]
|
|
36
|
+
deploy app env="staging" skip_build="false":
|
|
37
|
+
@just _vercel-deploy "{{ app }}" "{{ env }}" "{{ skip_build }}"
|
|
38
|
+
alias d := deploy
|
|
39
|
+
|
|
40
|
+
# ---------------------------------------------------------------------------- #
|
|
41
|
+
# PRIVATE HELPERS #
|
|
42
|
+
# ---------------------------------------------------------------------------- #
|
|
43
|
+
|
|
44
|
+
# Core build: vercel pull + vercel build
|
|
45
|
+
[private, script("python3")]
|
|
46
|
+
_vercel-build app env:
|
|
47
|
+
import json, os, subprocess, sys
|
|
48
|
+
|
|
49
|
+
def run(*cmd):
|
|
50
|
+
result = subprocess.run(cmd)
|
|
51
|
+
if result.returncode != 0:
|
|
52
|
+
sys.exit(result.returncode)
|
|
53
|
+
|
|
54
|
+
# Workaround for https://github.com/vercel/vercel/issues/14666
|
|
55
|
+
os.environ["VERCEL_TARGET_ENV"] = "{{ env }}"
|
|
56
|
+
os.environ["NEXT_PUBLIC_VERCEL_TARGET_ENV"] = "{{ env }}"
|
|
57
|
+
|
|
58
|
+
# Resolve project ID from app name
|
|
59
|
+
project_ids = json.loads('{{ VERCEL_PROJECT_IDS }}')
|
|
60
|
+
app = "{{ app }}"
|
|
61
|
+
if app not in project_ids:
|
|
62
|
+
print(f"Error: unknown app '{app}'. Known apps: {', '.join(project_ids) or '(none)'}", file=sys.stderr)
|
|
63
|
+
sys.exit(1)
|
|
64
|
+
os.environ["VERCEL_PROJECT_ID"] = project_ids[app]
|
|
65
|
+
|
|
66
|
+
token = os.environ.get("VERCEL_TOKEN", "")
|
|
67
|
+
if not token:
|
|
68
|
+
print("Error: VERCEL_TOKEN is not set.", file=sys.stderr)
|
|
69
|
+
sys.exit(1)
|
|
70
|
+
|
|
71
|
+
# Pull the environment from the Vercel project
|
|
72
|
+
run("na", "vercel", "pull", "--environment={{ env }}", f"--token={token}", "--yes")
|
|
73
|
+
|
|
74
|
+
# Build the project
|
|
75
|
+
run("na", "vercel", "build", "--target={{ env }}", f"--token={token}")
|
|
76
|
+
|
|
77
|
+
# Core deploy: optionally build, then deploy prebuilt artifacts
|
|
78
|
+
[private, script("python3")]
|
|
79
|
+
_vercel-deploy app env skip_build="false":
|
|
80
|
+
import json, os, subprocess, sys
|
|
81
|
+
|
|
82
|
+
def run(*cmd):
|
|
83
|
+
result = subprocess.run(cmd)
|
|
84
|
+
if result.returncode != 0:
|
|
85
|
+
sys.exit(result.returncode)
|
|
86
|
+
|
|
87
|
+
# Build the project if not skipped (calls the PUBLIC recipe so consumer overrides apply)
|
|
88
|
+
if "{{ skip_build }}" != "true":
|
|
89
|
+
run("just", "build", "--app={{ app }}", "--env={{ env }}")
|
|
90
|
+
|
|
91
|
+
# Workaround for https://github.com/vercel/vercel/issues/14666
|
|
92
|
+
os.environ["VERCEL_TARGET_ENV"] = "{{ env }}"
|
|
93
|
+
os.environ["NEXT_PUBLIC_VERCEL_TARGET_ENV"] = "{{ env }}"
|
|
94
|
+
|
|
95
|
+
# Resolve project ID from app name
|
|
96
|
+
project_ids = json.loads('{{ VERCEL_PROJECT_IDS }}')
|
|
97
|
+
app = "{{ app }}"
|
|
98
|
+
if app not in project_ids:
|
|
99
|
+
print(f"Error: unknown app '{app}'. Known apps: {', '.join(project_ids) or '(none)'}", file=sys.stderr)
|
|
100
|
+
sys.exit(1)
|
|
101
|
+
os.environ["VERCEL_PROJECT_ID"] = project_ids[app]
|
|
102
|
+
|
|
103
|
+
token = os.environ.get("VERCEL_TOKEN", "")
|
|
104
|
+
if not token:
|
|
105
|
+
print("Error: VERCEL_TOKEN is not set.", file=sys.stderr)
|
|
106
|
+
sys.exit(1)
|
|
107
|
+
|
|
108
|
+
# Deploy the project to Vercel
|
|
109
|
+
run("na", "vercel", "deploy", "--prebuilt", "--target={{ env }}", f"--token={token}")
|
package/package.json
CHANGED