Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

Commit

Permalink
fix: 🌻
Browse files Browse the repository at this point in the history
  • Loading branch information
nyrion committed Nov 6, 2021
1 parent 9fa03de commit 622884e
Show file tree
Hide file tree
Showing 58 changed files with 1,347 additions and 782 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
<img src="https://img.shields.io/badge/slack-@resistjs-green.svg?logo=slack"/>
</a>
<a href="https://www.linkedin.com/company/resist-js" target="_blank">
<img src="https://img.shields.io/badge/linkedin-resistjs-blue.svg?logo=linkedin"/>
<img src="https://img.shields.io/badge/linkedin-resist-js-blue.svg?logo=linkedin"/>
</a>
<a href="https://twitter.com/resist_js" target="_blank">
<img src="https://img.shields.io/badge/twitter-resistjs-blue.svg?logo=twitter"/>
<img src="https://img.shields.io/badge/twitter-resist_js-blue.svg?logo=twitter"/>
</a>
<a href="https://opencollective.com/resistjs" target="_blank">
<a href="https://opencollective.com/resist-js" target="_blank">
<img alt="Open Collective backers and sponsors" src="https://img.shields.io/opencollective/all/resist-js?style=flat-square"/>
</a>
<a href="https://github.com/resist-js/ama" target="_blank">
Expand Down Expand Up @@ -131,6 +131,14 @@
To **update** your project, rerun the above script. It will replace the current version without touching your project.
<br/>After installation you will be guided through what to do next!

## 📚 Helpful Information

- [How does this all work?](https://github.com/~REPO~/docs/en-US/GITHUB_SETUP.md)
- [Structure](https://github.com/~REPO~/docs/en-US/STRUCTURE.md)
- [Policies](https://github.com/~REPO~/docs/en-US/HOUSEKEEPING.md)
- [Project Charter](https://github.com/~REPO~/docs/en-US/PROJECT_CHARTER.md)
- [Governance](https://github.com/~REPO~/docs/en-US/GOVERNANCE.md)

## 🤝 Contributing

We are always looking for contributors of **all skill levels**! If you're looking to ease your way into the project, try out a [good first issue](https://github.com/resist-js/resist/labels/🌱%20good%20first%20issue).
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,25 @@
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.0.6",
"@sveltejs/eslint-config": "github:sveltejs/eslint-config#v5.8.0",
"@typescript-eslint/eslint-plugin": "^5.1.0",
"@typescript-eslint/parser": "^5.1.0",
"@typescript-eslint/eslint-plugin": "^5.3.0",
"@typescript-eslint/parser": "^5.3.0",
"cz-conventional-changelog": "^3.3.0",
"dotenv": "^10.0.0",
"eslint": "^7.32.0",
"eslint": "^8.2.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ava": "^13.1.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jsdoc": "^36.1.1",
"eslint-plugin-sonarjs": "^0.10.0",
"eslint-plugin-svelte3": "^3.2.1",
"eslint-plugin-tsdoc": "^0.2.14",
"playwright-chromium": "^1.16.1",
"playwright-chromium": "^1.16.3",
"prettier": "^2.4.1",
"rollup": "^2.58.0",
"stylelint": "^14.0.0",
"rollup": "^2.59.0",
"stylelint": "^14.0.1",
"stylelint-config-standard": "^23.0.0",
"stylelint-config-standard-scss": "^2.0.0",
"typescript": "^4.5.0-dev.20211022",
"stylelint-config-standard-scss": "^2.0.1",
"typescript": "^4.5.0-dev.20211101",
"xo": "^0.45.0"
},
"workspaces": [
Expand Down
26 changes: 13 additions & 13 deletions packages/@resist.js/bins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<a href="https://github.com/resist-js/resist/blob/master/LICENSE.md" target="_blank">
<img alt="GitHub" src="https://img.shields.io/github/license/resist-js/resist?style=flat-square"/>
</a>
<a href="https://www.npmjs.com/package/@@resistjs/bins" target="_blank">
<img alt="npm (scoped)" src="https://img.shields.io/npm/v/@@resistjs/bins?label=npm&style=flat-square"/>
<a href="https://www.npmjs.com/package/@resistjs/bins" target="_blank">
<img alt="npm (scoped)" src="https://img.shields.io/npm/v/@resistjs/bins?label=npm&style=flat-square"/>
</a>
<br/>
<a href="https://github.com/resist-js/resist/actions" target="_blank">
Expand All @@ -42,18 +42,18 @@
</a>
<br/>
<a href="https://resistjs.dev/chat" target="_blank">
<img src="https://img.shields.io/badge/slack-@@resistjs/bins-green.svg?logo=slack"/>
<img src="https://img.shields.io/badge/slack-resist-js/resist-green.svg?logo=slack"/>
</a>
<a href="https://www.linkedin.com/company/resist-js" target="_blank">
<img src="https://img.shields.io/badge/linkedin-resistjs-blue.svg?logo=linkedin"/>
<img src="https://img.shields.io/badge/linkedin-resist-js-blue.svg?logo=linkedin"/>
</a>
<a href="https://twitter.com/resist_js" target="_blank">
<img src="https://img.shields.io/badge/twitter-resistjs-blue.svg?logo=twitter"/>
<img src="https://img.shields.io/badge/twitter-resist_js-blue.svg?logo=twitter"/>
</a>
<a href="https://opencollective.com/@resistjs/bins" target="_blank">
<img alt="Open Collective backers and sponsors" src="https://img.shields.io/opencollective/all/@resistjs/bins?style=flat-square"/>
<a href="https://opencollective.com/resist-js" target="_blank">
<img alt="Open Collective backers and sponsors" src="https://img.shields.io/opencollective/all/resist-js?style=flat-square"/>
</a>
<a href="https://github.com/@resistjs/bins/ama" target="_blank">
<a href="https://github.com/resist-js/ama" target="_blank">
<img alt="Ask Me Anything" src="https://img.shields.io/badge/Ask%20me-anything-1abc9c.svg"/>
</a>
</p>
Expand Down Expand Up @@ -113,11 +113,11 @@ Global package for resist.js that supports Starting, Stopping, Uninstalling resi

## 📚 Helpful Information

[How does this all work?](https://github.com/resist-js/resist/docs/en-US/GITHUB_SETUP.md)
[Structure](https://github.com/resist-js/resist/docs/en-US/STRUCTURE.md)
[Policies](https://github.com/resist-js/resist/docs/en-US/HOUSEKEEPING.md)
[Project Charter](https://github.com/resist-js/resist/docs/en-US/PROJECT_CHARTER.md)
[Governance](https://github.com/resist-js/resist/docs/en-US/GOVERNANCE.md)
- [How does this all work?](https://github.com/resist-js/resist/docs/en-US/GITHUB_SETUP.md)
- [Structure](https://github.com/resist-js/resist/docs/en-US/STRUCTURE.md)
- [Policies](https://github.com/resist-js/resist/docs/en-US/HOUSEKEEPING.md)
- [Project Charter](https://github.com/resist-js/resist/docs/en-US/PROJECT_CHARTER.md)
- [Governance](https://github.com/resist-js/resist/docs/en-US/GOVERNANCE.md)

## 🤝 Contributing

Expand Down
108 changes: 75 additions & 33 deletions packages/@resist.js/bins/bin/resist.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { IsDockerRunning } from '@resistjs/utils'

import prompts from 'prompts'
import { bold, cyan, green, red } from 'kleur/colors'
import { Listr } from 'listr2'

/** @type {!string} */
const HOME = homedir()
Expand Down Expand Up @@ -84,9 +85,9 @@ async function main() {
async function run(choice) {
const container = process.argv[3]

const launch = command => {
const launch = async command => {
try {
execSync(command)
await execSync(command)
return true
} catch (error) {
return false
Expand Down Expand Up @@ -120,7 +121,11 @@ async function run(choice) {
console.log(bold(red(`✗ There were no containers to stop.`)))
} else {
Object.keys(data).forEach(container => {
if (launch(`docker stop ${container}`)) {
if (
launch(
`APP_NAME=${container} CWD=$(builtin pwd) PORT_ELASTIC=9200 PORT_ELASTIC_SSL=9300 PORT_KIBANA=5601 PORT_REDIS=6379 PORT_EXCEPTION_SSL=5001 PORT_EXCEPTION=5000 PORT_FLAGS=4003 PORT_UPTIME=4002 PORT_STORYBOOK=6006 PORT_SERVER_DEV=3000 PORT_DEV_DEBUG=3001 PORT_SERVER_PROD=4000 PORT_PROD_DEBUG=4001 PORT_HMR=24678 docker-compose -p ${container} --log-level WARNING -f ${path}/config/docker-compose.yml stop`,
)
) {
console.log(bold(green(`✔ ${container} has been stopped and is no longer running.`)))
} else {
console.log(bold(red(`✗ ${container} was not be stopped as it is not running.`)))
Expand All @@ -130,7 +135,7 @@ async function run(choice) {

if (
!launch(
`APP_NAME=${container} CWD=$(builtin pwd) PORT_ELASTIC=9200 PORT_ELASTIC_SSL=9300 PORT_KIBANA=5601 PORT_REDIS=6379 PORT_EXCEPTION_SSL=5001 PORT_EXCEPTION=5000 PORT_FLAGS=4003 PORT_UPTIME=4002 PORT_STORYBOOK=6006 PORT_SERVER_DEV=3000 PORT_DEV_DEBUG=3001 PORT_SERVER_PROD=4000 PORT_PROD_DEBUG=4001 PORT_HMR=24678 docker-compose --log-level WARNING -f ${path}/config/docker-compose.yml down --rmi all -v --remove-orphans`,
`APP_NAME=${container} CWD=$(builtin pwd) PORT_ELASTIC=9200 PORT_ELASTIC_SSL=9300 PORT_KIBANA=5601 PORT_REDIS=6379 PORT_EXCEPTION_SSL=5001 PORT_EXCEPTION=5000 PORT_FLAGS=4003 PORT_UPTIME=4002 PORT_STORYBOOK=6006 PORT_SERVER_DEV=3000 PORT_DEV_DEBUG=3001 PORT_SERVER_PROD=4000 PORT_PROD_DEBUG=4001 PORT_HMR=24678 docker-compose --log-level WARNING -f ${path}/config/docker-compose.yml -p ${container} down --rmi all -v --remove-orphans`,
)
) {
console.log(bold(red(`✗ ${container} was not removed as it doesn't exist.`)))
Expand Down Expand Up @@ -197,11 +202,32 @@ async function run(choice) {
}
}
} else if (choice === 'stop') {
if (launch(`docker stop ${PROJECT_NAME.value}`)) {
console.log(bold(green(`✔ ${PROJECT_NAME.value} is stopped and is no longer running.`)))
} else {
console.log(bold(red(`✗ ${PROJECT_NAME.value} could not be stopped as it is not running.`)))
}
new Listr(
[
{
title: `Stopping ${PROJECT_NAME.value}`,
task: async (ctx, task) => {
let data
try {
data = JSON.parse(fs.readFileSync(CONFIG, 'utf-8'))
} catch (error) {
// Not important
}
const container = data[PROJECT_NAME.value]

if (
await launch(`APP_NAME=${PROJECT_NAME.value} CWD=${container}
PORT_ELASTIC=9200 PORT_ELASTIC_SSL=9300 PORT_KIBANA=5601 PORT_REDIS=6379 PORT_EXCEPTION_SSL=5001 PORT_EXCEPTION=5000 PORT_FLAGS=4003 PORT_UPTIME=4002 PORT_STORYBOOK=6006 PORT_SERVER_DEV=3000 PORT_DEV_DEBUG=3001 PORT_SERVER_PROD=4000 PORT_PROD_DEBUG=4001 PORT_HMR=24678 docker-compose --log-level WARNING -p ${PROJECT_NAME.value} -f ${container}/config/docker-compose.yml stop`)
) {
task.title = `${PROJECT_NAME.value} is stopped and is no longer running.`
} else {
throw new Error(`${PROJECT_NAME.value} could not be stopped as it is not running.`)
}
},
},
],
{},
).run()
} else if (choice === 'sweep') {
const CONFIRMED = await prompts({
type: 'confirm',
Expand All @@ -220,31 +246,47 @@ async function run(choice) {
if (!data) {
console.log(bold(red(`✗ There were no containers to uninstall.`)))
} else {
const container = data[PROJECT_NAME.value]
if (container) {
if (launch(`docker stop ${container}`)) {
console.log(bold(green(`✔ ${container} has been stopped and is no longer running.`)))
} else {
console.log(bold(red(`✗ ${container} was not stopped as it is not running.`)))
}

if (
!launch(
`APP_NAME=${PROJECT_NAME.value} CWD=$(builtin pwd) PORT_ELASTIC=9200 PORT_ELASTIC_SSL=9300 PORT_KIBANA=5601 PORT_REDIS=6379 PORT_EXCEPTION_SSL=5001 =5000 PORT_FLAGS=4003 PORT_UPTIME=4002 PORT_STORYBOOK=6006 PORT_SERVER_DEV=3000 PORT_DEV_DEBUG=3001 PORT_SERVER_PROD=4000 PORT_PROD_DEBUG=4001 PORT_HMR=24678 docker-compose --log-level WARNING -f ${container}/config/docker-compose.yml down --rmi all -v --remove-orphans`,
)
) {
console.log(bold(red(`✗ ${PROJECT_NAME.value} was not removed as it doesn't exist.`)))
}

try {
fs.rmdirSync(`${container}/config`, { recursive: true, force: true })
} catch (error) {
// Not important
}
}
new Listr(
[
{
title: `Uninstalling ${PROJECT_NAME.value}`,
task: async (ctx, task) => {
const container = data[PROJECT_NAME.value]
if (container) {
if (
launch(
`APP_NAME=${PROJECT_NAME.value} CWD=$(builtin pwd) PORT_ELASTIC=9200 PORT_ELASTIC_SSL=9300 PORT_KIBANA=5601 PORT_REDIS=6379 PORT_EXCEPTION_SSL=5001 PORT_EXCEPTION=5000 PORT_FLAGS=4003 PORT_UPTIME=4002 PORT_STORYBOOK=6006 PORT_SERVER_DEV=3000 PORT_DEV_DEBUG=3001 PORT_SERVER_PROD=4000 PORT_PROD_DEBUG=4001 PORT_HMR=24678 docker-compose --log-level WARNING -f ${container}/config/docker-compose.yml -p ${PROJECT_NAME.value} stop`,
)
) {
task.title = `${container} has been stopped and is no longer running.`
} else {
throw new Error(`${container} was not stopped as it is not running.`)
}

if (
!launch(
`APP_NAME=${PROJECT_NAME.value} CWD=$(builtin pwd) PORT_ELASTIC=9200 PORT_ELASTIC_SSL=9300 PORT_KIBANA=5601 PORT_REDIS=6379 PORT_EXCEPTION_SSL=5001 =5000 PORT_FLAGS=4003 PORT_UPTIME=4002 PORT_STORYBOOK=6006 PORT_SERVER_DEV=3000 PORT_DEV_DEBUG=3001 PORT_SERVER_PROD=4000 PORT_PROD_DEBUG=4001 PORT_HMR=24678 docker-compose --log-level WARNING -f ${container}/config/docker-compose.yml -p ${PROJECT_NAME.value} down --rmi all -v --remove-orphans`,
)
) {
throw new Error(`${PROJECT_NAME.value} was not removed as it doesn't exist.`)
}

try {
fs.rmdirSync(`${container}/config`, { recursive: true, force: true })
} catch (error) {
// Not important
}

task.title = `${PROJECT_NAME.value} has been uninstalled.`
} else {
throw new Error(`${container} was not stopped as it doesn't exist.`)
}
},
},
],
{},
).run()
}

console.log(bold(green(`✔ ${PROJECT_NAME.value} has been uninstalled.`)))
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions packages/@resist.js/bins/docs/en-US/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# In Your Language

<p align="center">
<a href="https://github.com/resist-js/resistblob/master/docs/en-US/CODE_OF_CONDUCT.md"
<a href="https://github.com/resist-js/resist/blob/master/docs/en-US/CODE_OF_CONDUCT.md"
>English</a>
</p>

Expand All @@ -11,8 +11,8 @@ As a member of the Open JS Foundation, @resistjs/bins has adopted the
[Contributor Covenant 2.0][cc-20-doc].

If an issue arises and you cannot resolve it directly with the parties
involved, you can report it to the @resistjs/bins project TC through the following
email: @resistjs/bins-coc@lists.openjsf.org
involved, you can report it to the resist-js project TC through the following
email: resist-js-coc@lists.openjsf.org

In addition, the OpenJS Foundation maintains a Code of Conduct Panel (CoCP).
This is a foundation-wide team established to manage escalation when a reporter
Expand Down Expand Up @@ -80,7 +80,7 @@ appointed representative at an online or offline event.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
@resistjs/bins-coc@lists.openjsf.org. All complaints will be reviewed and
resist-js-coc@lists.openjsf.org. All complaints will be reviewed and
investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand Down Expand Up @@ -145,4 +145,4 @@ For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are available at
[https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/translations).

#### Did you find this helpful? Is there something we can improve? [Click here](https://github.com/resist-js/resistissues/new?assignees=&labels=&template=documentation.yml) to make a suggestion.
#### Did you find this helpful? Is there something we can improve? [Click here](https://github.com/resist-js/resist/issues/new?assignees=&labels=&template=documentation.yml) to make a suggestion.

1 comment on commit 622884e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"version-docs" versioned "documentation" from branch "master" on documentation branch "documentation"

Please sign in to comment.