@overscore/cli 0.13.5 → 0.13.6
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/index.js +8 -2
- package/dist/template-push.js +7 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2599,8 +2599,14 @@ async function templatePull(slug) {
|
|
|
2599
2599
|
console.error(" npx @overscore/cli template pull mrr-tracker\n");
|
|
2600
2600
|
process.exit(1);
|
|
2601
2601
|
}
|
|
2602
|
-
|
|
2603
|
-
|
|
2602
|
+
// Refs come in as handle/slug; the stored/API key is handle_slug, and the
|
|
2603
|
+
// extract directory is just the local slug.
|
|
2604
|
+
const apiSlug = slug.replace("/", "_");
|
|
2605
|
+
const localSlug = apiSlug.includes("_")
|
|
2606
|
+
? apiSlug.slice(apiSlug.indexOf("_") + 1)
|
|
2607
|
+
: apiSlug;
|
|
2608
|
+
const targetDir = path.resolve(process.cwd(), process.argv[5] || localSlug);
|
|
2609
|
+
const url = `https://overscore.dev/api/templates/${apiSlug}/source`;
|
|
2604
2610
|
console.log(`\n Pulling template: ${slug}...`);
|
|
2605
2611
|
let res;
|
|
2606
2612
|
try {
|
package/dist/template-push.js
CHANGED
|
@@ -36,7 +36,8 @@ import path from "path";
|
|
|
36
36
|
import { execSync } from "child_process";
|
|
37
37
|
const HUB_URL = "https://overscore.dev";
|
|
38
38
|
// Mirrors the templates_slug_format CHECK in the marketplace migration.
|
|
39
|
-
|
|
39
|
+
// `_` is the handle namespace delimiter in the stored slug ({handle}_{local}).
|
|
40
|
+
const TEMPLATE_SLUG_RE = /^[a-z0-9]([a-z0-9_-]*[a-z0-9])?$/;
|
|
40
41
|
function isValidTemplateSlug(slug) {
|
|
41
42
|
return (slug.length >= 1 &&
|
|
42
43
|
slug.length <= 100 &&
|
|
@@ -185,7 +186,10 @@ function collectTemplateSourceFiles(dir, prefix, skipped) {
|
|
|
185
186
|
}
|
|
186
187
|
// ── Command ──────────────────────────────────────────────────────────────────
|
|
187
188
|
export async function templatePush(slugArg) {
|
|
188
|
-
|
|
189
|
+
// Refs come in as handle/slug; the stored/API key is handle_slug. A pulled
|
|
190
|
+
// template's .overscore/template.json already stores the handle_slug form.
|
|
191
|
+
const rawSlug = slugArg || readPulledTemplateSlug();
|
|
192
|
+
const slug = rawSlug ? rawSlug.replace("/", "_") : null;
|
|
189
193
|
if (!slug) {
|
|
190
194
|
console.error(`
|
|
191
195
|
Usage: npx @overscore/cli template push [template-slug]
|
|
@@ -296,7 +300,7 @@ export async function templatePush(slugArg) {
|
|
|
296
300
|
const sourceCount = sourceFiles.length;
|
|
297
301
|
const listingUrl = data.detail_url
|
|
298
302
|
? `${HUB_URL}${data.detail_url}`
|
|
299
|
-
: `${HUB_URL}/explore/${slug}`;
|
|
303
|
+
: `${HUB_URL}/explore/${slug.replace("_", "/")}`;
|
|
300
304
|
console.log(`
|
|
301
305
|
Pushed successfully!
|
|
302
306
|
|