14 Commits

Author SHA1 Message Date
github-actions[bot]
6bb212a3be chore(main): release 1.2.0 (#131)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-29 00:38:02 -06:00
Jacob Nguyen
2d6e65a1e6 feat: make application id optional, thanks @trueharuu (#130)
make application id optional, thanks @trueharuu
2024-01-29 09:56:24 +05:30
github-actions[bot]
eb53ecb638 chore(main): release 1.1.0 (#129)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-27 23:50:17 -06:00
Jacob Nguyen
303ac0280c feat: command clear (#128) 2024-01-28 10:59:37 +05:30
github-actions[bot]
3f994d6948 chore(main): release 1.0.3 (#127)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-12-25 19:26:01 -06:00
Jacob Nguyen
a5cb66828e fix: intellisense for esm build ts (#126)
* fix: broken link and refactor
2023-12-25 11:47:46 -06:00
github-actions[bot]
667d0c1b89 chore(main): release 1.0.2 (#125)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-04 16:20:29 -05:00
Jacob Nguyen
5dbf2a87dc fix: better error handling 2023-11-04 16:14:00 -05:00
a309c085e9 chore: build docs rephrasing (#118)
Co-authored-by: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com>
2023-10-18 13:39:58 -05:00
f1d7d6c911 fix: build mkdir errors (#122)
Co-authored-by: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com>
2023-10-18 13:27:58 -05:00
Jacob Nguyen
4ec96dbe17 Update continuous-integration.yml 2023-10-18 13:18:29 -05:00
Peter-MJ-Parker
3970cc6911 chore: fix grammar in error message (#123) 2023-10-13 22:53:19 +05:30
github-actions[bot]
9045e1a03f chore(main): release 1.0.1 (#120)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-05 12:21:23 +05:30
Jacob Nguyen
d9ca5ff3ff fix: multiple bugs (#119) 2023-10-05 12:18:08 +05:30
15 changed files with 334 additions and 184 deletions

View File

@@ -11,25 +11,25 @@ on:
- main
jobs:
Lint:
name: Linting
runs-on: ubuntu-latest
# Lint:
# name: Linting
# runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
# steps:
# - name: Check out Git repository
# uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
- name: Set up Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
node-version: 17
# - name: Set up Node.js
# uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
# with:
# node-version: 17
# Prettier must be in `package.json`
- name: Install Node.js dependencies
run: npm i
# - name: Install Node.js dependencies
# run: npm i
- name: Run Prettier
run: npm run format
# - name: Run Prettier
# run: npm run format
Test:
name: Testing

View File

@@ -2,6 +2,42 @@
All notable changes to this project will be documented in this file.
## [1.2.0](https://github.com/sern-handler/cli/compare/v1.1.0...v1.2.0) (2024-01-29)
### Features
* make application id optional, thanks [@trueharuu](https://github.com/trueharuu) ([#130](https://github.com/sern-handler/cli/issues/130)) ([2d6e65a](https://github.com/sern-handler/cli/commit/2d6e65a1e6073f605aab192b8cea33037a04af2c))
## [1.1.0](https://github.com/sern-handler/cli/compare/v1.0.3...v1.1.0) (2024-01-28)
### Features
* command clear ([#128](https://github.com/sern-handler/cli/issues/128)) ([303ac02](https://github.com/sern-handler/cli/commit/303ac0280c7c7c55f2670d49c9685b911670bc05))
## [1.0.3](https://github.com/sern-handler/cli/compare/v1.0.2...v1.0.3) (2023-12-25)
### Bug Fixes
* intellisense for esm build ts ([#126](https://github.com/sern-handler/cli/issues/126)) ([a5cb668](https://github.com/sern-handler/cli/commit/a5cb66828eae47d3eac5b86c7e67c01dbed500d5))
## [1.0.2](https://github.com/sern-handler/cli/compare/v1.0.1...v1.0.2) (2023-11-04)
### Bug Fixes
* better error handling ([5dbf2a8](https://github.com/sern-handler/cli/commit/5dbf2a87dcb0001993fe126d9002bc82c8108e24))
* build mkdir errors ([#122](https://github.com/sern-handler/cli/issues/122)) ([f1d7d6c](https://github.com/sern-handler/cli/commit/f1d7d6c911bc54ed3ca3e39eefbc7de6ee33b10d))
## [1.0.1](https://github.com/sern-handler/cli/compare/v1.0.0...v1.0.1) (2023-10-05)
### Bug Fixes
* multiple bugs ([#119](https://github.com/sern-handler/cli/issues/119)) ([d9ca5ff](https://github.com/sern-handler/cli/commit/d9ca5ff3ff2f304a6d75f2b7a296bd900431d41f))
## [1.0.0](https://github.com/sern-handler/cli/compare/v0.6.0...v1.0.0) (2023-09-05)

188
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@sern/cli",
"version": "1.0.0",
"version": "1.2.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@sern/cli",
"version": "1.0.0",
"version": "1.2.0",
"license": "MIT",
"dependencies": {
"@esbuild-kit/cjs-loader": "^2.4.2",
@@ -30,7 +30,7 @@
"@favware/npm-deprecate": "1.0.7",
"@types/prompts": "2.4.4",
"prettier": "2.8.8",
"tsup": "6.7.0",
"tsup": "^6.7.0",
"typescript": "5.2.2"
},
"engines": {
@@ -443,9 +443,9 @@
}
},
"node_modules/@esbuild/android-arm": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.2.tgz",
"integrity": "sha512-tM8yLeYVe7pRyAu9VMi/Q7aunpLwD139EY1S99xbQkT4/q2qa6eA4ige/WJQYdJ8GBL1K33pPFhPfPdJ/WzT8Q==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.1.tgz",
"integrity": "sha512-yjTucwcOua52z14RL30JMwmCdylsQ5WrErGkAb6VL0MWPbnwJyLejydaRcUqkPO6g0MowlzavdxrR7AcfCW+yA==",
"cpu": [
"arm"
],
@@ -458,9 +458,9 @@
}
},
"node_modules/@esbuild/android-arm64": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.2.tgz",
"integrity": "sha512-lsB65vAbe90I/Qe10OjkmrdxSX4UJDjosDgb8sZUKcg3oefEuW2OT2Vozz8ef7wrJbMcmhvCC+hciF8jY/uAkw==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.1.tgz",
"integrity": "sha512-CqhrKvDSt76I0so/5afqgKrMv41FjbfUKFrcZddMnrZKqJU70I1MWLVJrImJuYMaY4Yb9rn4UKfF7oZ0BOleVw==",
"cpu": [
"arm64"
],
@@ -473,9 +473,9 @@
}
},
"node_modules/@esbuild/android-x64": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.2.tgz",
"integrity": "sha512-qK/TpmHt2M/Hg82WXHRc/W/2SGo/l1thtDHZWqFq7oi24AjZ4O/CpPSu6ZuYKFkEgmZlFoa7CooAyYmuvnaG8w==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.1.tgz",
"integrity": "sha512-VA29h01MrPkymIL1bFtvL2L4WPogiMGW2N/M+vXZHHOv6LgA9vjzVskTt0v5LjeCjx1PFDcR0ASKy8Y7Gm+iIA==",
"cpu": [
"x64"
],
@@ -488,9 +488,9 @@
}
},
"node_modules/@esbuild/darwin-arm64": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.2.tgz",
"integrity": "sha512-Ora8JokrvrzEPEpZO18ZYXkH4asCdc1DLdcVy8TGf5eWtPO1Ie4WroEJzwI52ZGtpODy3+m0a2yEX9l+KUn0tA==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.1.tgz",
"integrity": "sha512-Be4Cf6WDH7QkLHEpfzQOlBOFdqmqYTSqw2yG3SVmzB3++wy3K7wiNGedezL+q6Jb4weqT9tchO5kkLDC08Jnzg==",
"cpu": [
"arm64"
],
@@ -503,9 +503,9 @@
}
},
"node_modules/@esbuild/darwin-x64": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.2.tgz",
"integrity": "sha512-tP+B5UuIbbFMj2hQaUr6EALlHOIOmlLM2FK7jeFBobPy2ERdohI4Ka6ZFjZ1ZYsrHE/hZimGuU90jusRE0pwDw==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.1.tgz",
"integrity": "sha512-SewtenJi6zCEfZRSUchb+LgJ/IQw8QvnKECPu/qHII1fLQKnVPUVR+VH2IuS03DD9WWnAi3yfOvBNwtrp3WXtg==",
"cpu": [
"x64"
],
@@ -518,9 +518,9 @@
}
},
"node_modules/@esbuild/freebsd-arm64": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.2.tgz",
"integrity": "sha512-YbPY2kc0acfzL1VPVK6EnAlig4f+l8xmq36OZkU0jzBVHcOTyQDhnKQaLzZudNJQyymd9OqQezeaBgkTGdTGeQ==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.1.tgz",
"integrity": "sha512-TadKO0AaTDAPV2RyGZQ0AaiDTVYg7RsgNaA6OJjXXmoLbTs++NwHtzAmVFBq8Q/P9A11wgkv36HeyAYhWHbW1w==",
"cpu": [
"arm64"
],
@@ -533,9 +533,9 @@
}
},
"node_modules/@esbuild/freebsd-x64": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.2.tgz",
"integrity": "sha512-nSO5uZT2clM6hosjWHAsS15hLrwCvIWx+b2e3lZ3MwbYSaXwvfO528OF+dLjas1g3bZonciivI8qKR/Hm7IWGw==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.1.tgz",
"integrity": "sha512-DrFMGLF0/aAcZgwhtZr1cby7aHlalpFjLCe5CiI8mm0Kqhhc8gyNZKreaZzvir8CQe0H17p9xx6M9ben5R3r0g==",
"cpu": [
"x64"
],
@@ -548,9 +548,9 @@
}
},
"node_modules/@esbuild/linux-arm": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.2.tgz",
"integrity": "sha512-Odalh8hICg7SOD7XCj0YLpYCEc+6mkoq63UnExDCiRA2wXEmGlK5JVrW50vZR9Qz4qkvqnHcpH+OFEggO3PgTg==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.1.tgz",
"integrity": "sha512-lCWDVPpQO/Dt5MEqctKujgtUVmwQx7J2Q83EqX/9BejN7BIX4fGJ0QKMiIyy21PFh+/64ArN+Ovh1tzYkTt2wg==",
"cpu": [
"arm"
],
@@ -563,9 +563,9 @@
}
},
"node_modules/@esbuild/linux-arm64": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.2.tgz",
"integrity": "sha512-ig2P7GeG//zWlU0AggA3pV1h5gdix0MA3wgB+NsnBXViwiGgY77fuN9Wr5uoCrs2YzaYfogXgsWZbm+HGr09xg==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.1.tgz",
"integrity": "sha512-6ku/R2EzsdjyBaqQn+xGOPbv+BBYBXQYzlA04/46YQLmXkdApi0GYyUwiCXYBxm578iyywzGmM0rep1/q8tuFQ==",
"cpu": [
"arm64"
],
@@ -578,9 +578,9 @@
}
},
"node_modules/@esbuild/linux-ia32": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.2.tgz",
"integrity": "sha512-mLfp0ziRPOLSTek0Gd9T5B8AtzKAkoZE70fneiiyPlSnUKKI4lp+mGEnQXcQEHLJAcIYDPSyBvsUbKUG2ri/XQ==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.1.tgz",
"integrity": "sha512-8AKFBk9v/zBDsADvK/0BWZUxkjEc0QDwO8rvbHJKqAZx6DF/VSeBxTRmqWeecrJmx+n3kemEwML9z0eD9IHweQ==",
"cpu": [
"ia32"
],
@@ -593,9 +593,9 @@
}
},
"node_modules/@esbuild/linux-loong64": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.2.tgz",
"integrity": "sha512-hn28+JNDTxxCpnYjdDYVMNTR3SKavyLlCHHkufHV91fkewpIyQchS1d8wSbmXhs1fiYDpNww8KTFlJ1dHsxeSw==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.1.tgz",
"integrity": "sha512-6mOS5CxTGD8qOymp2y4KoM4ir+/REgjdJQFYpwP+WqjrWBo+PUevDGeHHjzCdw/R19PkFqS1bRzv8cTCmB/5kA==",
"cpu": [
"loong64"
],
@@ -608,9 +608,9 @@
}
},
"node_modules/@esbuild/linux-mips64el": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.2.tgz",
"integrity": "sha512-KbXaC0Sejt7vD2fEgPoIKb6nxkfYW9OmFUK9XQE4//PvGIxNIfPk1NmlHmMg6f25x57rpmEFrn1OotASYIAaTg==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.1.tgz",
"integrity": "sha512-Bzmv6rRMzR4ErG2k/jwfj5jKNzVMVEI1tThuirFdAoE+duUv+jlDnlwxsN3s1eqMzADTOV2sSIcUUOfgv++Dgg==",
"cpu": [
"mips64el"
],
@@ -623,9 +623,9 @@
}
},
"node_modules/@esbuild/linux-ppc64": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.2.tgz",
"integrity": "sha512-dJ0kE8KTqbiHtA3Fc/zn7lCd7pqVr4JcT0JqOnbj4LLzYnp+7h8Qi4yjfq42ZlHfhOCM42rBh0EwHYLL6LEzcw==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.1.tgz",
"integrity": "sha512-mPOxA7bd3nmx8TkuO/9M/tE0fnvmuX0wlpwnTL6DPLgkb/Z/KkupexSIw4cLfznn/fPzD89y17VWBjlVNyrpCQ==",
"cpu": [
"ppc64"
],
@@ -638,9 +638,9 @@
}
},
"node_modules/@esbuild/linux-riscv64": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.2.tgz",
"integrity": "sha512-7Z/jKNFufZ/bbu4INqqCN6DDlrmOTmdw6D0gH+6Y7auok2r02Ur661qPuXidPOJ+FSgbEeQnnAGgsVynfLuOEw==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.1.tgz",
"integrity": "sha512-znYb2Mhe9xKIDeIYuTD6vCcUltvYzRT5Yq6sVcdhPrGu8DRdsNZS04B2tSeM+j7T03jL4yY+7/G/jxSJJ9LX2A==",
"cpu": [
"riscv64"
],
@@ -653,9 +653,9 @@
}
},
"node_modules/@esbuild/linux-s390x": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.2.tgz",
"integrity": "sha512-U+RinR6aXXABFCcAY4gSlv4CL1oOVvSSCdseQmGO66H+XyuQGZIUdhG56SZaDJQcLmrSfRmx5XZOWyCJPRqS7g==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.1.tgz",
"integrity": "sha512-BBIE32cyqAYhMOQ42/jnecoF5P/S5lMob2vXSUiFpD3xCFbXOFkjP1OjfFKnalSO9+B5emvPTQFfNQXuLeVGEw==",
"cpu": [
"s390x"
],
@@ -668,9 +668,9 @@
}
},
"node_modules/@esbuild/linux-x64": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.2.tgz",
"integrity": "sha512-oxzHTEv6VPm3XXNaHPyUTTte+3wGv7qVQtqaZCrgstI16gCuhNOtBXLEBkBREP57YTd68P0VgDgG73jSD8bwXQ==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.1.tgz",
"integrity": "sha512-PoCvKdHTIbnHmVJ5OEdewGMSw40HDFRTrC/imwh8vrp695RbSUpOqBqNBT45neK0FQleGFbSE/A9X6HlXPDhqA==",
"cpu": [
"x64"
],
@@ -683,9 +683,9 @@
}
},
"node_modules/@esbuild/netbsd-x64": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.2.tgz",
"integrity": "sha512-WNa5zZk1XpTTwMDompZmvQLHszDDDN7lYjEHCUmAGB83Bgs20EMs7ICD+oKeT6xt4phV4NDdSi/8OfjPbSbZfQ==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.1.tgz",
"integrity": "sha512-4OrGMPorHCq9h52VLtyyyAmPjC2ZlANx54VDYyCrqXUOi+k0qxnPKXKKprVES67w2mE7TZJx9qZmT+jHeiZbHQ==",
"cpu": [
"x64"
],
@@ -698,9 +698,9 @@
}
},
"node_modules/@esbuild/openbsd-x64": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.2.tgz",
"integrity": "sha512-S6kI1aT3S++Dedb7vxIuUOb3oAxqxk2Rh5rOXOTYnzN8JzW1VzBd+IqPiSpgitu45042SYD3HCoEyhLKQcDFDw==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.1.tgz",
"integrity": "sha512-3a7ZYMjBC4P3FKdTmUZHJw7Mhzp71m+iSFFhX1PnLZ03qmyaB2K+vJZCk4PjRjAvm5lSupJQQtM/AFMyLgKlxQ==",
"cpu": [
"x64"
],
@@ -713,9 +713,9 @@
}
},
"node_modules/@esbuild/sunos-x64": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.2.tgz",
"integrity": "sha512-VXSSMsmb+Z8LbsQGcBMiM+fYObDNRm8p7tkUDMPG/g4fhFX5DEFmjxIEa3N8Zr96SjsJ1woAhF0DUnS3MF3ARw==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.1.tgz",
"integrity": "sha512-29yWBN5XfEjXT8yoeVb8cXfN1jAQLB+uskog1vBMhFR+YWOYvsrwPnh4hspETC/JnF95J+iETrvxgOUlICTWIw==",
"cpu": [
"x64"
],
@@ -728,9 +728,9 @@
}
},
"node_modules/@esbuild/win32-arm64": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.2.tgz",
"integrity": "sha512-5NayUlSAyb5PQYFAU9x3bHdsqB88RC3aM9lKDAz4X1mo/EchMIT1Q+pSeBXNgkfNmRecLXA0O8xP+x8V+g/LKg==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.1.tgz",
"integrity": "sha512-9Hb/WUXgyXlL55w3iNVyLkN9gq9x+agv3kk80foWbfpOwe7Qw4Vx6JGB+XQdsIfvvP1kShVQPIvBgVj0TxLlVw==",
"cpu": [
"arm64"
],
@@ -743,9 +743,9 @@
}
},
"node_modules/@esbuild/win32-ia32": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.2.tgz",
"integrity": "sha512-47gL/ek1v36iN0wL9L4Q2MFdujR0poLZMJwhO2/N3gA89jgHp4MR8DKCmwYtGNksbfJb9JoTtbkoe6sDhg2QTA==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.1.tgz",
"integrity": "sha512-VGdtEcXX/f01NgoM8emDnpdOyrZCQ7VTwLv89MOl3mvJ5fbCOBMNCa8t7RZS4lf12RS87qOuJFX7Bh9aLTbSxg==",
"cpu": [
"ia32"
],
@@ -758,9 +758,9 @@
}
},
"node_modules/@esbuild/win32-x64": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.2.tgz",
"integrity": "sha512-tcuhV7ncXBqbt/Ybf0IyrMcwVOAPDckMK9rXNHtF17UTK18OKLpg08glminN06pt2WCoALhXdLfSPbVvK/6fxw==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.1.tgz",
"integrity": "sha512-H6u8OHmJkKJubLbukVOyi9yA5lzK8VE4TFEkZj2vgusTUPvFeMQ8YnWviVc9F6PuKS6ZIpOvi2/sfiW8tQZQ2g==",
"cpu": [
"x64"
],
@@ -1447,9 +1447,9 @@
"dev": true
},
"node_modules/esbuild": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.2.tgz",
"integrity": "sha512-G6hPax8UbFakEj3hWO0Vs52LQ8k3lnBhxZWomUJDxfz3rZTLqF5k/FCzuNdLx2RbpBiQQF9H9onlDDH1lZsnjg==",
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.1.tgz",
"integrity": "sha512-IknHHwV4B/H4imOAu+416fuCvPfRjdncoyGi7eunhSvHuHkdNs50sLWan2LEG2Mym07TuW6gJUIyRS9G1miHEg==",
"hasInstallScript": true,
"bin": {
"esbuild": "bin/esbuild"
@@ -1458,28 +1458,28 @@
"node": ">=12"
},
"optionalDependencies": {
"@esbuild/android-arm": "0.19.2",
"@esbuild/android-arm64": "0.19.2",
"@esbuild/android-x64": "0.19.2",
"@esbuild/darwin-arm64": "0.19.2",
"@esbuild/darwin-x64": "0.19.2",
"@esbuild/freebsd-arm64": "0.19.2",
"@esbuild/freebsd-x64": "0.19.2",
"@esbuild/linux-arm": "0.19.2",
"@esbuild/linux-arm64": "0.19.2",
"@esbuild/linux-ia32": "0.19.2",
"@esbuild/linux-loong64": "0.19.2",
"@esbuild/linux-mips64el": "0.19.2",
"@esbuild/linux-ppc64": "0.19.2",
"@esbuild/linux-riscv64": "0.19.2",
"@esbuild/linux-s390x": "0.19.2",
"@esbuild/linux-x64": "0.19.2",
"@esbuild/netbsd-x64": "0.19.2",
"@esbuild/openbsd-x64": "0.19.2",
"@esbuild/sunos-x64": "0.19.2",
"@esbuild/win32-arm64": "0.19.2",
"@esbuild/win32-ia32": "0.19.2",
"@esbuild/win32-x64": "0.19.2"
"@esbuild/android-arm": "0.19.1",
"@esbuild/android-arm64": "0.19.1",
"@esbuild/android-x64": "0.19.1",
"@esbuild/darwin-arm64": "0.19.1",
"@esbuild/darwin-x64": "0.19.1",
"@esbuild/freebsd-arm64": "0.19.1",
"@esbuild/freebsd-x64": "0.19.1",
"@esbuild/linux-arm": "0.19.1",
"@esbuild/linux-arm64": "0.19.1",
"@esbuild/linux-ia32": "0.19.1",
"@esbuild/linux-loong64": "0.19.1",
"@esbuild/linux-mips64el": "0.19.1",
"@esbuild/linux-ppc64": "0.19.1",
"@esbuild/linux-riscv64": "0.19.1",
"@esbuild/linux-s390x": "0.19.1",
"@esbuild/linux-x64": "0.19.1",
"@esbuild/netbsd-x64": "0.19.1",
"@esbuild/openbsd-x64": "0.19.1",
"@esbuild/sunos-x64": "0.19.1",
"@esbuild/win32-arm64": "0.19.1",
"@esbuild/win32-ia32": "0.19.1",
"@esbuild/win32-x64": "0.19.1"
}
},
"node_modules/execa": {

View File

@@ -1,6 +1,6 @@
{
"name": "@sern/cli",
"version": "1.0.0",
"version": "1.2.0",
"description": "Official CLI for @sern/handler",
"exports": "./dist/index.js",
"bin": {
@@ -50,7 +50,7 @@
"@favware/npm-deprecate": "1.0.7",
"@types/prompts": "2.4.4",
"prettier": "2.8.8",
"tsup": "6.7.0",
"tsup": "^6.7.0",
"typescript": "5.2.2"
},
"engines": {

View File

@@ -54,66 +54,73 @@ export async function build(options: Record<string, any>) {
}
const sernConfig = await getConfig();
let buildConfig: Partial<BuildOptions> = {};
const entryPoints = await glob(`./src/**/*{${validExtensions.join(',')}}`, {
//for some reason, my ignore glob wasn't registering correctly'
ignore: {
ignored: (p) => p.name.endsWith('.d.ts'),
},
});
const buildConfigPath = resolve(options.project ?? 'sern.build.js');
const resolveBuildConfig = (path: string|undefined, language: string) => {
if(language === 'javascript') {
return path ?? resolve('jsconfig.json')
}
return path ?? resolve('tsconfig.json')
}
const defaultBuildConfig = {
defineVersion: true,
format: options.format ?? 'esm',
mode: options.mode ?? 'development',
dropLabels: [],
tsconfig: options.tsconfig ?? resolve('tsconfig.json'),
tsconfig: resolveBuildConfig(options.tsconfig, sernConfig.language),
env: options.env ?? resolve('.env'),
};
if (pathExistsSync(buildConfigPath)) {
try {
buildConfig = {
...defaultBuildConfig,
...(await import('file:///' + buildConfigPath)).default,
};
} catch (e) {
console.log(e);
process.exit(1);
}
} else {
//throwable, buildConfigPath may not exist
buildConfig = {
...defaultBuildConfig,
...(await import('file:///' + buildConfigPath)).default,
};
} else {
buildConfig = defaultBuildConfig;
console.log('No build config found, defaulting');
}
let env = {} as Record<string, string>;
configDotenv({ path: buildConfig.env, processEnv: env });
if (env.MODE && !env.NODE_ENV) {
const modeButNotNodeEnvExists = env.MODE && !env.NODE_ENV;
if (modeButNotNodeEnvExists) {
console.warn('Use NODE_ENV instead of MODE');
console.warn('MODE has no effect.');
console.warn(`https://nodejs.dev/en/learn/nodejs-the-difference-between-development-and-production/`);
console.warn(`https://nodejs.org/en/learn/getting-started/nodejs-the-difference-between-development-and-production`);
}
if (env.NODE_ENV) {
buildConfig.mode = env.NODE_ENV as 'production' | 'development';
console.log(magentaBright('NODE_ENV:'), 'Found NODE_ENV variable, setting `mode` to this.');
}
assert(buildConfig.mode === 'development' || buildConfig.mode === 'production', 'Mode is not `production` or `development`');
const defaultTsConfig = {
extends: './.sern/tsconfig.json',
};
!buildConfig.tsconfig && console.log('Using default options for tsconfig', defaultTsConfig);
const tsconfigRaw = require(buildConfig.tsconfig!);
sernConfig.language === 'typescript' &&
tsconfigRaw &&
!tsconfigRaw.extends &&
(console.warn('tsconfig does not contain an "extends". Will not use sern automatic path aliasing'),
console.warn('For projects that predate sern build and want to fully integrate, extend the tsconfig generated in .sern'),
console.warn('Extend preexisting tsconfig with top level: "extends": "./.sern/tsconfig.json"'));
try {
let config = require(buildConfig.tsconfig!);
config.extends && console.warn("Extend the generated tsconfig")
} catch(e) {
console.warn("no tsconfig / jsconfig found");
console.warn(`Please create a ${sernConfig.language === 'javascript' ? 'jsconfig.json' : 'tsconfig.json' }`);
console.warn("It should have at least extend the generated one sern makes.")
console.warn(`
{
"extends": "./.sern/tsconfig.json",
}`.trim())
throw e;
}
console.log(bold('Building with:'));
console.log(' ', magentaBright('defineVersion'), buildConfig.defineVersion);
console.log(' ', magentaBright('format'), buildConfig.format);
@@ -122,15 +129,15 @@ export async function build(options: Record<string, any>) {
console.log(' ', magentaBright('env'), buildConfig.env);
const sernDir = resolve('.sern'),
genDir = resolve(sernDir, 'generated'),
ambientFilePath = resolve(sernDir, 'ambient.d.ts'),
packageJsonPath = resolve('package.json'),
sernTsConfigPath = resolve(sernDir, 'tsconfig.json'),
packageJson = () => require(packageJsonPath);
genDir = resolve(sernDir, 'generated'),
ambientFilePath = resolve(sernDir, 'ambient.d.ts'),
packageJsonPath = resolve('package.json'),
sernTsConfigPath = resolve(sernDir, 'tsconfig.json'),
packageJson = () => require(packageJsonPath);
if (!(await pathExists(genDir))) {
console.log('Making .sern/generated dir, does not exist');
await mkdir(genDir);
await mkdir(genDir, { recursive: true });
}
try {
@@ -150,7 +157,7 @@ export async function build(options: Record<string, any>) {
await esbuild.build({
entryPoints,
plugins: [imageLoader, ...(buildConfig.esbuildPlugins ?? [])],
...defaultEsbuild(buildConfig.format!, tsconfigRaw),
...defaultEsbuild(buildConfig.format!, buildConfig.tsconfig),
define,
dropLabels: [buildConfig.mode === 'production' ? '__DEV__' : '__PROD__', ...buildConfig.dropLabels!],
});

View File

@@ -0,0 +1,60 @@
import * as Rest from '../rest.js'
import assert from 'node:assert'
import dotenv from 'dotenv'
import ora from 'ora';
import type { CommandData, GuildId } from '../utilities/types.js';
import { readFileSync, writeFile } from 'node:fs'
import { resolve } from 'node:path'
import prompts from 'prompts';
const getConfirmation = (args: Record<string,any> ) => {
if(args.yes) {
return args.yes
} else {
return prompts({
type: 'confirm',
name: 'confirmation',
message: 'Are you sure you want to delete ALL your application commands?',
initial: true
}, { onCancel: () => (console.log("Cancelled operation ( ̄┰ ̄*)"), process.exit(1)) })
.then(response => response.confirmation);
}
}
export async function commandClear(args: Record<string,any>) {
dotenv.configDotenv({ path: args.env || resolve('.env') })
const token = process.env.token || process.env.DISCORD_TOKEN;
assert(token, 'Could not find a token for this bot in .env or commandline. Do you have DISCORD_TOKEN in env?');
const confirmation = await getConfirmation(args);
if (confirmation) {
const spin = ora({
text: `Deleting ALL application commands...`,
spinner: 'aesthetic',
}).start();
const rest = await Rest.create(token);
let guildCommands: Record<GuildId, CommandData[]>
try {
guildCommands = JSON.parse(readFileSync('.sern/command-data-remote.json', 'utf-8'))
await rest.updateGlobal([]);
delete guildCommands.global
for (const guildId in guildCommands) {
await rest.putGuildCommands(guildId, []);
}
writeFile('.sern/command-data-remote.json', "{}", (err) => {
if(err) {
spin.fail("Error happened while writing to json:");
console.error(err)
process.exit(1)
}
})
spin.succeed();
} catch(e) {
spin.fail("Something went wrong. ");
throw e;
}
} else {
console.log('Operation canceled. ( ̄┰ ̄*)');
}
}

View File

@@ -14,9 +14,11 @@ export function list() {
const globalCommands = commands.global;
delete commands.global;
console.log(bold('Global Commands'));
for (const command of globalCommands) log(command);
if(globalCommands) {
console.log(bold('Global Commands'));
for (const command of globalCommands) log(command);
}
console.log('\t');
for (const guildId in commands) {

View File

@@ -14,8 +14,8 @@ export async function publish(commandDir: string | undefined, args: Partial<Publ
// assign args.import to empty array if non existent
args.import ??= [];
args.token && console.info('token passed through command line');
args.applicationId && console.info('applicationId passed through command line');
args.token && console.info('Token passed through command line');
args.applicationId && console.info(magentaBright('WARNING')+ ' This option is deprecated. Do not pass applicationId through command line');
commandDir && console.info('Publishing with override path: ', commandDir);
const dotenvLocation = new URL('../node_modules/dotenv/config.js', rootPath),

View File

@@ -10,9 +10,8 @@ import { once } from 'node:events';
import * as Rest from './rest';
import type { sernConfig } from './utilities/getConfig';
import type { PublishableData, PublishableModule, Typeable } from './create-publish.d.ts';
import { cyanBright, greenBright, redBright } from 'colorette';
import { cyanBright, greenBright, magentaBright, redBright } from 'colorette';
import ora from 'ora';
import type { TheoreticalEnv } from './types/config';
async function deriveFileInfo(dir: string, file: string) {
const fullPath = join(dir, file);
@@ -58,7 +57,10 @@ async function* readPaths(dir: string, shouldDebug: boolean): AsyncGenerator<str
// recieved sern config
const [{ config, preloads, commandDir }] = await once(process, 'message'),
{ paths } = config as sernConfig;
for (const preload of preloads) {
console.log("preloading: ", preload);
await import('file:///' + resolve(preload));
}
@@ -126,6 +128,18 @@ const makeDescription = (type: number, desc: string) => {
}
return desc;
};
const serialize = (permissions: unknown) => {
if(typeof permissions === 'bigint' || typeof permissions === 'number') {
return permissions.toString();
}
if(Array.isArray(permissions)) {
return permissions
.reduce((acc, cur) => acc | cur, BigInt(0))
.toString()
}
return null;
}
const makePublishData = ({ commandModule, config }: Record<string, Record<string, unknown>>) => {
const applicationType = intoApplicationType(commandModule.type as number);
@@ -137,7 +151,7 @@ const makePublishData = ({ commandModule, config }: Record<string, Record<string
absPath: commandModule.absPath as string,
options: optionsTransformer((commandModule?.options ?? []) as Typeable[]),
dm_permission: config?.dmPermission,
default_member_permissions: config?.defaultMemberPermissions ?? null,
default_member_permissions: serialize(config?.defaultMemberPermissions),
},
config,
};
@@ -149,8 +163,7 @@ const publishableData = modules.map(makePublishData),
appid = process.env.applicationId || process.env.APPLICATION_ID;
assert(token, 'Could not find a token for this bot in .env or commandline. Do you have DISCORD_TOKEN in env?');
assert(appid, 'Could not find an application id for this bot in .env or commandline. Do you have APPLICATION_ID in env?');
appid && console.warn(`${magentaBright('WARNING')}: APPLICATION_ID is not necessary anymore`);
// partition globally published and guilded commands
const [globalCommands, guildedCommands] = publishableData.reduce(
([globals, guilded], module) => {
@@ -167,28 +180,36 @@ const spin = ora(`Publishing ${cyanBright('Global')} commands`);
globalCommands.length && spin.start();
const rest = Rest.create(appid, token);
const rest = await Rest.create(token);
const res = await rest.updateGlobal(globalCommands);
let globalCommandsResponse: unknown;
if (res.ok) {
spin.succeed(`All ${cyanBright('Global')} commands published`);
globalCommands.length && spin.succeed(`All ${cyanBright('Global')} commands published`);
globalCommandsResponse = await res.json();
} else {
spin.fail(`Failed to publish global commands [Code: ${redBright(res.status)}]`);
if (res.status === 429) {
throw Error('Chill out homie, too many requests');
switch(res.status) {
case 400 :
throw Error("400: Ensure your commands have proper fields and data with nothing left out");
case 404 :
throw Error("Forbidden 404. Is you application id and/or token correct?")
case 429:
throw Error('Chill out homie, too many requests')
}
console.error(
'errors:',
await res.json().then((res) => {
const errors = Object.values(res.errors);
// @ts-ignore
return errors.map((err) => err?.name?._errors);
})
console.error('errors:',
await res
.json()
.then((res) => {
const errors = Object.values(res?.errors ?? {});
// @ts-ignore
return errors.map((err) => err?.name?._errors);
})
.catch(() => "No errors found (Unparsable json for a request with bad status code). Read the status code.")
);
console.error(res.statusText);
console.error("Status Text ", res.statusText);
}
function associateGuildIdsWithData(data: PublishableModule[]): Map<string, PublishableData[]> {
@@ -208,7 +229,6 @@ function associateGuildIdsWithData(data: PublishableModule[]): Map<string, Publi
});
}
});
return guildIdMap;
}
const guildCommandMap = associateGuildIdsWithData(guildedCommands);
@@ -227,7 +247,14 @@ for (const [guildId, array] of guildCommandMap.entries()) {
spin.succeed(`[${greenBright(guildId)}] Successfully updated commands for guild`);
} else {
spin.fail(`[${redBright(guildId)}] Failed to update commands for guild, Reason: ${result.message}`);
throw Error(result.message);
switch(response.status) {
case 400 :
throw Error("400: Ensure your commands have proper fields and data and nothing left out");
case 404 :
throw Error("Forbidden 404. Is you application id and/or token correct?")
case 429:
throw Error('Chill out homie, too many requests')
}
}
}
const remoteData = {

View File

@@ -43,12 +43,16 @@ program //
.option('--appId [applicationId]')
.argument('[path]', 'path with respect to current working directory that will locate all published files')
.action(async (...args) => importDynamic('publish.js').then((m) => m.publish(...args)))
)
.addCommand(
).addCommand(
new Command('list') //
.description('List all slash commands')
.action(async (...args) => importDynamic('list.js').then((m) => m.list(...args)))
);
.action(async (...args) => importDynamic('list.js').then((m) => m.list(...args))))
.addCommand(
new Command('clear')
.description('Clear and reset commands-data-remote.json and the api')
.option('-y, --yes', "Say yes to all prompts")
.option('-e, --env [path]', "Supply a path to a .env")
.action(async (...args) => importDynamic('command-clear.js').then((m) => m.commandClear(...args))));
program
.command('build')
@@ -56,7 +60,7 @@ program
.option('-f --format [fmt]', 'The module system of your application. `cjs` or `esm`', 'esm')
.option('-m --mode [mode]', 'the mode for sern to build in. `production` or `development`', 'development')
.option('-W --suppress-warnings', 'suppress experimental warning')
.option('-p --project [filePath]', 'build with this sern.build file')
.option('-p --project [filePath]', 'build with the provided sern.build file')
.option('-e --env', 'path to .env file')
.option('--tsconfig [filePath]', 'Use this tsconfig')
.action(async (...args) => importDynamic('build.js').then((m) => m.build(...args)));

View File

@@ -11,12 +11,22 @@ const publishablesIntoJson = (ps: PublishableModule[]) =>
4
);
export const create = (appid: string, token: string) => {
const globalURL = new URL(`${appid}/commands`, baseURL);
export const create = async (token: string) => {
const headers = {
Authorization: 'Bot ' + token,
'Content-Type': 'application/json',
};
let me;
let appid: string;
try {
me = await fetch(new URL('@me', baseURL), { headers }).then(res => res.json());
appid = me.id;
} catch(e) {
console.log("Something went wrong while trying to fetch your application:");
throw e;
}
const globalURL = new URL(`${appid}/commands`, baseURL);
return {
updateGlobal: (commands: PublishableModule[]) =>
fetch(globalURL, {

View File

@@ -13,7 +13,7 @@ export interface sernConfig {
export interface TheoreticalEnv {
DISCORD_TOKEN: string;
APPLICATION_ID: string;
APPLICATION_ID?: string;
MODE: 'PROD' | 'DEV';
[name: string]: string;
}

View File

@@ -1,11 +1,11 @@
import type esbuild from 'esbuild';
import { resolve } from 'path';
export default (format: 'cjs' | 'esm', tsconfigRaw: unknown) =>
export default (format: 'cjs' | 'esm', tsconfig: string|undefined) =>
({
platform: 'node',
format,
tsconfigRaw: tsconfigRaw as esbuild.TsconfigRaw,
tsconfig: tsconfig,
logLevel: 'info',
minify: false,
outdir: resolve('dist'),

View File

@@ -6,9 +6,9 @@ const processEnvType = (env: NodeJS.ProcessEnv) => {
const envBuilder = new StringWriter();
for (const key of entries) {
envBuilder.tab();
envBuilder.tab();
envBuilder.envField(key);
envBuilder.tab()
.tab()
.envField(key);
}
return envBuilder.build();
};
@@ -40,6 +40,8 @@ const writeTsConfig = async (format: 'cjs' | 'esm', configPath: string, fw: File
const target = format === 'esm' ? { target: 'esnext' } : {};
const sernTsConfig = {
compilerOptions: {
//module determines top level await. CJS doesn't have that abliity afaik
module: format === 'cjs' ? 'node' : 'esnext',
moduleResolution: 'node',
strict: true,
skipLibCheck: true,
@@ -69,6 +71,7 @@ class StringWriter {
return this;
}
envField(key: string) {
//if env field has space or parens, wrap key in ""
if (/\s|\(|\)/g.test(key)) {
this.fileString += `"${key}": string`;
} else {

View File

@@ -1,7 +1,11 @@
import { defineConfig } from 'tsup';
import { createRequire } from 'node:module';
const shared = {
entry: ['src/index.ts', 'src/create-publish.mts', 'src/commands/**', 'sern-tsconfig.json'],
entry: [
'src/index.ts',
'src/create-publish.mts',
'src/commands/**',
],
clean: true,
sourcemap: true,
};
@@ -18,8 +22,5 @@ export default defineConfig({
define: {
__VERSION__: `"${createRequire(import.meta.url)('./package.json').version}"`,
},
loader: {
'.json': 'file',
},
...shared,
});