From 96f0951f38b5449bda704269471916fa95675acf Mon Sep 17 00:00:00 2001 From: GABRIEL-star-alt Date: Thu, 11 Apr 2024 23:09:48 +0530 Subject: [PATCH 1/2] changes in stage.ts and branching.ts --- {demo/.statik => .statik}/CONFIG | 0 .statik/HEAD | 1 + {demo/.statik => .statik}/SNAPSHOT | 0 .statik/heads/main | 1 + .statik/heads/new | 1 + demo/.statik/HEAD | 1 - demo/.statik/heads/main | 1 - demo/.statik/heads/test | 1 - demo/a.txt | 1 - demo/b/B | 1 + demo/b/b.txt | 1 - package-lock.json | 4 +- src/index.ts | 2 +- src/vc/branching.ts | 87 ++++++++++++++++++++---------- src/vc/stage.ts | 30 ++++++----- 15 files changed, 82 insertions(+), 50 deletions(-) rename {demo/.statik => .statik}/CONFIG (100%) create mode 100644 .statik/HEAD rename {demo/.statik => .statik}/SNAPSHOT (100%) create mode 100644 .statik/heads/main create mode 100644 .statik/heads/new delete mode 100644 demo/.statik/HEAD delete mode 100644 demo/.statik/heads/main delete mode 100644 demo/.statik/heads/test delete mode 100644 demo/a.txt create mode 100644 demo/b/B delete mode 100644 demo/b/b.txt diff --git a/demo/.statik/CONFIG b/.statik/CONFIG similarity index 100% rename from demo/.statik/CONFIG rename to .statik/CONFIG diff --git a/.statik/HEAD b/.statik/HEAD new file mode 100644 index 0000000..3e5126c --- /dev/null +++ b/.statik/HEAD @@ -0,0 +1 @@ +new \ No newline at end of file diff --git a/demo/.statik/SNAPSHOT b/.statik/SNAPSHOT similarity index 100% rename from demo/.statik/SNAPSHOT rename to .statik/SNAPSHOT diff --git a/.statik/heads/main b/.statik/heads/main new file mode 100644 index 0000000..6e6f6df --- /dev/null +++ b/.statik/heads/main @@ -0,0 +1 @@ +QmRHBHSTfLv9FN1DdRJaRzuTDs8RykC2wvxAipQ4SgkyqM \ No newline at end of file diff --git a/.statik/heads/new b/.statik/heads/new new file mode 100644 index 0000000..cfa0f3a --- /dev/null +++ b/.statik/heads/new @@ -0,0 +1 @@ +QmWzRFhtmRVcggg7FKk3V7RAcf4iWs29UmngRHhWfTfPdz \ No newline at end of file diff --git a/demo/.statik/HEAD b/demo/.statik/HEAD deleted file mode 100644 index 88d050b..0000000 --- a/demo/.statik/HEAD +++ /dev/null @@ -1 +0,0 @@ -main \ No newline at end of file diff --git a/demo/.statik/heads/main b/demo/.statik/heads/main deleted file mode 100644 index b8dde4f..0000000 --- a/demo/.statik/heads/main +++ /dev/null @@ -1 +0,0 @@ -QmSVvrt5Vcp9ACfoaAp3uZYzNppAN6PYGA7Jy9y9LFe8JL \ No newline at end of file diff --git a/demo/.statik/heads/test b/demo/.statik/heads/test deleted file mode 100644 index 46fcb3e..0000000 --- a/demo/.statik/heads/test +++ /dev/null @@ -1 +0,0 @@ -QmboP4hnUe7S1UWPDFPDBirRBJ6D3BKe2cukmmx8Fmyb2V \ No newline at end of file diff --git a/demo/a.txt b/demo/a.txt deleted file mode 100644 index c79c59e..0000000 --- a/demo/a.txt +++ /dev/null @@ -1 +0,0 @@ -Updated A \ No newline at end of file diff --git a/demo/b/B b/demo/b/B new file mode 100644 index 0000000..080f8fb --- /dev/null +++ b/demo/b/B @@ -0,0 +1 @@ +BB \ No newline at end of file diff --git a/demo/b/b.txt b/demo/b/b.txt deleted file mode 100644 index 7371f47..0000000 --- a/demo/b/b.txt +++ /dev/null @@ -1 +0,0 @@ -B \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index b16493a..71e3fa7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "statikvc", - "version": "1.0.5-alpha", + "version": "1.1.0-alpha", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "statikvc", - "version": "1.0.5-alpha", + "version": "1.1.0-alpha", "license": "ISC", "dependencies": { "commander": "^11.0.0", diff --git a/src/index.ts b/src/index.ts index 60f6da1..5462ff3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,7 +12,7 @@ program .name("statik") .version("1.1.0-alpha") .description(figlet.textSync("Statik")+"\nAn IPFS based version control system with static file hosting features") -program.command("init ").description("Initialize a new Statik repository") +program.command("init ").description("Initialmknkjnkjlize a new Statik repository") program.command("add [file_path]").description("Add a file to the Statik repository") program.command("commit ").description("Commit changes to the Statik repository") program.command("log").description("View the commit history of the current branch") diff --git a/src/vc/branching.ts b/src/vc/branching.ts index 7b772b5..51eed7a 100644 --- a/src/vc/branching.ts +++ b/src/vc/branching.ts @@ -2,11 +2,39 @@ import { create } from "ipfs-http-client"; import { IsStatik } from "../utils/checkStatik.js"; import fs from 'fs' import { FetchConfig } from "../utils/fetchConfig.js"; +import path from "path"; import Path from 'path' import { multihashToCID } from "../utils/cid.js"; import { isOverriding } from "../utils/changes.js"; import { commitContent } from "../utils/fetchContent.js"; import { deleteAllFiles, readAllFiles } from "../utils/dirwalk.js"; +function deleteDirectoryRecursive(directoryPath:string) { + if (!fs.existsSync(directoryPath)) { + console.error("Directory does not exist:", directoryPath); + return; + } + + // Get all items in the directory + const items = fs.readdirSync(directoryPath); + + items.forEach(item => { + const itemPath = path.join(directoryPath, item); + const stats = fs.statSync(itemPath); + + if (stats.isDirectory()) { + // Recursively delete subdirectories + deleteDirectoryRecursive(itemPath); + } else { + // Delete files + fs.unlinkSync(itemPath); + console.log(`Deleted file: ${itemPath}`); + } + }); + + // Finally, delete the empty directory + fs.rmdirSync(directoryPath); + console.log(`Deleted directory: ${directoryPath}`); +} export async function List(cwd: string){ try{ IsStatik(cwd) @@ -53,23 +81,7 @@ export async function Jump(cwd: string,branch: string){ // Check for unstaged changes const oldBranchContent = await commitContent(currentHead,client) const {overrides:hasUnstagedChanges,newFiles:addedFiles,updated:unstagedChanges,deletedFiles} = await isOverriding(cwd,client,oldBranchContent,currentFiles) - if(hasUnstagedChanges){ - if(unstagedChanges.length>0){ - console.log("\nUnstaged changes:") - for(const file of unstagedChanges){ - console.log(file) - } - } - if(deletedFiles.length>0){ - console.log("\nDeleted files:") - for(const file of deletedFiles){ - console.log(file) - } - } - console.log("\nThere are unstaged changes. You cannot switch branch without commiting it") - console.log("Abort") - process.exit(1) - } + // Handle the case where not unstaged but overriding // Solution: Prevent only if added files and deleted files are overriding // Check for overriding changes @@ -100,20 +112,37 @@ export async function Jump(cwd: string,branch: string){ // Conditionally delete files. Exempt new files under basepath const basepath = Path.dirname(newBranchContent[index].path) - deleteAllFiles(cwd+"/"+basepath,newFiles) - for(const obj of newBranchContent){ - const path = obj.path + let basepathnew + let dir; + basepathnew = newBranchContent[0].path.split("/"); + if(newBranchContent[0].path.split("/").length==1){ +dir=basepathnew[0] + } + else{ + dir=basepathnew[0]+"/" + } +console.log(basepathnew) + const directoryPath=cwd+"/"+dir + + + + + + // Recursively delete subdirectories + deleteDirectoryRecursive(directoryPath); + // deleteAllFiles(cwd+"/"+basepath,newFiles) + let data + for (const obj of newBranchContent) { + const path = obj.path; // Derive CID from multihash - const cid = multihashToCID(obj.cid) + const cid = multihashToCID(obj.cid); // console.log(cid,path) - const asyncitr = client.cat(cid) - for await(const itr of asyncitr){ - const data = Buffer.from(itr).toString() - const dirname = Path.dirname(cwd+"/"+path) - if(!fs.existsSync(dirname)){ - fs.mkdirSync(dirname,{recursive:true}) - } - fs.writeFileSync(path,data) + const asyncitr = client.cat(cid); + const dirname = Path.dirname(cwd + "/" + path); + for await (const itr of asyncitr) { + fs.mkdirSync(dirname, { recursive: true }); + data = Buffer.from(itr).toString(); + fs.writeFileSync(path, data); } } fs.writeFileSync(cwd+"/.statik/HEAD",branch); diff --git a/src/vc/stage.ts b/src/vc/stage.ts index 90f5822..335406c 100644 --- a/src/vc/stage.ts +++ b/src/vc/stage.ts @@ -18,7 +18,7 @@ export async function Add(cwd:string,paths:string[]){ let snapshot=[]; for (const path of paths){ for await (const result of client.addAll(globSource(path,{recursive:true}))) { - if(fs.statSync(cwd+"/"+path).isDirectory()) continue; + if(fs.statSync(cwd+"/"+result.path).isDirectory()) continue; snapshot.push(result) } } @@ -26,7 +26,7 @@ export async function Add(cwd:string,paths:string[]){ const result = await client.add(JSON.stringify(snapshot)) fs.writeFileSync(cwd+"/.statik/SNAPSHOT",result.path) console.log( - "Files staged to IPFS with cid: "+result.path + "Files staged to IPFS withmm cid: "+result.path ) }else{ let asyncitr = client.cat(prevCommit) @@ -42,23 +42,27 @@ export async function Add(cwd:string,paths:string[]){ prevContent = JSON.parse(data) } // Not optimized + let Content1=[] for (const path of paths){ for await (const result of client.addAll(globSource(path,{recursive:true}))) { // Check if the path is a directory const path = result.path - if(fs.statSync(cwd+"/"+path).isDirectory()) continue; - let flag = true - for(const prev of prevContent){ - if(prev.path==result.path){ - prevContent.splice(prevContent.indexOf(prev),1,result) - flag = false - break; - } - } - if(flag) prevContent.push(result) + if(fs.statSync(cwd+"/"+path).isDirectory()) { + continue;} + Content1.push(result) + + // let flag = true + // for(const prev of prevContent){ + // if(prev.path==result.path){ + // prevContent.splice(prevContent.indexOf(prev),1,result) + // flag = false + // break; + // } + // } + // if(flag) prevContent.push(result) } } - const result = await client.add(JSON.stringify(prevContent)) + const result = await client.add(JSON.stringify(Content1)) // console.log(result.path,prevSnapshot) if(result.path==prevSnapshot){ console.log("There are no changes to add") From 1bf8558b5844e89e1b8eeb43d509fccb48e63235 Mon Sep 17 00:00:00 2001 From: GABRIEL-star-alt Date: Thu, 11 Apr 2024 23:21:16 +0530 Subject: [PATCH 2/2] same changes but in new --- .statik/HEAD | 6 ++- .statik/SNAPSHOT | 1 + .statik/statik-ignore | 0 README.md | 2 +- demo/a.txt | 1 + demo/b/B | 1 - demo/b/b.txt | 1 + dist/.statik/CONFIG | 1 + dist/.statik/HEAD | 1 + dist/.statik/SNAPSHOT | 0 dist/.statik/heads/main | 0 dist/vc/branching.js | 105 ++++++++++++++++++++++++++++++---------- dist/vc/stage.js | 34 ++++++++----- package-lock.json | 30 ++++++------ package.json | 18 ++++--- 15 files changed, 139 insertions(+), 62 deletions(-) create mode 100644 .statik/statik-ignore create mode 100644 demo/a.txt delete mode 100644 demo/b/B create mode 100644 demo/b/b.txt create mode 100644 dist/.statik/CONFIG create mode 100644 dist/.statik/HEAD create mode 100644 dist/.statik/SNAPSHOT create mode 100644 dist/.statik/heads/main diff --git a/.statik/HEAD b/.statik/HEAD index 3e5126c..7374b40 100644 --- a/.statik/HEAD +++ b/.statik/HEAD @@ -1 +1,5 @@ -new \ No newline at end of file +<<<<<<< HEAD +new +======= +main +>>>>>>> 3457ca10e2f33e8c1f9248a39dcb87b065f0d46a diff --git a/.statik/SNAPSHOT b/.statik/SNAPSHOT index e69de29..a18b79c 100644 --- a/.statik/SNAPSHOT +++ b/.statik/SNAPSHOT @@ -0,0 +1 @@ +QmNWcUuLpcDsDV7w86KEN53BQuKNvaCytVtbWXWuFgvrKL \ No newline at end of file diff --git a/.statik/statik-ignore b/.statik/statik-ignore new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index c122c05..f800c46 100644 --- a/README.md +++ b/README.md @@ -83,5 +83,5 @@ $ statik help jump Switch between branches - help [command] display help for command + help [command ] display help for command ``` diff --git a/demo/a.txt b/demo/a.txt new file mode 100644 index 0000000..2940bf3 --- /dev/null +++ b/demo/a.txt @@ -0,0 +1 @@ +Updated a \ No newline at end of file diff --git a/demo/b/B b/demo/b/B deleted file mode 100644 index 080f8fb..0000000 --- a/demo/b/B +++ /dev/null @@ -1 +0,0 @@ -BB \ No newline at end of file diff --git a/demo/b/b.txt b/demo/b/b.txt new file mode 100644 index 0000000..63d8dbd --- /dev/null +++ b/demo/b/b.txt @@ -0,0 +1 @@ +b \ No newline at end of file diff --git a/dist/.statik/CONFIG b/dist/.statik/CONFIG new file mode 100644 index 0000000..8bf6151 --- /dev/null +++ b/dist/.statik/CONFIG @@ -0,0 +1 @@ +{"ipfs_node_url":"/ip4/127.0.0.1/tcp/5001"} \ No newline at end of file diff --git a/dist/.statik/HEAD b/dist/.statik/HEAD new file mode 100644 index 0000000..88d050b --- /dev/null +++ b/dist/.statik/HEAD @@ -0,0 +1 @@ +main \ No newline at end of file diff --git a/dist/.statik/SNAPSHOT b/dist/.statik/SNAPSHOT new file mode 100644 index 0000000..e69de29 diff --git a/dist/.statik/heads/main b/dist/.statik/heads/main new file mode 100644 index 0000000..e69de29 diff --git a/dist/vc/branching.js b/dist/vc/branching.js index bb03d4e..5746348 100644 --- a/dist/vc/branching.js +++ b/dist/vc/branching.js @@ -1,14 +1,45 @@ import { create } from "ipfs-http-client"; import { IsStatik } from "../utils/checkStatik.js"; import fs from 'fs'; + import { FetchConfig } from "../utils/fetchConfig.js"; -import Path from 'path'; +import path from "path"; +import Path from "path"; import { multihashToCID } from "../utils/cid.js"; import { isOverriding } from "../utils/changes.js"; import { commitContent } from "../utils/fetchContent.js"; import { deleteAllFiles, readAllFiles } from "../utils/dirwalk.js"; +function deleteDirectoryRecursive(directoryPath) { + if (!fs.existsSync(directoryPath)) { + console.error("Directory does not exist:", directoryPath); + return; + } + + // Get all items in the directory + const items = fs.readdirSync(directoryPath); + + items.forEach(item => { + const itemPath = path.join(directoryPath, item); + const stats = fs.statSync(itemPath); + + if (stats.isDirectory()) { + // Recursively delete subdirectories + deleteDirectoryRecursive(itemPath); + } else { + // Delete files + fs.unlinkSync(itemPath); + console.log(`Deleted file: ${itemPath}`); + } + }); + + // Finally, delete the empty directory + fs.rmdirSync(directoryPath); + console.log(`Deleted directory: ${directoryPath}`); +} + export async function List(cwd) { try { + IsStatik(cwd); // List all files const currentBranch = fs.readFileSync(cwd + "/.statik/HEAD").toString(); @@ -48,28 +79,28 @@ export async function Jump(cwd, branch) { else { const commitId = fs.readFileSync(cwd + "/.statik/heads/" + branch).toString(); const client = create({ url: FetchConfig(cwd).ipfs_node_url }); + const oldBranchContent = await commitContent(currentHead, client); console.log("Switching to branch " + branch + "\n" + "Head commit <" + commitId + ">"); const currentFiles = [...readAllFiles(cwd)]; // Check for unstaged changes - const oldBranchContent = await commitContent(currentHead, client); const { overrides: hasUnstagedChanges, newFiles: addedFiles, updated: unstagedChanges, deletedFiles } = await isOverriding(cwd, client, oldBranchContent, currentFiles); - if (hasUnstagedChanges) { - if (unstagedChanges.length > 0) { - console.log("\nUnstaged changes:"); - for (const file of unstagedChanges) { - console.log(file); - } - } - if (deletedFiles.length > 0) { - console.log("\nDeleted files:"); - for (const file of deletedFiles) { - console.log(file); - } - } - console.log("\nThere are unstaged changes. You cannot switch branch without commiting it"); - console.log("Abort"); - process.exit(1); - } + // if (hasUnstagedChanges) { + // if (unstagedChanges.length > 0) { + // console.log("\nUnstaged changes:"); + // for (const file of unstagedChanges) { + // console.log(file); + // } + // } + // if (deletedFiles.length > 0) { + // console.log("\nDeleted files:"); + // for (const file of deletedFiles) { + // console.log(file); + // } + // } + // console.log("\nThere are unstaged changes. You cannot switch branch without commiting it"); + // console.log("Abort"); + // process.exit(1); + // } // Handle the case where not unstaged but overriding // Solution: Prevent only if added files and deleted files are overriding // Check for overriding changes @@ -87,8 +118,18 @@ export async function Jump(cwd, branch) { // Find the basepath and recursively delete all files let basepathCount = Infinity; let index = 0; + console.log(newBranchContent) + const patharray=[]; + newBranchContent.forEach((e,i)=>{ + patharray.push(e.path); + + }) + +console.log( newBranchContent[0].path.split("/")) +const diraddedinnewbranch= newBranchContent[0].path.split("/")[0] if (newBranchContent.length > 0) { basepathCount = newBranchContent[0].path.split("/").length; + } for (let i = 1; i < newBranchContent.length; i++) { if (newBranchContent[i].path.split("/").length < basepathCount) { @@ -98,19 +139,33 @@ export async function Jump(cwd, branch) { } // Conditionally delete files. Exempt new files under basepath const basepath = Path.dirname(newBranchContent[index].path); - deleteAllFiles(cwd + "/" + basepath, newFiles); + // deleteAllFiles(cwd + "/" + basepath, newFiles); + // + const directoryPath=cwd+"/"+"another/" + + + + + + // Recursively delete subdirectories + deleteDirectoryRecursive(directoryPath); + + + // Finally, delete the empty directory + + + // + let data; for (const obj of newBranchContent) { const path = obj.path; // Derive CID from multihash const cid = multihashToCID(obj.cid); // console.log(cid,path) const asyncitr = client.cat(cid); + const dirname = Path.dirname(cwd + "/" + path); for await (const itr of asyncitr) { - const data = Buffer.from(itr).toString(); - const dirname = Path.dirname(cwd + "/" + path); - if (!fs.existsSync(dirname)) { - fs.mkdirSync(dirname, { recursive: true }); - } + fs.mkdirSync(dirname, { recursive: true }); + data = Buffer.from(itr).toString(); fs.writeFileSync(path, data); } } diff --git a/dist/vc/stage.js b/dist/vc/stage.js index 84cfcf8..f63f6b5 100644 --- a/dist/vc/stage.js +++ b/dist/vc/stage.js @@ -2,6 +2,7 @@ import { create, globSource } from "ipfs-http-client"; import { IsStatik } from "../utils/checkStatik.js"; import fs from 'fs'; import { FetchConfig } from "../utils/fetchConfig.js"; +import { Duplex } from "stream"; export async function Add(cwd, paths) { try { IsStatik(cwd); @@ -16,9 +17,12 @@ export async function Add(cwd, paths) { if (!prevCommit.length) { let snapshot = []; for (const path of paths) { - for await (const result of client.addAll(globSource(path, { recursive: true }))) { - if (fs.statSync(cwd + "/" + path).isDirectory()) + for await (const result of client.addAll(globSource(path, { recursive: true,duplex:true}))) { + if (fs.statSync(cwd + "/" + result.path).isDirectory()){ + continue; + } + console.log(result); snapshot.push(result); } } @@ -41,25 +45,29 @@ export async function Add(cwd, paths) { prevContent = JSON.parse(data); } // Not optimized + const Content1=[] for (const path of paths) { for await (const result of client.addAll(globSource(path, { recursive: true }))) { // Check if the path is a directory const path = result.path; if (fs.statSync(cwd + "/" + path).isDirectory()) continue; - let flag = true; - for (const prev of prevContent) { - if (prev.path == result.path) { - prevContent.splice(prevContent.indexOf(prev), 1, result); - flag = false; - break; - } - } - if (flag) - prevContent.push(result); + console.log(result); + Content1.push(result) + // let flag = true; + // for (const prev of prevContent) { + + // if (prev.path == result.path) { + // prevContent.splice(prevContent.indexOf(prev), 1, result); + // flag = false; + // break; + // } + // } + // if (flag) + // prevContent.push(result); } } - const result = await client.add(JSON.stringify(prevContent)); + const result = await client.add(JSON.stringify(Content1)); // console.log(result.path,prevSnapshot) if (result.path == prevSnapshot) { console.log("There are no changes to add"); diff --git a/package-lock.json b/package-lock.json index 71e3fa7..d329f9c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "commander": "^11.0.0", "figlet": "^1.6.0", - "ipfs-http-client": "^52.0.4-rc.4" + "ipfs-http-client": "^52.0.5" }, "bin": { "statik": "dist/index.js" @@ -19,8 +19,8 @@ "devDependencies": { "@types/figlet": "^1.5.6", "@types/node": "^20.8.2", - "ts-node": "^10.9.1", - "typescript": "^5.1.6" + "ts-node": "^10.9.2", + "typescript": "^5.3.3" } }, "node_modules/@cspotcode/source-map-support": { @@ -968,9 +968,9 @@ } }, "node_modules/ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "dev": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", @@ -1011,9 +1011,9 @@ } }, "node_modules/typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -1823,9 +1823,9 @@ } }, "ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "dev": true, "requires": { "@cspotcode/source-map-support": "^0.8.0", @@ -1844,9 +1844,9 @@ } }, "typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "dev": true }, "uint8arrays": { diff --git a/package.json b/package.json index 20521e2..950db2d 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "description": "An IPFS based version control system with static file hosting features. Basic functions like repo initiation, staging, committing, and logging have been implemented. (Under active development)", "exports": "./dist/index.js", "scripts": { - "build": "npx tsc", - "start": "npx ts-node --esm src/index.ts", + "build": "tsc", + "start": "npx ts-node --esm dist/index.js", "test": "echo \"Error: no test specified\" && exit 1" }, "bin": { @@ -15,19 +15,25 @@ "type": "git", "url": "git+https://github.com/SANTHOSH17-DOT/statik" }, - "keywords": ["version-control","ipfs","p2p","web3","filestorage"], + "keywords": [ + "version-control", + "ipfs", + "p2p", + "web3", + "filestorage" + ], "author": "Santhosh Murugaiah", "license": "ISC", "dependencies": { "commander": "^11.0.0", "figlet": "^1.6.0", - "ipfs-http-client": "^52.0.4-rc.4" + "ipfs-http-client": "^52.0.5" }, "devDependencies": { "@types/figlet": "^1.5.6", "@types/node": "^20.8.2", - "ts-node": "^10.9.1", - "typescript": "^5.1.6" + "ts-node": "^10.9.2", + "typescript": "^5.3.3" }, "type": "module" }