@canvakit/cli 0.0.0-stage → 0.2.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/LICENSE +105 -0
- package/README.md +103 -2
- package/dist/index.js +1596 -0
- package/dist/index.js.map +1 -0
- package/package.json +66 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
2
|
+
|
|
3
|
+
## Abbreviation
|
|
4
|
+
|
|
5
|
+
FSL-1.1-ALv2
|
|
6
|
+
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 AGENTIK SAS
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
+
will apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,104 @@
|
|
|
1
|
-
#
|
|
1
|
+
# canvakit (CLI)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Render, validate, and scaffold canvakit templates. Companion CLI for
|
|
4
|
+
> **[canvakit.sh](https://canvakit.sh)**.
|
|
5
|
+
|
|
6
|
+
Canvakit is the template + data-source binding standard — one file with YAML
|
|
7
|
+
frontmatter that declares tool/file/query/static data sources, and a body
|
|
8
|
+
written in a pluggable template engine (Mustache by default). See
|
|
9
|
+
**[CANVAKIT.md](https://canvakit.sh/spec)** for the full spec.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm i -g @canvakit/cli
|
|
15
|
+
# or, use it ad-hoc:
|
|
16
|
+
npx @canvakit/cli <command>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The `bin` name is `canvakit`.
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
### Scaffold a starter template
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
canvakit init my-dashboard
|
|
27
|
+
# → creates my-dashboard.canvakit.html with a working starter
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Render a template
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
canvakit render my-dashboard.canvakit.html
|
|
34
|
+
# → prints rendered HTML to stdout
|
|
35
|
+
|
|
36
|
+
canvakit render my-dashboard.canvakit.html -o dist/dashboard.html
|
|
37
|
+
# → writes to a file
|
|
38
|
+
|
|
39
|
+
canvakit render my-dashboard.canvakit.html --var title="Q2 briefing"
|
|
40
|
+
# → override template `variables` at render time (repeatable)
|
|
41
|
+
|
|
42
|
+
canvakit render my-dashboard.canvakit.html --context fixtures.json
|
|
43
|
+
# → seed `kind: tool` fixtures from a JSON file — each top-level key
|
|
44
|
+
# becomes a flat-id tool resolver that returns the matching value
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Example `fixtures.json`:**
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"stripe.mrr": { "amount": "42,180", "delta": "4,200" },
|
|
52
|
+
"searchFlights": { "flights": [{ "airline": "AF", "price": "$420" }] }
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
With these fixtures in place, a template declaring
|
|
57
|
+
`{ kind: tool, ref: stripe.mrr }` renders with the fixture value — no real
|
|
58
|
+
Stripe call, no tool registry plumbing. Useful for docs-driven rendering, CI
|
|
59
|
+
diff-testing, and `static-site generator` use cases.
|
|
60
|
+
|
|
61
|
+
### Validate a template
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
canvakit validate my-dashboard.canvakit.html
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Reports:
|
|
68
|
+
|
|
69
|
+
- frontmatter parse errors and malformed-source warnings
|
|
70
|
+
- the `(name, version)` identity tuple (required for gallery publish)
|
|
71
|
+
- `refreshEvery` sanity
|
|
72
|
+
- each declared data source's kind + ref/path
|
|
73
|
+
- for `kind: file` / `kind: query` sources: does the path exist on disk?
|
|
74
|
+
|
|
75
|
+
Exits non-zero on any hard failure so it plugs into CI.
|
|
76
|
+
|
|
77
|
+
## Canonical filename
|
|
78
|
+
|
|
79
|
+
Canvakit templates use a double extension:
|
|
80
|
+
|
|
81
|
+
- `<name>.canvakit.html` — Mustache-templated HTML (default)
|
|
82
|
+
- `<name>.canvakit.md` — Mustache-templated markdown
|
|
83
|
+
- `<name>.canvakit.mdx` — MDX-templated (future)
|
|
84
|
+
|
|
85
|
+
The `.canvakit.` infix is the recommended glob marker. The frontmatter
|
|
86
|
+
`template: true` field is a redundant safety check.
|
|
87
|
+
|
|
88
|
+
## Deferred commands
|
|
89
|
+
|
|
90
|
+
`add`, `list`, `login`, `publish` land in a later release. For now templates are
|
|
91
|
+
loaded from the local filesystem only.
|
|
92
|
+
|
|
93
|
+
## Links
|
|
94
|
+
|
|
95
|
+
- **Spec** → [CANVAKIT.md on canvakit.sh](https://canvakit.sh/spec)
|
|
96
|
+
- **Playground** → [canvakit.sh/playground](https://canvakit.sh/playground)
|
|
97
|
+
- **Gallery** → [canvakit.sh/gallery](https://canvakit.sh/gallery)
|
|
98
|
+
- **Library** → [`@canvakit/core`](https://www.npmjs.com/package/@canvakit/core)
|
|
99
|
+
|
|
100
|
+
## License
|
|
101
|
+
|
|
102
|
+
[FSL-1.1-ALv2](./LICENSE), the Functional Source License with an Apache 2.0 future
|
|
103
|
+
license: free for any use except offering a competing product or service, and
|
|
104
|
+
each version becomes Apache-2.0 two years after its release. Copyright AGENTIK SAS.
|