Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Restructure files so Heroku builds work again #1032

Merged
merged 8 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DB_URL= # Mongo connection string in the format mongodb+srv://<username>:<password>@<cluster>.mongodb.net/<dbname>?retryWrites=true&w=majority&tls=true
PORT=5000 # Port to run the server on (default: 5000)
4 changes: 1 addition & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# don't ever lint node_modules
node_modules
# don't lint build output
dist
build
# don't lint nyc coverage output
coverage
# lint client separately
client
60 changes: 22 additions & 38 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,24 @@
{
"env": {
"browser": true,
"es2021": true
"env": {
"browser": true,
"es2021": true
},
"extends": ["plugin:react/recommended", "react-app", "react-app/jest"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"extends": [
"airbnb-base"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"no-console": "off",
"no-restricted-syntax": [
"error",
{
"selector": "CallExpression[callee.object.name='console'][callee.property.name!=/^(log|warn|error|info|trace)$/]",
"message": "Unexpected property on console object was called"
}
],
"import/no-unresolved": "off",
"import/extensions": "off",
"no-underscore-dangle": "off",
"function-paren-newline": [
"error",
"consistent"
],
"max-len": [
"warn",
{
"code": 180
}
]
}
}
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": ["react", "@typescript-eslint"],
"rules": {
"import/no-unresolved": "off",
"import/extensions": "off",
"import/first": "off",
"no-unused-expressions": "off",
"no-underscore-dangle": "off",
"react/jsx-filename-extension": "off"
}
}
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ updates:
- "minor"
- "patch"
- package-ecosystem: "npm"
directory: "/client"
directory: "/server"
schedule:
interval: "weekly"
groups:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install modules
run: yarn && yarn install-client
run: yarn install-all
- name: Run build
run: yarn build
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install modules
run: yarn && yarn install-client
run: yarn install-all
- name: Run lint script
run: yarn lint
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@v3.7.1
with:
github-token: ${{ secrets.CHANGELOG_RELEASE }}
output-file: 'false'
version-file: './package.json,./client/package.json'
version-file: './package.json,./server/package.json'

- name: create release
uses: actions/create-release@v1
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

# production
/build
/dist
*/build
server/dist

# misc
.DS_Store
Expand Down
20 changes: 1 addition & 19 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,8 @@ ports:
- port: 5000
onOpen: open-preview
tasks:
- init: yarn install && yarn install-client
- init: yarn install-all
command: yarn dev
github:
prebuilds:
# enable for the master/default branch (defaults to true)
master: true
# enable for all branches in this repo (defaults to false)
branches: false
# enable for pull requests coming from this repo (defaults to true)
pullRequests: true
# enable for pull requests coming from forks (defaults to false)
pullRequestsFromForks: true
# add a check to pull requests (defaults to true)
addCheck: true
# add a "Review in Gitpod" button as a comment to pull requests (defaults to false)
addComment: false
# add a "Review in Gitpod" button to the pull request's description (defaults to false)
addBadge: false
# add a label once the prebuild is ready to pull requests (defaults to false)
addLabel: false
vscode:
extensions:
- esbenp.prettier-vscode@1.7.0:EbyqFvwe32qQBptkOgfQpQ==
26 changes: 13 additions & 13 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Expand Down
41 changes: 26 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ If you are making a significant change, please open an issue before creating a p

Make sure your request is meaningful and you have tested the app locally before submitting a pull request.


### Installing Requirements

#### Requirements

* NodeJS
* Yarn
* TypeScript
- NodeJS
- Yarn
- TypeScript

### Clone the repository

Expand All @@ -25,12 +24,12 @@ cd custom-icon-badges
### Installing dependencies

```bash
yarn && yarn install-client
yarn install-all
```

### Config vars

To work with a database, add a `.env` file on the root level with the following:
To work with a database, add a `.env` file in the root directory with the following:

```bash
DB_URL=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/<dbname>?retryWrites=true&w=majority&tls=true
Expand All @@ -40,6 +39,12 @@ The URL should be the URL provided by MongoDB and the database should have a col

More info on setting up a free Atlas database on [MongoDB's documentation](https://docs.atlas.mongodb.com/getting-started/).

Optionally, you can also set the `PORT` variable to change the port the server runs on (by default, it runs on port 5000):

```bash
PORT=5000
```

### Build and run the app locally

```bash
Expand All @@ -62,12 +67,18 @@ yarn start-client

<http://localhost:3000/> will be opened in your browser

### Linting
### Show linting errors

```bash
yarn lint
```

### Fix linting errors

```bash
yarn lint:fix
```

### Commit style guide

We use [Conventional Commits](https://conventionalcommits.org/) for commit messages.
Expand All @@ -76,12 +87,12 @@ This allows for a more readable commit history and helps to automate the process

Please prefix your commit messages with one of the following:

* `fix`: A bug fix.
* `feat`: A new feature.
* `docs`: Documentation only changes.
* `style`: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc).
* `refactor`: A code change that neither fixes a bug or adds a feature.
* `test`: Adding missing tests.
* `chore`: Changes to the build process or auxiliary tools and libraries such as documentation generation.
- `fix`: A bug fix.
- `feat`: A new feature.
- `docs`: Documentation only changes.
- `style`: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc).
- `refactor`: A code change that neither fixes a bug or adds a feature.
- `test`: Adding missing tests.
- `chore`: Changes to the build process or auxiliary tools and libraries such as documentation generation.

Please see [Conventional Commits](https://conventionalcommits.org/) for the full specifications.
Please see [Conventional Commits](https://conventionalcommits.org/) for the full specifications.
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,22 @@ All [250+ Feather Icons](https://feathericons.com/) are supported by Custom Icon

**Note:** To use Feather Icons, you must use add the query parameter `logoSource=feather` to the URL in addition to the `logo` parameter.

| Slug | Example |
| ------------------ | --------------------------------------------- |
| `activity` | [![activity][activity]][activity] |
| `alert-triangle` | [![alert-triangle][alert-triangle]][alert-triangle] |
| `award` | [![award][award]][award] |
| `bar-chart` | [![bar-chart][bar-chart]][bar-chart] |
| `box` | [![box][box]][box] |
| `camera` | [![camera][camera]][camera] |
| `cast` | [![cast][cast]][cast] |
| `command` | [![command][command]][command] |
| `dollar-sign` | [![dollar-sign][dollar-sign]][dollar-sign] |
| `download-cloud` | [![download-cloud][download-cloud]][download-cloud] |
| `upload-cloud` | [![upload-cloud][upload-cloud]][upload-cloud] |
| `tv` | [![tv][tv]][tv] |
| `youtube` | [![youtube][youtube]][youtube] |
| More Feather Icons | [View all ⇨](https://feathericons.com/) |
| Slug | Example |
| ------------------ | --------------------------------------------------- |
| `activity` | [![activity][activity]][activity] |
| `alert-triangle` | [![alert-triangle][alert-triangle]][alert-triangle] |
| `award` | [![award][award]][award] |
| `bar-chart` | [![bar-chart][bar-chart]][bar-chart] |
| `box` | [![box][box]][box] |
| `camera` | [![camera][camera]][camera] |
| `cast` | [![cast][cast]][cast] |
| `command` | [![command][command]][command] |
| `dollar-sign` | [![dollar-sign][dollar-sign]][dollar-sign] |
| `download-cloud` | [![download-cloud][download-cloud]][download-cloud] |
| `upload-cloud` | [![upload-cloud][upload-cloud]][upload-cloud] |
| `tv` | [![tv][tv]][tv] |
| `youtube` | [![youtube][youtube]][youtube] |
| More Feather Icons | [View all ⇨](https://feathericons.com/) |

[activity]: https://custom-icon-badges.demolab.com/badge/activity-red.svg?logo=activity&logoSource=feather
[alert-triangle]: https://custom-icon-badges.demolab.com/badge/alert--triangle-orange.svg?logo=alert-triangle&logoSource=feather
Expand Down Expand Up @@ -201,8 +201,8 @@ By default, fetching a badge from Custom Icon Badges will use [`img.shields.io`]

You can set the `host` parameter to one of the following to override the hostname of the badge URL:

- [`img.shields.io`](https://img.shields.io)
- [`staging.shields.io`](https://staging.shields.io)
- [`img.shields.io`](https://img.shields.io)
- [`staging.shields.io`](https://staging.shields.io)

If you would like to use a different badge host, fork and modify this repository. Create a PR if it may be useful to others.

Expand Down
29 changes: 0 additions & 29 deletions client/.eslintrc.json

This file was deleted.

Loading