├── .prettierrc.json ├── .gitignore ├── src ├── test.js ├── cli.js └── Commands │ └── NewCommand.js ├── .prettierignore ├── bin └── axe-magic ├── .github ├── dependabot.yml └── workflows │ ├── test.yml │ ├── npm-publish.yml │ ├── depraveyard.yml │ └── auto-tag.yml ├── SECURITY.md ├── readme.md ├── package.json └── LICENSE /.prettierrc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | axe-magic-api -------------------------------------------------------------------------------- /src/test.js: -------------------------------------------------------------------------------- 1 | const { cli } = require("./cli"); 2 | 3 | cli(process.argv); 4 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | axe-magic-api 2 | node-modules 3 | .github 4 | package.json 5 | bin -------------------------------------------------------------------------------- /bin/axe-magic: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | require("../src/cli").cli(process.argv); 4 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "npm" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | 3 | on: push 4 | 5 | jobs: 6 | publish: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v1 10 | - uses: actions/setup-node@v1 11 | with: 12 | node-version: 20 13 | - run: npm install 14 | - run: node src/test.js new axe-magic-api 15 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Reporting a Vulnerability 4 | 5 | To report a vulnerability, please email our security team at i.ozguradem [at] gmail. Please include a clear description of the vulnerability and any supporting information. We appreciate your responsible disclosure and will address the issue promptly. Thank you for your contribution to our project's security. 6 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # axe-magic 2 | 3 | This is a simple cli tool to manage Axe API projects easily. 4 | 5 | ## Usage 6 | 7 | ``` 8 | $ npm install -g axe-magic 9 | $ axe-magic --version 10 | ``` 11 | 12 | ## Commands 13 | 14 | To create a new project, you may use following command; 15 | 16 | ``` 17 | $ axe-magic new my-api 18 | ``` 19 | 20 | ## License 21 | 22 | [MIT License - Özgür Adem Işıklı](LICENSE) 23 | -------------------------------------------------------------------------------- /.github/workflows/npm-publish.yml: -------------------------------------------------------------------------------- 1 | name: NPM Publish 2 | on: 3 | push: 4 | branches: 5 | - master 6 | jobs: 7 | publish: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v1 11 | - uses: actions/setup-node@v1 12 | with: 13 | node-version: 20 14 | - run: npm install 15 | - uses: JS-DevTools/npm-publish@v1 16 | with: 17 | token: ${{ secrets.NPM_TOKEN }} 18 | -------------------------------------------------------------------------------- /src/cli.js: -------------------------------------------------------------------------------- 1 | const { Command } = require("commander"); 2 | const program = new Command(); 3 | const newCommand = require("./Commands/NewCommand"); 4 | 5 | program.name("axe-magic").description("AXE API CLI tool").version("2.0.0"); 6 | 7 | program 8 | .command("new") 9 | .description("Create a new Axe API project.") 10 | .argument("", "The name of the project") 11 | .action(newCommand); 12 | 13 | module.exports = { 14 | cli: () => program.parse(), 15 | }; 16 | -------------------------------------------------------------------------------- /.github/workflows/depraveyard.yml: -------------------------------------------------------------------------------- 1 | name: Depraveyard 2 | 3 | on: 4 | push: 5 | branches: 6 | - develop 7 | - master 8 | 9 | jobs: 10 | depraveyard: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v2 14 | - name: Use Node.js 15 | uses: actions/setup-node@v1 16 | with: 17 | node-version: 20.x 18 | - run: npm ci 19 | - name: Depraveyard pushing 20 | run: npx depraveyard push --orgId ozziest-org-YLASRc --accessId ${{ secrets.DEPRAVEYARD_ACCESS_ID }} --accessToken ${{ secrets.DEPRAVEYARD_TOKEN }} -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "axe-magic", 3 | "description": "AXE API CLI tool.", 4 | "version": "1.0.7", 5 | "main": "src/cli.js", 6 | "bin": { 7 | "axe-magic": "bin/axe-magic" 8 | }, 9 | "publishConfig": { 10 | "access": "public" 11 | }, 12 | "scripts": { 13 | "test": "echo \"Error: no test specified\" && exit 1" 14 | }, 15 | "keywords": [ 16 | "axe-api", 17 | "cli", 18 | "rest-api", 19 | "api" 20 | ], 21 | "author": { 22 | "name": "Özgür Adem Işıklı", 23 | "email": "i.ozguradem@gmail.com", 24 | "url": "https://ozgur.works" 25 | }, 26 | "engines": { 27 | "node": ">=18.0.0" 28 | }, 29 | "license": "MIT", 30 | "dependencies": { 31 | "colors": "^1.4.0", 32 | "commander": "^12.0.0", 33 | "rimraf": "^5.0.5", 34 | "shelljs": "^0.8.5" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Commands/NewCommand.js: -------------------------------------------------------------------------------- 1 | const shell = require("shelljs"); 2 | const rimraf = require("rimraf"); 3 | const fs = require("fs"); 4 | require("colors"); 5 | 6 | module.exports = async function (name, options) { 7 | let errors = null; 8 | 9 | console.log(`Directory name would be: ${name}`.green); 10 | 11 | console.log("Pulling example Axe API project...".yellow); 12 | await shell.exec( 13 | `git clone https://github.com/axe-api/axe-api-template.git ${name}` 14 | ); 15 | 16 | errors = shell.error(); 17 | if (errors !== null) { 18 | console.log("Some errors have occured!".red); 19 | shell.exit(0); 20 | } 21 | 22 | console.log("Creating .env file"); 23 | 24 | await fs.renameSync(`${name}/.env.example`, `${name}/.env`); 25 | await rimraf.sync(`${name}/.git`); 26 | console.log(`The project has been created!`.green); 27 | console.log(` 28 | Usage: 29 | 30 | $ cd ${name} 31 | $ npm install & npm run start:dev 32 | `); 33 | }; 34 | -------------------------------------------------------------------------------- /.github/workflows/auto-tag.yml: -------------------------------------------------------------------------------- 1 | name: Tag and Push 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | tag-and-push: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout repository 14 | uses: actions/checkout@v2 15 | 16 | - name: Setup Node.js 17 | uses: actions/setup-node@v4 18 | with: 19 | node-version: 20 20 | 21 | - name: Install jq 22 | run: sudo apt-get install jq 23 | 24 | - name: Get version from package.json 25 | id: version 26 | run: echo ::set-output name=version::$(jq -r .version package.json) 27 | 28 | - name: Tag and push to GitHub 29 | run: | 30 | git config --local user.email "i.ozguradem@gmail.com" 31 | git config --local user.name "Özgür Adem Işıklı" 32 | git tag -a "v${{ steps.version.outputs.version }}" -m "Version ${{ steps.version.outputs.version }}" 33 | git push origin "v${{ steps.version.outputs.version }}" 34 | 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Özgür Adem Işıklı 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | --------------------------------------------------------------------------------