Merge pull request #9522 from Budibase/chore/vscode_setup
Chore - vscode setup
This commit is contained in:
commit
c217763600
7 changed files with 174 additions and 51 deletions
1
.nvmrc
Normal file
1
.nvmrc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
v14.19.3
|
1
.python-version
Normal file
1
.python-version
Normal file
|
@ -0,0 +1 @@
|
||||||
|
3.11.1
|
2
.tool-versions
Normal file
2
.tool-versions
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
nodejs 14.19.3
|
||||||
|
python 3.11.1
|
6
.vscode/extensions.json
vendored
Normal file
6
.vscode/extensions.json
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"recommendations": [
|
||||||
|
"esbenp.prettier-vscode",
|
||||||
|
"svelte.svelte-vscode"
|
||||||
|
]
|
||||||
|
}
|
46
.vscode/settings.json
vendored
46
.vscode/settings.json
vendored
|
@ -1,22 +1,28 @@
|
||||||
{
|
{
|
||||||
"editor.formatOnSave": true,
|
"editor.formatOnSave": true,
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll": true
|
"source.fixAll": true
|
||||||
},
|
},
|
||||||
"editor.defaultFormatter": "svelte.svelte-vscode",
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
"[json]": {
|
"[json]": {
|
||||||
"editor.defaultFormatter": "vscode.json-language-features"
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
},
|
},
|
||||||
"[javascript]": {
|
"[javascript]": {
|
||||||
"editor.defaultFormatter": "vscode.typescript-language-features"
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
},
|
},
|
||||||
"debug.javascript.terminalOptions": {
|
"debug.javascript.terminalOptions": {
|
||||||
"skipFiles": [
|
"skipFiles": [
|
||||||
"${workspaceFolder}/packages/backend-core/node_modules/**",
|
"${workspaceFolder}/packages/backend-core/node_modules/**",
|
||||||
"<node_internals>/**"
|
"<node_internals>/**"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"[typescript]": {
|
"[typescript]": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
},
|
},
|
||||||
|
"[dockercompose]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[svelte]": {
|
||||||
|
"editor.defaultFormatter": "svelte.svelte-vscode"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ From opening a bug report to creating a pull request: every contribution is appr
|
||||||
- [Glossary of Terms](#glossary-of-terms)
|
- [Glossary of Terms](#glossary-of-terms)
|
||||||
- [Contributing to Budibase](#contributing-to-budibase)
|
- [Contributing to Budibase](#contributing-to-budibase)
|
||||||
|
|
||||||
|
|
||||||
## Not Sure Where to Start?
|
## Not Sure Where to Start?
|
||||||
|
|
||||||
Budibase is a low-code web application builder that creates svelte-based web applications.
|
Budibase is a low-code web application builder that creates svelte-based web applications.
|
||||||
|
@ -77,24 +76,51 @@ Component libraries are collections of components as well as the definition of t
|
||||||
|
|
||||||
## Contributing to Budibase
|
## Contributing to Budibase
|
||||||
|
|
||||||
* Please maintain the existing code style.
|
- Please maintain the existing code style.
|
||||||
|
|
||||||
* Please try to keep your commits small and focused.
|
- Please try to keep your commits small and focused.
|
||||||
|
|
||||||
* Please write tests.
|
- Please write tests.
|
||||||
|
|
||||||
* If the project diverges from your branch, please rebase instead of merging. This makes the commit graph easier to read.
|
- If the project diverges from your branch, please rebase instead of merging. This makes the commit graph easier to read.
|
||||||
|
|
||||||
* Once your work is completed, please raise a PR against the `develop` branch with some information about what has changed and why.
|
- Once your work is completed, please raise a PR against the `develop` branch with some information about what has changed and why.
|
||||||
|
|
||||||
### Getting Started For Contributors
|
### Getting Started For Contributors
|
||||||
#### 1. Prerequisites
|
|
||||||
|
|
||||||
NodeJS Version `14.x.x`
|
#### 1. Prerequisites
|
||||||
|
|
||||||
*yarn -* `npm install -g yarn`
|
- NodeJS version `14.x.x`
|
||||||
|
- Python version `3.x`
|
||||||
|
|
||||||
*jest* - `npm install -g jest`
|
### Using asdf (recommended)
|
||||||
|
|
||||||
|
Asdf is a package manager that allows managing multiple dependencies.
|
||||||
|
|
||||||
|
You can install them following any of the steps described below:
|
||||||
|
|
||||||
|
- Install using script (only for mac users):
|
||||||
|
|
||||||
|
`./scripts/install-contributor-dependencies.sh`
|
||||||
|
|
||||||
|
- Or, manually:
|
||||||
|
|
||||||
|
- Installation steps: https://asdf-vm.com/guide/getting-started.html
|
||||||
|
- asdf plugin add nodejs
|
||||||
|
- asdf plugin add python
|
||||||
|
- npm install -g yarn
|
||||||
|
|
||||||
|
### Using NVM and pyenv
|
||||||
|
|
||||||
|
- NVM:
|
||||||
|
- Install: https://github.com/nvm-sh/nvm#installing-and-updating
|
||||||
|
- Setup: `nvm use`
|
||||||
|
- Pyenv:
|
||||||
|
|
||||||
|
- Install: https://github.com/pyenv/pyenv#installation
|
||||||
|
- Setup: `pyenv install -v 3.7.2`
|
||||||
|
|
||||||
|
- _yarn -_ `npm install -g yarn`
|
||||||
|
|
||||||
#### 2. Clone this repository
|
#### 2. Clone this repository
|
||||||
|
|
||||||
|
@ -102,7 +128,7 @@ NodeJS Version `14.x.x`
|
||||||
|
|
||||||
then `cd ` into your local copy.
|
then `cd ` into your local copy.
|
||||||
|
|
||||||
#### 3. Install and Build
|
#### 3. Install and Build
|
||||||
|
|
||||||
| **NOTE**: On Windows, all yarn commands must be executed on a bash shell (e.g. git bash)
|
| **NOTE**: On Windows, all yarn commands must be executed on a bash shell (e.g. git bash)
|
||||||
|
|
||||||
|
@ -172,30 +198,38 @@ A combination of environment variables controls the mode budibase runs in.
|
||||||
Yarn commands can be used to mimic the different modes as described in the sections below:
|
Yarn commands can be used to mimic the different modes as described in the sections below:
|
||||||
|
|
||||||
#### Self Hosted
|
#### Self Hosted
|
||||||
|
|
||||||
The default mode. A single tenant installation with no usage restrictions.
|
The default mode. A single tenant installation with no usage restrictions.
|
||||||
|
|
||||||
To enable this mode, use:
|
To enable this mode, use:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn mode:self
|
yarn mode:self
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Cloud
|
#### Cloud
|
||||||
|
|
||||||
The cloud mode, with account portal turned off.
|
The cloud mode, with account portal turned off.
|
||||||
|
|
||||||
To enable this mode, use:
|
To enable this mode, use:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn mode:cloud
|
yarn mode:cloud
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Cloud & Account
|
#### Cloud & Account
|
||||||
|
|
||||||
The cloud mode, with account portal turned on. This is a replica of the mode that runs at https://budibase.app
|
The cloud mode, with account portal turned on. This is a replica of the mode that runs at https://budibase.app
|
||||||
|
|
||||||
|
|
||||||
To enable this mode, use:
|
To enable this mode, use:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn mode:account
|
yarn mode:account
|
||||||
```
|
```
|
||||||
|
|
||||||
### CI
|
### CI
|
||||||
An overview of the CI pipelines can be found [here](../.github/workflows/README.md)
|
|
||||||
|
An overview of the CI pipelines can be found [here](../.github/workflows/README.md)
|
||||||
|
|
||||||
### Pro
|
### Pro
|
||||||
|
|
||||||
|
@ -214,6 +248,7 @@ The `yarn bootstrap` command can be used to replace the NPM supplied dependency
|
||||||
### Troubleshooting
|
### Troubleshooting
|
||||||
|
|
||||||
Sometimes, things go wrong. This can be due to incompatible updates on the budibase platform. To clear down your development environment and start again follow **Step 6. Cleanup**, then proceed from **Step 3. Install and Build** in the setup guide above to create a fresh Budibase installation.
|
Sometimes, things go wrong. This can be due to incompatible updates on the budibase platform. To clear down your development environment and start again follow **Step 6. Cleanup**, then proceed from **Step 3. Install and Build** in the setup guide above to create a fresh Budibase installation.
|
||||||
|
|
||||||
### Running tests
|
### Running tests
|
||||||
|
|
||||||
#### End-to-end Tests
|
#### End-to-end Tests
|
||||||
|
@ -226,12 +261,11 @@ yarn test:e2e
|
||||||
|
|
||||||
Or if you are in the builder you can run `yarn cy:test`.
|
Or if you are in the builder you can run `yarn cy:test`.
|
||||||
|
|
||||||
|
|
||||||
### Other Useful Information
|
### Other Useful Information
|
||||||
|
|
||||||
* The contributors are listed in [AUTHORS.md](https://github.com/Budibase/budibase/blob/master/.github/AUTHORS.md) (add yourself).
|
- The contributors are listed in [AUTHORS.md](https://github.com/Budibase/budibase/blob/master/.github/AUTHORS.md) (add yourself).
|
||||||
|
|
||||||
* This project uses a modified version of the MPLv2 license, see [LICENSE](https://github.com/budibase/server/blob/master/LICENSE).
|
- This project uses a modified version of the MPLv2 license, see [LICENSE](https://github.com/budibase/server/blob/master/LICENSE).
|
||||||
|
|
||||||
* We use the [C4 (Collective Code Construction Contract)](https://rfc.zeromq.org/spec:42/C4/) process for contributions.
|
- We use the [C4 (Collective Code Construction Contract)](https://rfc.zeromq.org/spec:42/C4/) process for contributions.
|
||||||
Please read this if you are unfamiliar with it.
|
Please read this if you are unfamiliar with it.
|
||||||
|
|
73
scripts/install-contributor-dependencies.sh
Executable file
73
scripts/install-contributor-dependencies.sh
Executable file
|
@ -0,0 +1,73 @@
|
||||||
|
function getDistro {
|
||||||
|
if [ -f /etc/os-release ]; then
|
||||||
|
# freedesktop.org and systemd
|
||||||
|
. /etc/os-release
|
||||||
|
OS=$NAME
|
||||||
|
VER=$VERSION_ID
|
||||||
|
elif type lsb_release >/dev/null 2>&1; then
|
||||||
|
# linuxbase.org
|
||||||
|
OS=$(lsb_release -si)
|
||||||
|
VER=$(lsb_release -sr)
|
||||||
|
elif [ -f /etc/lsb-release ]; then
|
||||||
|
# For some versions of Debian/Ubuntu without lsb_release command
|
||||||
|
. /etc/lsb-release
|
||||||
|
OS=$DISTRIB_ID
|
||||||
|
VER=$DISTRIB_RELEASE
|
||||||
|
elif [ -f /etc/debian_version ]; then
|
||||||
|
# Older Debian/Ubuntu/etc.
|
||||||
|
OS=Debian
|
||||||
|
VER=$(cat /etc/debian_version)
|
||||||
|
elif [ -f /etc/SuSe-release ]; then
|
||||||
|
# Older SuSE/etc.
|
||||||
|
:
|
||||||
|
elif [ -f /etc/redhat-release ]; then
|
||||||
|
# Older Red Hat, CentOS, etc.
|
||||||
|
VER=$( cat /etc/redhat-release | cut -d" " -f3 | cut -d "." -f1)
|
||||||
|
d=$( cat /etc/redhat-release | cut -d" " -f1 | cut -d "." -f1)
|
||||||
|
if [[ $d == "CentOS" ]]; then
|
||||||
|
OS="CentOS Linux"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# Fall back to uname, e.g. "Linux <version>", also works for BSD, etc.
|
||||||
|
OS=$(uname -s)
|
||||||
|
VER=$(uname -r)
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
getDistro
|
||||||
|
|
||||||
|
if [[ $OS == "Darwin" ]];
|
||||||
|
then
|
||||||
|
echo "This script is not setup for your machine type:" $OS
|
||||||
|
echo "Please use the manual steps described in https://github.com/Budibase/budibase/blob/develop/docs/CONTRIBUTING.md#getting-started-for-contributors"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Install brew
|
||||||
|
if ! command -v brew &> /dev/null
|
||||||
|
then
|
||||||
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Install and setup asdf
|
||||||
|
if ! command -v asdf &> /dev/null
|
||||||
|
then
|
||||||
|
brew install asdf
|
||||||
|
|
||||||
|
if test -f ~/.bashrc; then
|
||||||
|
echo -e "\n. $(brew --prefix asdf)/asdf.sh" >> ~/.bashrc
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -f ~/.zshrc; then
|
||||||
|
echo -e "\n. $(brew --prefix asdf)/asdf.sh" >> ~/.zshrc
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Install ASDF Plugins
|
||||||
|
asdf plugin add nodejs
|
||||||
|
asdf plugin add python
|
||||||
|
|
||||||
|
asdf install
|
||||||
|
|
||||||
|
npm install -g yarn
|
Loading…
Reference in a new issue