-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ff15a5
commit f93f8d2
Showing
8 changed files
with
135 additions
and
38 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
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,2 @@ | ||
lib/** | ||
scripts/** |
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,15 @@ | ||
{ | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"ignorePatterns": [ | ||
"lib/**", | ||
"scripts/**" | ||
], | ||
"root": true | ||
} |
79 changes: 45 additions & 34 deletions
79
cli/npm-package/bolt → cli/npm-package/bolt.ts
100644 → 100755
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
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,31 @@ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
|
||
// Configuration for both npm and Yarn | ||
const npmrcPath = path.join(process.cwd(), ".npmrc"); | ||
const yarnrcPath = path.join(process.cwd(), ".yarnrc"); | ||
const npmConfigLine = | ||
"@magicblock-labs:registry=https://npm.pkg.github.com/magicblock-labs\n"; | ||
const yarnConfigLine = | ||
'"@magicblock-labs:registry" "https://npm.pkg.github.com/magicblock-labs"\n'; | ||
|
||
// Function to update or create a configuration file | ||
function updateOrCreateConfig(filePath, configLine) { | ||
try { | ||
if (fs.existsSync(filePath)) { | ||
const content = fs.readFileSync(filePath, { encoding: "utf8" }); | ||
if (!content.includes(configLine)) { | ||
fs.appendFileSync(filePath, configLine); | ||
} | ||
} else { | ||
fs.writeFileSync(filePath, configLine); | ||
} | ||
console.log(`${path.basename(filePath)} configured successfully.`); | ||
} catch (error) { | ||
console.error(`Error configuring ${path.basename(filePath)}:`, error); | ||
} | ||
} | ||
|
||
// Update or create both .npmrc and .yarnrc | ||
updateOrCreateConfig(npmrcPath, npmConfigLine); | ||
updateOrCreateConfig(yarnrcPath, yarnConfigLine); |
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,13 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es2016", | ||
"module": "commonjs", | ||
"esModuleInterop": true, | ||
"resolveJsonModule": true, | ||
"baseUrl": "./", | ||
"outDir": "lib", | ||
"forceConsistentCasingInFileNames": true, | ||
"strict": true, | ||
"skipLibCheck": true, | ||
} | ||
} |