mirror of
https://github.com/glitternetwork/pinme.git
synced 2026-08-30 17:58:49 +08:00
Merge branch 'main' of github.com:glitternetwork/pinme
This commit is contained in:
@@ -13,9 +13,17 @@
|
||||
|
||||
# PinMe
|
||||
|
||||
[PinMe](https://pinme.eth.limo/) is a one-command deploy tool that turns static sites into permanent, verifiable frontends by pinning to [IPFS](https://ipfs.tech/), writing contenthash to [ENS](https://ens.domains/) subnames, and serving through gateways like [eth.limo](https://eth.limo/)—no DNS, no servers.
|
||||
[PinMe](https://pinme.eth.limo/) is a zero-config frontend deployment tool.
|
||||
No servers. No accounts. No setup.
|
||||
|
||||
Website:[https://pinme.eth.limo/](https://pinme.eth.limo/)
|
||||
Build a static site, generate a page with AI, or export your frontend — then deploy instantly with a single command.
|
||||
|
||||
PinMe publishes your site as verifiable content, making silent tampering and accidental breakage far harder than traditional hosting.
|
||||
|
||||
You don’t manage servers, regions, or uptime.
|
||||
PinMe handles availability and persistence for you.
|
||||
|
||||
Website: [https://pinme.eth.limo/](https://pinme.eth.limo/)
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
+10
-10
@@ -2,13 +2,13 @@ import fs from 'fs';
|
||||
import path from 'path';
|
||||
import Inquirer from "inquirer";
|
||||
|
||||
// check if the path exists and return the absolute path
|
||||
// Check if the path exists and return the absolute path
|
||||
function checkPath(inputPath: string): string | null {
|
||||
try {
|
||||
// convert to absolute path
|
||||
// Convert to absolute path
|
||||
const absolutePath = path.resolve(inputPath);
|
||||
|
||||
// check if the path exists
|
||||
// Check if the path exists
|
||||
if (fs.existsSync(absolutePath)) {
|
||||
return absolutePath;
|
||||
}
|
||||
@@ -20,16 +20,16 @@ function checkPath(inputPath: string): string | null {
|
||||
}
|
||||
|
||||
export default async function(projectName: string): Promise<boolean> {
|
||||
// get the current working directory
|
||||
// Get the current working directory
|
||||
const cwd = process.cwd();
|
||||
// get the project directory
|
||||
// Get the project directory
|
||||
const targetDirectory = path.join(cwd, projectName);
|
||||
// check if the directory exists
|
||||
// Check if the directory exists
|
||||
if (fs.existsSync(targetDirectory)) {
|
||||
let { isOverwrite } = await Inquirer.prompt([
|
||||
{
|
||||
name: "isOverwrite", // corresponding to the return value
|
||||
type: "list", // list type
|
||||
name: "isOverwrite", // Corresponding to the return value
|
||||
type: "list", // List type
|
||||
message: "Target directory exists, Please choose an action",
|
||||
choices: [
|
||||
{ name: "Overwrite", value: true },
|
||||
@@ -37,12 +37,12 @@ export default async function(projectName: string): Promise<boolean> {
|
||||
],
|
||||
},
|
||||
]);
|
||||
// choose Cancel
|
||||
// Choose Cancel
|
||||
if (!isOverwrite) {
|
||||
console.log("\n Canceled \n");
|
||||
return false;
|
||||
} else {
|
||||
// choose Overwrite, delete the existing directory
|
||||
// Choose Overwrite, delete the existing directory
|
||||
console.log("Removing folder...");
|
||||
await fs.promises.rm(targetDirectory, { recursive: true, force: true });
|
||||
console.log("Folder removed!");
|
||||
|
||||
@@ -104,13 +104,13 @@ class StepProgressBar {
|
||||
// Step completed, let auto progress continue
|
||||
}
|
||||
|
||||
// 开始模拟进度,用于在90%后继续显示进度
|
||||
// Start simulating progress to continue display after 90%
|
||||
startSimulatingProgress(): void {
|
||||
this.isSimulatingProgress = true;
|
||||
this.simulationStartTime = Date.now();
|
||||
}
|
||||
|
||||
// 停止模拟进度
|
||||
// Stop simulating progress
|
||||
stopSimulatingProgress(): void {
|
||||
this.isSimulatingProgress = false;
|
||||
}
|
||||
@@ -139,9 +139,9 @@ class StepProgressBar {
|
||||
let progress: number;
|
||||
|
||||
if (this.isSimulatingProgress) {
|
||||
// 在90%后模拟进度,从90%慢慢增长到99%
|
||||
// Simulate progress after 90%, gradually grow from 90% to 99%
|
||||
const simulationElapsed = Date.now() - this.simulationStartTime;
|
||||
const simulationProgress = Math.min(simulationElapsed / 60000, 1); // 60秒内从90%到99%
|
||||
const simulationProgress = Math.min(simulationElapsed / 60000, 1); // From 90% to 99% within 60 seconds
|
||||
progress = 0.90 + (simulationProgress * 0.09); // 90% + 9% = 99%
|
||||
} else {
|
||||
progress = this.calculateProgress(elapsed);
|
||||
@@ -490,7 +490,7 @@ async function monitorChunkProgress(
|
||||
let consecutiveErrors = 0;
|
||||
const startTime = Date.now();
|
||||
|
||||
// 启动模拟进度
|
||||
// Start simulating progress
|
||||
if (progressBar) {
|
||||
progressBar.startSimulatingProgress();
|
||||
}
|
||||
@@ -502,7 +502,7 @@ async function monitorChunkProgress(
|
||||
consecutiveErrors = 0;
|
||||
|
||||
if (status.is_ready && status.upload_rst.Hash) {
|
||||
// 停止模拟进度
|
||||
// Stop simulating progress
|
||||
if (progressBar) {
|
||||
progressBar.stopSimulatingProgress();
|
||||
}
|
||||
@@ -524,7 +524,7 @@ async function monitorChunkProgress(
|
||||
const maxPollTimeMinutes = Math.floor(MAX_POLL_TIME / (60 * 1000));
|
||||
throw new Error(`Polling timeout after ${maxPollTimeMinutes} minutes`);
|
||||
} finally {
|
||||
// 确保停止模拟进度
|
||||
// Ensure simulating progress is stopped
|
||||
if (progressBar) {
|
||||
progressBar.stopSimulatingProgress();
|
||||
}
|
||||
|
||||
Vendored
BIN
Binary file not shown.
@@ -2,7 +2,7 @@
|
||||
|
||||
[PinMe](https://pinme.eth.limo/) is a simple and easy-to-use command-line tool for uploading files and directories to the [IPFS](https://ipfs.tech/) network.
|
||||
|
||||
Website:[https://pinme.eth.limo/](https://pinme.eth.limo/)
|
||||
Website: [https://pinme.eth.limo/](https://pinme.eth.limo/)
|
||||
|
||||
## Features
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
[PinMe](https://pinme.eth.limo/) is a simple and easy-to-use command-line tool for uploading files and directories to the [IPFS](https://ipfs.tech/) network.
|
||||
|
||||
Website:[https://pinme.eth.limo/](https://pinme.eth.limo/)
|
||||
Website: [https://pinme.eth.limo/](https://pinme.eth.limo/)
|
||||
|
||||
## Features
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
languageCode = "zh-cn"
|
||||
languageCode = "en-us"
|
||||
title = "PINME Blog"
|
||||
theme = "PaperMod"
|
||||
baseURL = "./"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
languageCode = "zh-cn"
|
||||
languageCode = "en-us"
|
||||
title = "PINME Blog"
|
||||
theme = "PaperMod"
|
||||
baseURL = "./"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
[PinMe](https://pinme.eth.limo/) is a simple and easy-to-use command-line tool for uploading files and directories to the [IPFS](https://ipfs.tech/) network.
|
||||
|
||||
Website:[https://pinme.eth.limo/](https://pinme.eth.limo/)
|
||||
Website: [https://pinme.eth.limo/](https://pinme.eth.limo/)
|
||||
|
||||
## Features
|
||||
|
||||
|
||||
Reference in New Issue
Block a user