13 Commits

Author SHA1 Message Date
EvolutionX
94757d67cb chore(release): 0.2.1 2022-06-29 12:23:47 +05:30
EvolutionX
6253571095 ci: update stuff 2022-06-29 11:59:57 +05:30
EvolutionX
c4c9b11bc2 ci: npm version stuff 2022-06-29 11:50:10 +05:30
EvolutionX
e06ae29fa1 ci: update workflows 2022-06-29 11:32:25 +05:30
EvolutionX
d455a9ef30 ci: update delivery workflow 2022-06-29 11:14:55 +05:30
Jacob Nguyen
9bd2b0f38b feat: making sern help message look better, adding ascii art (#50) 2022-06-29 10:17:07 +05:30
Jacob Nguyen
330b2ee92d docs: add better instructions for readme (#49) 2022-06-28 23:05:45 +05:30
Evo
8c45327094 fix: avoid crashing of cli when no plugin found (#47) 2022-06-22 11:53:42 -05:00
EvolutionX
361e6451a7 ci: damn it 2022-06-22 13:02:44 +05:30
EvolutionX
81eabff53e ci: finally done 2022-06-22 12:58:06 +05:30
EvolutionX
d78c20a491 ci: testing npm 3x 2022-06-22 12:49:07 +05:30
EvolutionX
a97bfdf9ee ci: testing npm 2x 2022-06-22 12:42:03 +05:30
EvolutionX
7276c2cb21 ci: testing npm 2022-06-22 12:40:17 +05:30
9 changed files with 139 additions and 28 deletions

28
.github/workflows/auto-deprecate.yml vendored Normal file
View 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 }}

View File

@@ -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
View 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 }}

View File

@@ -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)

View File

@@ -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
View File

@@ -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",

View File

@@ -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"
}
}

View File

@@ -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;
)}
`;
}

View File

@@ -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;
}