create-actuate 0.1.2 → 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/dist/bin.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  scaffold
4
- } from "./chunk-OPZ7TO7T.js";
4
+ } from "./chunk-24GQNKSL.js";
5
5
 
6
6
  // src/bin.ts
7
7
  import { relative } from "path";
@@ -77,6 +77,9 @@ function scaffoldFiles(name, actuatorSource, extra = {}) {
77
77
  }
78
78
  async function fetchTemplate(template, ref, doFetch) {
79
79
  if (!/^[a-z0-9][a-z0-9-]*$/.test(template)) throw new Error(`Invalid template name "${template}"`);
80
+ if (!/^[A-Za-z0-9][A-Za-z0-9._/-]*$/.test(ref) || ref.split("/").some((part) => part === "." || part === "..")) {
81
+ throw new Error(`Invalid git ref "${ref}"`);
82
+ }
80
83
  const raw = (file) => `https://raw.githubusercontent.com/${TEMPLATES_REPO}/${ref}/${template}/${file}`;
81
84
  const res = await doFetch(raw("actuator.ts"));
82
85
  if (!res.ok) {
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  TEMPLATES_REPO,
5
5
  scaffold,
6
6
  scaffoldFiles
7
- } from "./chunk-OPZ7TO7T.js";
7
+ } from "./chunk-24GQNKSL.js";
8
8
  export {
9
9
  HELLO_ACTUATOR,
10
10
  SDK_VERSION,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-actuate",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "Scaffold an Actuate actuator: npm create actuate [dir] -- --template <name>",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",