mirror of
https://github.com/sern-handler/cli
synced 2026-06-06 17:36:53 +00:00
Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b260eb1bc | ||
|
|
428b87ee1f | ||
|
|
493189772f | ||
|
|
dff1481e19 | ||
|
|
9264dde532 | ||
|
|
ffc1e6f3eb | ||
|
|
95c20a3edf | ||
|
|
c351bd5c0b | ||
|
|
f218e6524b | ||
|
|
afd0b46ffc | ||
|
|
c730986264 | ||
|
|
03dddd4384 | ||
|
|
177766e357 | ||
|
|
7cbde33af2 | ||
|
|
58922bf69e | ||
|
|
92b713e476 | ||
|
|
94757d67cb | ||
|
|
6253571095 | ||
|
|
c4c9b11bc2 | ||
|
|
e06ae29fa1 | ||
|
|
d455a9ef30 | ||
|
|
9bd2b0f38b | ||
|
|
330b2ee92d | ||
|
|
8c45327094 | ||
|
|
361e6451a7 | ||
|
|
81eabff53e | ||
|
|
d78c20a491 | ||
|
|
a97bfdf9ee | ||
|
|
7276c2cb21 |
28
.github/workflows/auto-deprecate.yml
vendored
Normal file
28
.github/workflows/auto-deprecate.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
name: NPM Auto Deprecate
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
auto-deprecate:
|
||||
name: NPM Auto Deprecate
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # tag=v3
|
||||
with:
|
||||
node-version: 17
|
||||
registry-url: 'https://registry.npmjs.org/'
|
||||
|
||||
- name: Install Node.js dependencies
|
||||
run: npm i
|
||||
- name: Deprecate versions
|
||||
run: npx npm-deprecate --name "*dev*" --package "@sern/cli" --message "This is a deprecated version of @sern/cli@dev. Please use the latest dev version."
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
19
.github/workflows/continuous-delivery.yml
vendored
19
.github/workflows/continuous-delivery.yml
vendored
@@ -1,12 +1,13 @@
|
||||
name: Continuous Delivery
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
Build:
|
||||
name: Building
|
||||
Publish:
|
||||
name: Publishing Dev
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
@@ -28,13 +29,9 @@ jobs:
|
||||
- name: Test Sern
|
||||
run: sern
|
||||
|
||||
Publish:
|
||||
name: Publishing to npm
|
||||
runs-on: ubuntu-latest
|
||||
needs: [Build]
|
||||
steps:
|
||||
- name: Publish to npm
|
||||
run: npm publish
|
||||
run: |
|
||||
npm version premajor --preid "dev.$(git rev-parse --verify --short HEAD)" --git-tag-version=false
|
||||
npm publish --tag dev
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
|
||||
2
.github/workflows/continuous-integration.yml
vendored
2
.github/workflows/continuous-integration.yml
vendored
@@ -50,5 +50,5 @@ jobs:
|
||||
- name: Link Project
|
||||
run: npm link
|
||||
|
||||
- name: Test Sern
|
||||
- name: Test sern
|
||||
run: sern
|
||||
|
||||
35
.github/workflows/release.yml
vendored
Normal file
35
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
Publish:
|
||||
name: Publishing
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # tag=v3
|
||||
with:
|
||||
node-version: 17
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
- name: Install Node.js dependencies
|
||||
run: npm i
|
||||
|
||||
- name: Link Project
|
||||
run: npm link
|
||||
|
||||
- name: Test sern
|
||||
run: sern
|
||||
|
||||
- name: Publish to npm
|
||||
run: npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
5
.npmignore
Normal file
5
.npmignore
Normal file
@@ -0,0 +1,5 @@
|
||||
renovate.json
|
||||
tsconfig.json
|
||||
.prettierignore
|
||||
.prettierrc
|
||||
.github/
|
||||
14
CHANGELOG.md
14
CHANGELOG.md
@@ -2,6 +2,20 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
### [0.2.2](https://github.com/sern-handler/cli/compare/v0.2.1...v0.2.2) (2022-07-05)
|
||||
|
||||
### [0.2.1](https://github.com/sern-handler/cli/compare/v0.2.0...v0.2.1) (2022-07-05)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* making sern help message look better, adding ascii art ([#50](https://github.com/sern-handler/cli/issues/50)) ([9bd2b0f](https://github.com/sern-handler/cli/commit/9bd2b0f38be835a31fceeabdf60487a1424cdf7e))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* avoid crashing of cli when no plugin found ([#47](https://github.com/sern-handler/cli/issues/47)) ([8c45327](https://github.com/sern-handler/cli/commit/8c45327094b2560f7b5c813a1c1925920bd46038))
|
||||
|
||||
## [0.2.0](https://github.com/sern-handler/cli/compare/v0.1.3...v0.2.0) (2022-06-22)
|
||||
|
||||
|
||||
|
||||
30
README.md
30
README.md
@@ -1,4 +1,4 @@
|
||||
# Sern CLI
|
||||
# sern CLI
|
||||
|
||||
Our CLI allows you to setup and manage Discord bot projects without writing a single line of code!
|
||||
|
||||
@@ -25,11 +25,35 @@ pnpm add -g @sern/cli@latest
|
||||
|
||||
When you install the CLI, you can use our commands with **sern** prefix.
|
||||
|
||||
`sern <command> (opt)<flag>`
|
||||
```
|
||||
Usage: sern [options] [command]
|
||||
|
||||
Welcome to sern!
|
||||
If you're new to sern, run sern init for an interactive setup to your new bot project!
|
||||
|
||||
If you have any ideas, suggestions, bug reports, kindly join our support server: https://discord.gg/xzK5fUKT4r
|
||||
|
||||
Options:
|
||||
-V, --version output the version number
|
||||
-h, --help display help for command
|
||||
|
||||
Commands:
|
||||
init [options] Quickest way to scaffold a new project
|
||||
plugins [options] Install plugins from https://github.com/sern-handler/awesome-plugins
|
||||
extra Easy way to add extra things in your sern project
|
||||
help [command] display help for command
|
||||
|
||||
```
|
||||
|
||||
## Setting Up Your Project
|
||||
|
||||
#### TODO
|
||||
Run `sern init (-y)` for an interactive setup on a brand new project using our framework. <br>
|
||||
Adding the `-y` flag sets up project as default. ( **Note** : the default initiates a typescript project)
|
||||
|
||||
## Installing Plugins
|
||||
|
||||
sern runs on your plugins. Contribute to the [repository](https://github.com/sern-handler/awesome-plugins) and then install the plugins via our cli! <br>
|
||||
Run `sern plugins` to see all installable options
|
||||
|
||||
## Stats
|
||||
|
||||
|
||||
99
dumpfiles.js
99
dumpfiles.js
@@ -1,99 +0,0 @@
|
||||
//! Message for Sern CLI developers. Please ignore this file.
|
||||
|
||||
const SpinnerName = [
|
||||
'dots',
|
||||
'dots2',
|
||||
'dots3',
|
||||
'dots4',
|
||||
'dots5',
|
||||
'dots6',
|
||||
'dots7',
|
||||
'dots8',
|
||||
'dots9',
|
||||
'dots10',
|
||||
'dots11',
|
||||
'dots12',
|
||||
'dots8Bit',
|
||||
'line',
|
||||
'line2',
|
||||
'pipe',
|
||||
'simpleDots',
|
||||
'simpleDotsScrolling',
|
||||
'star',
|
||||
'star2',
|
||||
'flip',
|
||||
'hamburger',
|
||||
'growVertical',
|
||||
'growHorizontal',
|
||||
'balloon',
|
||||
'balloon2',
|
||||
'noise',
|
||||
'bounce',
|
||||
'boxBounce',
|
||||
'boxBounce2',
|
||||
'triangle',
|
||||
'arc',
|
||||
'circle',
|
||||
'squareCorners',
|
||||
'circleQuarters',
|
||||
'circleHalves',
|
||||
'squish',
|
||||
'toggle',
|
||||
'toggle2',
|
||||
'toggle3',
|
||||
'toggle4',
|
||||
'toggle5',
|
||||
'toggle6',
|
||||
'toggle7',
|
||||
'toggle8',
|
||||
'toggle9',
|
||||
'toggle10',
|
||||
'toggle11',
|
||||
'toggle12',
|
||||
'toggle13',
|
||||
'arrow',
|
||||
'arrow2',
|
||||
'arrow3',
|
||||
'bouncingBar',
|
||||
'bouncingBall',
|
||||
'smiley',
|
||||
'monkey',
|
||||
'hearts',
|
||||
'clock',
|
||||
'earth',
|
||||
'material',
|
||||
'moon',
|
||||
'runner',
|
||||
'pong',
|
||||
'shark',
|
||||
'dqpb',
|
||||
'weather',
|
||||
'christmas',
|
||||
'grenade',
|
||||
'point',
|
||||
'layer',
|
||||
'betaWave',
|
||||
'fingerDance',
|
||||
'fistBump',
|
||||
'soccerHeader',
|
||||
'mindblown',
|
||||
'speaker',
|
||||
'orangePulse',
|
||||
'bluePulse',
|
||||
'orangeBluePulse',
|
||||
'timeTravel',
|
||||
'aesthetic',
|
||||
];
|
||||
|
||||
// const p = new Promise((resolve) => {
|
||||
// SpinnerName.forEach((spin, i, ar) => {
|
||||
// setTimeout(() => {
|
||||
// spinner.spinner = spin;
|
||||
// spinner.text = `Initializing... ${spin}`;
|
||||
// if (i === ar.length - 1) {
|
||||
// resolve();
|
||||
// }
|
||||
// }, i * 1000);
|
||||
// });
|
||||
// });
|
||||
// p.then(() => spinner.succeed('Finished!'));
|
||||
3004
package-lock.json
generated
3004
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
13
package.json
13
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sern/cli",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.2",
|
||||
"description": "A CLI for @sern/handler",
|
||||
"exports": "./src/index.js",
|
||||
"bin": {
|
||||
@@ -42,9 +42,10 @@
|
||||
"prompts": "2.4.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/prompts": "^2.0.14",
|
||||
"cz-conventional-changelog": "3.0.1",
|
||||
"eslint": "8.18.0",
|
||||
"@favware/npm-deprecate": "1.0.4",
|
||||
"@types/prompts": "2.0.14",
|
||||
"cz-conventional-changelog": "3.3.0",
|
||||
"eslint": "8.19.0",
|
||||
"prettier": "2.7.1",
|
||||
"standard-version": "9.5.0"
|
||||
},
|
||||
@@ -52,5 +53,9 @@
|
||||
"commitizen": {
|
||||
"path": "./node_modules/cz-conventional-changelog"
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org/",
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
import { cyanBright, yellowBright, green } from 'colorette';
|
||||
import { cyanBright, green, yellowBright } from 'colorette';
|
||||
|
||||
export function help() {
|
||||
let guide = 'Welcome to Sern!\n';
|
||||
guide += `If you're new to ${cyanBright('Sern')}, run ${yellowBright(
|
||||
return `
|
||||
___ ___ _ __ _ __
|
||||
/ __|/ _ \\ '__| '_ \\
|
||||
\\__ \\ __/ | | | | |
|
||||
|___/\\___|_| |_| |_|
|
||||
|
||||
Welcome!
|
||||
If you're new to ${cyanBright('sern')}, run ${yellowBright(
|
||||
'sern init'
|
||||
)} for an interactive setup to your new bot project!\n\n`;
|
||||
guide += `${green(
|
||||
)} for an interactive setup to your new bot project!
|
||||
|
||||
${green(
|
||||
`If you have any ideas, suggestions, bug reports, kindly join our support server: https://discord.gg/xzK5fUKT4r`
|
||||
)}`;
|
||||
return guide;
|
||||
)}
|
||||
`;
|
||||
}
|
||||
|
||||
@@ -5,11 +5,15 @@ async function gimmechoices() {
|
||||
(await getLang()) === 'typescript' ? 'TypeScript' : 'JavaScript';
|
||||
const link = `https://api.github.com/repos/sern-handler/awesome-plugins/contents/${lang}`;
|
||||
|
||||
const data = (await axios.get(link)).data;
|
||||
const choices = data.map((e) => ({
|
||||
title: e.name,
|
||||
value: e.download_url,
|
||||
}));
|
||||
const resp = await axios.default.get(link).catch(() => null);
|
||||
if (!resp) return { title: 'No plugins found!', value: '', disabled: true };
|
||||
const { data } = resp;
|
||||
const choices = data.map(
|
||||
(/** @type {{ name: string; download_url: string; }} */ e) => ({
|
||||
title: e.name,
|
||||
value: e.download_url,
|
||||
})
|
||||
);
|
||||
return choices;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user