https://github.com/cube-js/post-installer
https://github.com/cube-js/post-installer
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/cube-js/post-installer
- Owner: cube-js
- License: other
- Created: 2023-05-31T11:40:15.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-07-08T10:36:24.000Z (over 1 year ago)
- Last Synced: 2025-03-26T18:03:30.986Z (9 months ago)
- Language: JavaScript
- Size: 72.3 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @cubejs-infra/post-installer
> Easiest way to download files on post installation step of you npm package.
# Usage example
1. First you need to define `resources` section under coresponding `package.json` file of your package.
```json
{
"resources": {
"files": [{
"host": "https://github.com/cube-js/cube/releases/download/v${version}/",
"path": "native-${platform}-${arch}-${libc}-${libpython_or_fallback}.tar.gz",
}]
}
}
```
# Additional
## Constraints
Variables and files supports contstraints, you can define it:
```
"constraints": {
"platform": [
"linux"
],
"arch": [
"x64"
]
}
```
Supported types:
- platform: `win32` / `darwin` / `linux` / `aix` / `android` / `freebsd` / `openbsd` / `cygwin`
- arch: `x64` / `arm64`
- platform-arch: `linux-x64`, etc.
## Variables
You can define and use variables in `path` & `host`.
```json
{
"vars": {
"libpython_or_fallback": {
"default": "fallback",
"value": [
"libpython",
[
"3.11",
"3.10",
"3.9"
]
],
"constraints": {
"platform": [
"linux"
],
"arch": [
"x64"
]
}
}
},
}
```
Next you can use this variable in the url via `/file/${libpython_or_fallback}.tar.gz`
# LICENSE
Apache-2.0