ship-em 0.2.1 → 0.2.3
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 +30 -38
- package/dist/lib.d.ts +0 -2
- package/dist/lib.js +20 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1599,8 +1599,7 @@ var CloudflarePages = class {
|
|
|
1599
1599
|
this.client = axios.create({
|
|
1600
1600
|
baseURL: CF_API_BASE,
|
|
1601
1601
|
headers: {
|
|
1602
|
-
Authorization: `Bearer ${apiToken}
|
|
1603
|
-
"Content-Type": "application/json"
|
|
1602
|
+
Authorization: `Bearer ${apiToken}`
|
|
1604
1603
|
},
|
|
1605
1604
|
timeout: CF_REQUEST_TIMEOUT_MS
|
|
1606
1605
|
});
|
|
@@ -1701,9 +1700,12 @@ var CloudflarePages = class {
|
|
|
1701
1700
|
let requiredFiles;
|
|
1702
1701
|
let deployment;
|
|
1703
1702
|
try {
|
|
1703
|
+
const deployFormData = new FormData();
|
|
1704
|
+
deployFormData.append("manifest", JSON.stringify(manifest));
|
|
1705
|
+
deployFormData.append("branch", "main");
|
|
1704
1706
|
const res = await this.client.post(
|
|
1705
1707
|
`/accounts/${this.accountId}/pages/projects/${projectName}/deployments`,
|
|
1706
|
-
|
|
1708
|
+
deployFormData,
|
|
1707
1709
|
{ timeout: CF_REQUEST_TIMEOUT_MS }
|
|
1708
1710
|
);
|
|
1709
1711
|
if (!res.data.success) {
|
|
@@ -1777,9 +1779,12 @@ var CloudflarePages = class {
|
|
|
1777
1779
|
let requiredFiles;
|
|
1778
1780
|
let deployment;
|
|
1779
1781
|
try {
|
|
1782
|
+
const deployFormData = new FormData();
|
|
1783
|
+
deployFormData.append("manifest", JSON.stringify(manifest));
|
|
1784
|
+
deployFormData.append("branch", branch);
|
|
1780
1785
|
const res = await this.client.post(
|
|
1781
1786
|
`/accounts/${this.accountId}/pages/projects/${projectName}/deployments`,
|
|
1782
|
-
|
|
1787
|
+
deployFormData,
|
|
1783
1788
|
{ timeout: CF_REQUEST_TIMEOUT_MS }
|
|
1784
1789
|
);
|
|
1785
1790
|
if (!res.data.success) {
|
|
@@ -2501,8 +2506,8 @@ async function deployCommand(options) {
|
|
|
2501
2506
|
} else {
|
|
2502
2507
|
uploadSpinner.succeed("Deployed successfully");
|
|
2503
2508
|
}
|
|
2504
|
-
liveUrl = response.data.url;
|
|
2505
|
-
projectId = response.data.projectId;
|
|
2509
|
+
liveUrl = response.data.data.url;
|
|
2510
|
+
projectId = response.data.data.projectId;
|
|
2506
2511
|
} catch (err) {
|
|
2507
2512
|
if (err instanceof AuthError || err instanceof NetworkError || err instanceof DeployError) {
|
|
2508
2513
|
throw err;
|
|
@@ -2743,63 +2748,50 @@ import chalk5 from "chalk";
|
|
|
2743
2748
|
var TEMPLATES = [
|
|
2744
2749
|
{
|
|
2745
2750
|
name: "astro-blog",
|
|
2746
|
-
description: "Astro blog with Markdown
|
|
2751
|
+
description: "Astro blog with Markdown support",
|
|
2747
2752
|
framework: "astro",
|
|
2748
|
-
createCmd: ["npm", "create", "astro@latest", "--", "--template", "blog"]
|
|
2749
|
-
postScaffold: ["npx", "astro", "add", "mdx", "--yes"]
|
|
2753
|
+
createCmd: ["npm", "create", "astro@latest", "--", "--template", "blog"]
|
|
2750
2754
|
},
|
|
2751
2755
|
{
|
|
2752
2756
|
name: "nextjs-saas",
|
|
2753
|
-
description: "Next.js SaaS starter with App Router
|
|
2757
|
+
description: "Next.js SaaS starter with App Router",
|
|
2754
2758
|
framework: "nextjs",
|
|
2755
|
-
createCmd: ["npx", "create-next-app@latest", "--", "--
|
|
2759
|
+
createCmd: ["npx", "create-next-app@latest", "--", "--app", "--ts", "--tailwind", "--eslint", "--src-dir"]
|
|
2756
2760
|
},
|
|
2757
2761
|
{
|
|
2758
2762
|
name: "vite-react",
|
|
2759
|
-
description: "Vite + React + TypeScript
|
|
2760
|
-
framework: "vite
|
|
2763
|
+
description: "Vite + React + TypeScript starter",
|
|
2764
|
+
framework: "vite",
|
|
2761
2765
|
createCmd: ["npm", "create", "vite@latest", "--", "--template", "react-ts"]
|
|
2762
2766
|
},
|
|
2763
2767
|
{
|
|
2764
2768
|
name: "sveltekit-app",
|
|
2765
|
-
description: "SvelteKit full-stack app
|
|
2769
|
+
description: "SvelteKit full-stack app",
|
|
2766
2770
|
framework: "sveltekit",
|
|
2767
|
-
createCmd: ["
|
|
2771
|
+
createCmd: ["npx", "sv", "create", "--", "--template", "minimal", "--types", "ts"]
|
|
2768
2772
|
},
|
|
2769
2773
|
{
|
|
2770
2774
|
name: "static-portfolio",
|
|
2771
|
-
description: "
|
|
2772
|
-
framework: "static
|
|
2775
|
+
description: "Simple static HTML/CSS portfolio site",
|
|
2776
|
+
framework: "static",
|
|
2773
2777
|
createCmd: []
|
|
2774
|
-
// No create tool — we scaffold manually
|
|
2775
2778
|
}
|
|
2776
2779
|
];
|
|
2777
2780
|
function getTemplate(name) {
|
|
2778
|
-
return TEMPLATES.find((t) => t.name
|
|
2781
|
+
return TEMPLATES.find((t) => t.name === name);
|
|
2779
2782
|
}
|
|
2780
2783
|
function getTemplateNames() {
|
|
2781
2784
|
return TEMPLATES.map((t) => t.name);
|
|
2782
2785
|
}
|
|
2783
2786
|
async function templatesCommand() {
|
|
2784
|
-
ui.
|
|
2785
|
-
|
|
2786
|
-
console.log(` ${brand.dim("Use with: shipem init --template <name>")}`);
|
|
2787
|
-
console.log("");
|
|
2788
|
-
const maxNameLen = Math.max(...TEMPLATES.map((t) => t.name.length));
|
|
2787
|
+
ui.section("Available templates");
|
|
2788
|
+
ui.br();
|
|
2789
2789
|
for (const tpl of TEMPLATES) {
|
|
2790
|
-
|
|
2791
|
-
console.log(
|
|
2792
|
-
` ${chalk5.cyan(tpl.name)}${padding} ${brand.dim("\u2014")} ${tpl.description}`
|
|
2793
|
-
);
|
|
2794
|
-
console.log(
|
|
2795
|
-
` ${" ".repeat(maxNameLen)} ${brand.dim(`Framework: ${tpl.framework}`)}`
|
|
2796
|
-
);
|
|
2797
|
-
console.log("");
|
|
2790
|
+
console.log(` ${chalk5.cyan(tpl.name.padEnd(20))} ${tpl.description}`);
|
|
2798
2791
|
}
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
console.log("");
|
|
2792
|
+
ui.br();
|
|
2793
|
+
ui.dim("Usage: shipem init --template <name>");
|
|
2794
|
+
ui.br();
|
|
2803
2795
|
}
|
|
2804
2796
|
|
|
2805
2797
|
// src/commands/init.ts
|
|
@@ -4016,8 +4008,8 @@ async function previewCommand(options = {}) {
|
|
|
4016
4008
|
console.log("");
|
|
4017
4009
|
console.log(` ${brand.bold("Next steps:")}`);
|
|
4018
4010
|
console.log(` ${brand.gray("Share")} \u2192 Send the preview URL to teammates`);
|
|
4019
|
-
console.log(` ${brand.gray("Update")} \u2192 ${chalk13.cyan("npx
|
|
4020
|
-
console.log(` ${brand.gray("Promote")} \u2192 Merge to main and ${chalk13.cyan("npx
|
|
4011
|
+
console.log(` ${brand.gray("Update")} \u2192 ${chalk13.cyan("npx shipem preview")} (re-deploy this branch)`);
|
|
4012
|
+
console.log(` ${brand.gray("Promote")} \u2192 Merge to main and ${chalk13.cyan("npx shipem deploy")}`);
|
|
4021
4013
|
console.log("");
|
|
4022
4014
|
}
|
|
4023
4015
|
|
package/dist/lib.d.ts
CHANGED
|
@@ -244,9 +244,7 @@ interface Template {
|
|
|
244
244
|
postScaffold?: string[];
|
|
245
245
|
}
|
|
246
246
|
declare const TEMPLATES: Template[];
|
|
247
|
-
/** Look up a template by name (case-insensitive). */
|
|
248
247
|
declare function getTemplate(name: string): Template | undefined;
|
|
249
|
-
/** List all available template names. */
|
|
250
248
|
declare function getTemplateNames(): string[];
|
|
251
249
|
|
|
252
250
|
export { type AuthConfig, AuthError, BuildError, type BuildResult, type CloudflareCredentials, CloudflarePages, ConfigError, DeployError, type DeployRecord, type DeployTarget, type DeploymentState, type EnvVar, FRAMEWORKS, type Framework, type FrameworkChoice, type MonorepoInfo, NetworkError, type PreviewRecord, type ProjectConfig, SHIPEM_API_URL, type ServerType, type ShipemConfig, ShipemError, TEMPLATES, type Template, buildProject, detectMonorepo, generateProjectName, getCloudflareCredentials, getCurrentBranch, getSessionToken, getTemplate, getTemplateNames, matchFramework, readEnvFile, readProjectConfig, runFixHeuristics, sanitizeBranchName, sanitizeProjectName, scanProject, scanSourceForEnvVars, writeProjectConfig };
|
package/dist/lib.js
CHANGED
|
@@ -1139,8 +1139,7 @@ var CloudflarePages = class {
|
|
|
1139
1139
|
this.client = axios.create({
|
|
1140
1140
|
baseURL: CF_API_BASE,
|
|
1141
1141
|
headers: {
|
|
1142
|
-
Authorization: `Bearer ${apiToken}
|
|
1143
|
-
"Content-Type": "application/json"
|
|
1142
|
+
Authorization: `Bearer ${apiToken}`
|
|
1144
1143
|
},
|
|
1145
1144
|
timeout: CF_REQUEST_TIMEOUT_MS
|
|
1146
1145
|
});
|
|
@@ -1241,9 +1240,12 @@ var CloudflarePages = class {
|
|
|
1241
1240
|
let requiredFiles;
|
|
1242
1241
|
let deployment;
|
|
1243
1242
|
try {
|
|
1243
|
+
const deployFormData = new FormData();
|
|
1244
|
+
deployFormData.append("manifest", JSON.stringify(manifest));
|
|
1245
|
+
deployFormData.append("branch", "main");
|
|
1244
1246
|
const res = await this.client.post(
|
|
1245
1247
|
`/accounts/${this.accountId}/pages/projects/${projectName}/deployments`,
|
|
1246
|
-
|
|
1248
|
+
deployFormData,
|
|
1247
1249
|
{ timeout: CF_REQUEST_TIMEOUT_MS }
|
|
1248
1250
|
);
|
|
1249
1251
|
if (!res.data.success) {
|
|
@@ -1317,9 +1319,12 @@ var CloudflarePages = class {
|
|
|
1317
1319
|
let requiredFiles;
|
|
1318
1320
|
let deployment;
|
|
1319
1321
|
try {
|
|
1322
|
+
const deployFormData = new FormData();
|
|
1323
|
+
deployFormData.append("manifest", JSON.stringify(manifest));
|
|
1324
|
+
deployFormData.append("branch", branch);
|
|
1320
1325
|
const res = await this.client.post(
|
|
1321
1326
|
`/accounts/${this.accountId}/pages/projects/${projectName}/deployments`,
|
|
1322
|
-
|
|
1327
|
+
deployFormData,
|
|
1323
1328
|
{ timeout: CF_REQUEST_TIMEOUT_MS }
|
|
1324
1329
|
);
|
|
1325
1330
|
if (!res.data.success) {
|
|
@@ -1785,39 +1790,37 @@ import chalk4 from "chalk";
|
|
|
1785
1790
|
var TEMPLATES = [
|
|
1786
1791
|
{
|
|
1787
1792
|
name: "astro-blog",
|
|
1788
|
-
description: "Astro blog with Markdown
|
|
1793
|
+
description: "Astro blog with Markdown support",
|
|
1789
1794
|
framework: "astro",
|
|
1790
|
-
createCmd: ["npm", "create", "astro@latest", "--", "--template", "blog"]
|
|
1791
|
-
postScaffold: ["npx", "astro", "add", "mdx", "--yes"]
|
|
1795
|
+
createCmd: ["npm", "create", "astro@latest", "--", "--template", "blog"]
|
|
1792
1796
|
},
|
|
1793
1797
|
{
|
|
1794
1798
|
name: "nextjs-saas",
|
|
1795
|
-
description: "Next.js SaaS starter with App Router
|
|
1799
|
+
description: "Next.js SaaS starter with App Router",
|
|
1796
1800
|
framework: "nextjs",
|
|
1797
|
-
createCmd: ["npx", "create-next-app@latest", "--", "--
|
|
1801
|
+
createCmd: ["npx", "create-next-app@latest", "--", "--app", "--ts", "--tailwind", "--eslint", "--src-dir"]
|
|
1798
1802
|
},
|
|
1799
1803
|
{
|
|
1800
1804
|
name: "vite-react",
|
|
1801
|
-
description: "Vite + React + TypeScript
|
|
1802
|
-
framework: "vite
|
|
1805
|
+
description: "Vite + React + TypeScript starter",
|
|
1806
|
+
framework: "vite",
|
|
1803
1807
|
createCmd: ["npm", "create", "vite@latest", "--", "--template", "react-ts"]
|
|
1804
1808
|
},
|
|
1805
1809
|
{
|
|
1806
1810
|
name: "sveltekit-app",
|
|
1807
|
-
description: "SvelteKit full-stack app
|
|
1811
|
+
description: "SvelteKit full-stack app",
|
|
1808
1812
|
framework: "sveltekit",
|
|
1809
|
-
createCmd: ["
|
|
1813
|
+
createCmd: ["npx", "sv", "create", "--", "--template", "minimal", "--types", "ts"]
|
|
1810
1814
|
},
|
|
1811
1815
|
{
|
|
1812
1816
|
name: "static-portfolio",
|
|
1813
|
-
description: "
|
|
1814
|
-
framework: "static
|
|
1817
|
+
description: "Simple static HTML/CSS portfolio site",
|
|
1818
|
+
framework: "static",
|
|
1815
1819
|
createCmd: []
|
|
1816
|
-
// No create tool — we scaffold manually
|
|
1817
1820
|
}
|
|
1818
1821
|
];
|
|
1819
1822
|
function getTemplate(name) {
|
|
1820
|
-
return TEMPLATES.find((t) => t.name
|
|
1823
|
+
return TEMPLATES.find((t) => t.name === name);
|
|
1821
1824
|
}
|
|
1822
1825
|
function getTemplateNames() {
|
|
1823
1826
|
return TEMPLATES.map((t) => t.name);
|