-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from crypblizz8/feat/husky
feat: init github actions and husky
- Loading branch information
Showing
11 changed files
with
5,182 additions
and
1,501 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Initial Tests | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x, 18.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: npm install | ||
- run: npm test | ||
- run: npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
node_modules/ | ||
npm-debug.log | ||
.DS_Store | ||
.DS_Store | ||
|
||
dist | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,122 +1,4 @@ | ||
// #!/usr/bin/env node | ||
|
||
// const { execSync } = require("child_process"); | ||
// const fs = require("fs"); | ||
// const path = require("path"); | ||
// const nillionLogo = ` | ||
// _ _ _ _ | ||
// _ __ (_) | (_) ___ _ __ | ||
// | '_ \\| | | | |/ _ \\| '_ \\ | ||
// | | | | | | | | (_) | | | | | ||
// |_| |_|_|_|_|_|\\___/|_| |_| | ||
|
||
// `; | ||
// function displayLogo() { | ||
// console.log("\x1b[34m%s\x1b[0m", nillionLogo); | ||
// } | ||
|
||
// function displayWelcomeMessage() { | ||
// const purpleText = "\x1b[34m"; | ||
// const resetColor = "\x1b[0m"; | ||
// console.log( | ||
// `Welcome to ${purpleText}create-nillion-app${resetColor} - the quickstart Nillion CLI` | ||
// ); | ||
// } | ||
|
||
// function isNilupInstalled() { | ||
// try { | ||
// const output = execSync("nilup -V", { stdio: "pipe" }).toString().trim(); | ||
// console.log(`Nilup is already installed. Version: ${output}`); | ||
// return true; | ||
// } catch (error) { | ||
// return false; | ||
// } | ||
// } | ||
|
||
// function installNilup() { | ||
// console.log("--------------------"); | ||
// console.log("Installing nilup... This may take a few minutes.🙏 "); | ||
// execSync("curl -fsSL https://nilup.nilogy.xyz/install.sh | sh", { | ||
// stdio: "inherit", | ||
// }); | ||
// execSync("nilup install latest", { stdio: "inherit" }); | ||
// execSync("nilup use latest", { stdio: "inherit" }); | ||
// execSync("nilup init", { stdio: "inherit" }); | ||
// } | ||
|
||
// function setupNadaFolder(rootDir) { | ||
// console.log("Setting up Nada project..."); | ||
|
||
// execSync("nada init nada_quickstart_programs", { stdio: "inherit" }); | ||
// execSync("python3 -m venv .venv", { stdio: "inherit" }); | ||
|
||
// // Determine the correct activate script based on the OS | ||
// const activateScript = | ||
// process.platform === "win32" | ||
// ? ".venv\\Scripts\\activate" | ||
// : "source .venv/bin/activate"; | ||
|
||
// // Install nada-dsl | ||
// execSync(`${activateScript} && pip install --upgrade nada-dsl`, { | ||
// stdio: "inherit", | ||
// shell: true, | ||
// }); | ||
|
||
// process.chdir(rootDir); | ||
// } | ||
|
||
// function createNextJsProject(rootDir) { | ||
// console.log("--------------------"); | ||
// console.log("Cloning Next.js project..."); | ||
// const nextAppPath = path.join(rootDir, "nillion-app"); | ||
// fs.mkdirSync(nextAppPath, { recursive: true }); | ||
// process.chdir(nextAppPath); | ||
|
||
// console.log("Note: Degit is used to clone the Next.js project."); | ||
// execSync("npx degit NillionNetwork/client-ts/examples/nextjs .", { | ||
// stdio: "inherit", | ||
// }); | ||
// process.chdir(rootDir); | ||
// } | ||
|
||
// function updatePackageJson(rootDir) { | ||
// const packageJsonPath = path.join(rootDir, "nillion-app", "package.json"); | ||
// const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8")); | ||
// packageJson.scripts = { | ||
// ...packageJson.scripts, | ||
// "nillion:update": | ||
// "nilup update && nilup install latest && nilup use latest", | ||
// "nada:activate": | ||
// process.platform === "win32" | ||
// ? "cd ..\\nada_quickstart_programs && .venv\\Scripts\\activate" | ||
// : "cd ../nada_quickstart_programs && source .venv/bin/activate", | ||
// }; | ||
// fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2)); | ||
// } | ||
|
||
// function main() { | ||
// const projectName = process.argv[2] || "nillion-quickstart"; | ||
|
||
// displayLogo(); | ||
// displayWelcomeMessage(); | ||
|
||
// console.log("Checking if Nilup is installed..."); | ||
// if (!isNilupInstalled()) { | ||
// installNilup(); | ||
// } | ||
|
||
// fs.mkdirSync(projectName, { recursive: true }); | ||
// process.chdir(projectName); | ||
|
||
// setupNadaFolder(process.cwd()); | ||
// createNextJsProject(process.cwd()); | ||
// updatePackageJson(process.cwd()); | ||
|
||
// console.log( | ||
// `Nillion quickstart "${projectName}" has been created successfully! 🚀` | ||
// ); | ||
// console.log(`Follow the rest of the Documenation Quickstart to get started!`); | ||
// console.log("--------------------"); | ||
// } | ||
|
||
// main(); | ||
import("../dist/index.js").catch((err) => { | ||
console.error("Error:", err); | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export default { | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
moduleNameMapper: { | ||
"^@/(.*)$": "<rootDir>/src/$1", | ||
}, | ||
extensionsToTreatAsEsm: [".ts"], | ||
globals: { | ||
"ts-jest": { | ||
useESM: true, | ||
}, | ||
}, | ||
transform: { | ||
"^.+\\.tsx?$": ["ts-jest", { useESM: true }], | ||
}, | ||
}; |
Oops, something went wrong.