mirror of
https://github.com/sern-handler/cli
synced 2026-06-06 01:16:53 +00:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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: npm deprecate @sern/cli@dev
|
||||
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 1.0.0 --preid "dev.$(git rev-parse --verify --short HEAD)"
|
||||
npm publish --tag dev --dry-run
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
|
||||
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 }}
|
||||
12
CHANGELOG.md
12
CHANGELOG.md
@@ -2,6 +2,18 @@
|
||||
|
||||
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.1](https://github.com/sern-handler/cli/compare/v0.2.0...v0.2.1) (2022-06-29)
|
||||
|
||||
|
||||
### 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)
|
||||
|
||||
|
||||
|
||||
28
README.md
28
README.md
@@ -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
|
||||
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@sern/cli",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@sern/cli",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"axios": "^0.27.2",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sern/cli",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"description": "A CLI for @sern/handler",
|
||||
"exports": "./src/index.js",
|
||||
"bin": {
|
||||
@@ -52,5 +52,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