From 522e875a64390a74e3287e81f47ea6a775a051bc Mon Sep 17 00:00:00 2001 From: Rafal Dziegielewski Date: Fri, 1 Dec 2023 14:03:47 +0100 Subject: [PATCH] chore: add github/release files --- .github/workflows/push.yml | 35 +++++++++++++++++++++++++ .npmignore | 9 +++++++ .npmrc | 1 + .releaserc | 16 ++++++++++++ README.md | 52 ++++++++++++++++++++++++++++++++++++++ commitlint.config.cjs | 3 +++ package.json | 15 +++++++---- 7 files changed, 126 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/push.yml create mode 100644 .npmignore create mode 100644 .npmrc create mode 100644 .releaserc create mode 100644 README.md create mode 100644 commitlint.config.cjs diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 0000000..935bd79 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,35 @@ +name: CI/CD +on: push +env: + NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + +jobs: + testAndPublish: + name: Test & Publish + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup + uses: actions/setup-node@v2 + with: + node-version: '18' + - uses: actions/cache@v2 + id: yarn-cache + with: + path: node_modules + key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-node_modules- + - name: Install + if: steps.yarn-cache.outputs.cache-hit != 'true' + run: yarn install + - name: Build + run: yarn build + - name: Release + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: yarn release diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..cce9b83 --- /dev/null +++ b/.npmignore @@ -0,0 +1,9 @@ +node_modules +.github +commitlint.config.cjs +.idea +test +src +.releaserc +.prettierrc +.eslintrc.cjs diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..94a06c2 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +access=public diff --git a/.releaserc b/.releaserc new file mode 100644 index 0000000..ba388c8 --- /dev/null +++ b/.releaserc @@ -0,0 +1,16 @@ +{ + "branches": [ + "main", + { + "name": "beta", + "prerelease": true + } + ], + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/npm", + "@semantic-release/github", + "@semantic-release/git" + ] +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..77221d0 --- /dev/null +++ b/README.md @@ -0,0 +1,52 @@ +# @adminjs/cli + +An official CLI tool of AdminJS. + +## AdminJS + +AdminJS is an automatic admin interface which can be plugged into your application. You, as a developer, provide database models (like posts, comments, stores, products or whatever else your application uses), and AdminJS generates UI which allows you (or other trusted users) to manage content. + +Check out AdminJS Demo: https://demo.adminjs.co + +Or visit [AdminJS](https://github.com/SoftwareBrothers/adminjs) github page. + +## Installation + +NPM: +```bash +$ npm i -g @adminjs/cli +``` + +Yarn: +```bash +$ yarn global add @adminjs/cli +``` + +## Commands + +Create an AdminJS project: +``` +$ adminjs create +``` + +View the list of available commands: +``` +$ adminjs help +``` + +## Development + +TBA + +## License + +AdminJS is copyrighted © 2023 rst.software. It is a free software, and may be redistributed under the terms specified in the [LICENSE](LICENSE.md) file. + +## About rst.software + + + +We’re an open, friendly team that helps clients from all over the world to transform their businesses and create astonishing products. + +* We are available for [hire](https://www.rst.software/estimate-your-project). +* If you want to work for us - check out the [career page](https://www.rst.software/join-us). diff --git a/commitlint.config.cjs b/commitlint.config.cjs new file mode 100644 index 0000000..84dcb12 --- /dev/null +++ b/commitlint.config.cjs @@ -0,0 +1,3 @@ +module.exports = { + extends: ['@commitlint/config-conventional'], +}; diff --git a/package.json b/package.json index 7310f21..f30b28c 100644 --- a/package.json +++ b/package.json @@ -18,13 +18,15 @@ "dev": "yarn clean && yarn build && yarn register:local" }, "devDependencies": { + "@commitlint/cli": "^17.4.4", + "@commitlint/config-conventional": "^17.4.4", + "@semantic-release/git": "^10.0.1", "@types/fs-extra": "^11.0.4", "@types/node": "^18.15.11", "@types/prompts": "^2.4.9", "@types/randomstring": "^1.1.11", "@typescript-eslint/eslint-plugin": "^5.58.0", "@typescript-eslint/parser": "^5.58.0", - "copyfiles": "^2.4.1", "eslint": "^8.38.0", "eslint-config-airbnb": "^19.0.4", "eslint-config-prettier": "^9.0.0", @@ -33,18 +35,21 @@ "eslint-plugin-prettier": "^5.0.1", "eslint-plugin-react": "^7.32.2", "eslint-plugin-react-hooks": "^4.6.0", - "fs-extra": "^11.1.1", + "husky": "^8.0.3", "prettier": "^3.1.0", - "prompts": "^2.4.2", - "rimraf": "^5.0.0", + "semantic-release": "^21.0.1", "typescript": "^5.0.4" }, "dependencies": { "chalk": "^5.3.0", + "copyfiles": "^2.4.1", "flat": "^6.0.1", + "fs-extra": "^11.1.1", "pino": "^8.16.2", "pino-pretty": "^10.2.3", - "randomstring": "^1.3.0" + "prompts": "^2.4.2", + "randomstring": "^1.3.0", + "rimraf": "^5.0.0" }, "bin": { "adminjs": "./lib/cli.js"