Skip to content

Commit

Permalink
feat: Add CLI and rewrite all scripts to NodeJS in order to improve W…
Browse files Browse the repository at this point in the history
…indows support (#386)
  • Loading branch information
pziemkowski authored Sep 18, 2023
1 parent 345d3e4 commit c36a5d2
Show file tree
Hide file tree
Showing 194 changed files with 9,256 additions and 2,112 deletions.
1 change: 0 additions & 1 deletion .env.shared
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ COMPOSE_PATH_SEPARATOR=:
COMPOSE_FILE=docker-compose.yml:docker-compose.local.yml

# Local machine configuration
ENV_STAGE=local
AWS_VAULT_PROFILE=saas
NX_BRANCH=local

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [ '**' ]

env:
BACKEND_BASE_IMAGE: python:3.11-slim-bullseye
SB_BACKEND_BASE_IMAGE: python:3.11-slim-bullseye

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [ '**' ]

env:
BACKEND_BASE_IMAGE: python:3.11-slim-bullseye
SB_BACKEND_BASE_IMAGE: python:3.11-slim-bullseye

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/workers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
branches: [ '**' ]

env:
WORKERS_BASE_IMAGE: python:3.9-slim-bullseye
SB_WORKERS_BASE_IMAGE: python:3.9-slim-bullseye

jobs:
build:
Expand All @@ -32,7 +32,7 @@ jobs:

- name: Build emails renderer
shell: bash
run: pnpm nx run webapp-emails:build-vite
run: pnpm nx run webapp-emails:build

- name: Build
shell: bash
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ __pypackages__/
# System Files
.DS_Store
Thumbs.db

# SaaS Boilerplate
.saas-boilerplate
4 changes: 4 additions & 0 deletions .versionrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ module.exports = {
filename: './packages/internal/core/package.json',
type: 'json',
},
{
filename: './packages/internal/cli/package.json',
type: 'json',
},
{
filename: './packages/internal/docs/core.json',
type: 'json',
Expand Down
56 changes: 0 additions & 56 deletions Makefile

This file was deleted.

73 changes: 0 additions & 73 deletions Makefile.base.mk

This file was deleted.

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,30 +127,30 @@ pnpm install

### Start the app

#### Start backend
Start both: backend and webapp

```sh
pnpm nx run core:docker-compose:up
pnpm saas up
```

or a shorter version:
#### Start backend

```sh
make up
pnpm saas backend up
```

#### Start webapp

```sh
pnpm nx start webapp
pnpm saas webapp up
```

#### Local documentation

In order to run your local documentation server execute following command:

```sh
pnpm nx start docs
pnpm saas docs up
```

## Tech stack
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
- CI=true
build:
args:
- BACKEND_BASE_IMAGE=${BACKEND_BASE_IMAGE}
- BACKEND_BASE_IMAGE=${SB_BACKEND_BASE_IMAGE}

workers:
volumes:
Expand All @@ -27,4 +27,4 @@ services:
- AWS_SESSION_EXPIRATION=${AWS_SESSION_EXPIRATION}
build:
args:
- WORKERS_BASE_IMAGE=${WORKERS_BASE_IMAGE}
- WORKERS_BASE_IMAGE=${SB_WORKERS_BASE_IMAGE}
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ services:
- "5432:5432"
restart: unless-stopped
environment:
- PGUSER=backend
- POSTGRES_USER=backend
- POSTGRES_PASSWORD=backend
- POSTGRES_DB=backend
Expand All @@ -20,7 +21,7 @@ services:
build:
context: ./packages/backend
target: backend
command: ["./scripts/run_local.sh"]
command: ["./scripts/runtime/run_local.sh"]
ports:
- "5001:5001"
depends_on:
Expand Down
1 change: 0 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"npmScope": "sb",
"tasksRunnerOptions": {
"default": {
"runner": "@sb/core/custom-task-runner",
"options": {
"cacheableOperations": [
"setup",
Expand Down
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,26 @@
"scripts": {
"aws-vault:shell": "aws-vault exec $AWS_VAULT_PROFILE -- $SHELL",
"login:qa": "env-cmd -f .env.qa npm run aws-vault:shell",
"prepare": "husky install"
"prepare": "husky install",
"postinstall": "pnpm nx run cli:build"
},
"devDependencies": {
"@apollo/client": "^3.7.9",
"@apollo/rover": "^0.12.2",
"@babel/preset-react": "^7.14.5",
"@nx/js": "16.3.2",
"@graphql-typed-document-node/core": "^3.2.0",
"@nx/devkit": "16.3.2",
"@nx/eslint-plugin": "16.3.2",
"@nx/jest": "16.3.2",
"@nx/js": "16.3.2",
"@nx/linter": "16.3.2",
"@nx/node": "16.3.2",
"@nx/plugin": "16.3.2",
"@nx/react": "16.3.2",
"@nx/web": "16.3.2",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
"@sb/core": "*",
"@svgr/webpack": "^6.1.2",
"@swc-node/register": "^1.4.2",
"@swc/cli": "0.1.62",
"@swc/core": "^1.2.173",
"@swc/helpers": "0.5.1",
"@tailwindcss/typography": "^0.5.9",
"@testing-library/react": "14.0.0",
"@types/gtag.js": "^0.0.12",
Expand All @@ -36,7 +38,6 @@
"@types/styled-components": "5.1.26",
"@typescript-eslint/eslint-plugin": "5.59.9",
"@typescript-eslint/parser": "5.59.9",
"@graphql-typed-document-node/core": "^3.2.0",
"babel-jest": "29.4.3",
"babel-plugin-relay": "^14.1.0",
"babel-plugin-styled-components": "1.10.7",
Expand All @@ -59,6 +60,7 @@
"nx-cloud": "16.0.5",
"prettier": "^2.6.2",
"react-refresh": "^0.10.0",
"string-argv": "^0.3.2",
"tailwindcss": "^3.3.2",
"tailwindcss-animate": "^1.0.5",
"ts-jest": "29.1.0",
Expand All @@ -67,10 +69,7 @@
"tslib": "^2.3.0",
"typescript": "5.0.4",
"url-loader": "^4.1.1",
"@nx/eslint-plugin": "16.3.2",
"@nx/jest": "16.3.2",
"@nx/plugin": "16.3.2",
"@nx/node": "16.3.2"
"@sb/cli": "*"
},
"dependencies": {
"react": "18.2.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ ENV HASHID_FIELD_SALT='' \
WORKERS_EVENT_BUS_NAME='' \
PYTHONPATH=/pkgs/__pypackages__/3.11/lib

RUN ./scripts/build_static.sh
RUN ./scripts/runtime/build_static.sh


FROM backend_build AS backend
COPY --from=static_files /app/static /app/static
ENV PYTHONPATH=/pkgs/__pypackages__/3.11/lib \
PATH=$PATH:/pkgs/__pypackages__/3.11/bin

CMD ["./scripts/run.sh"]
CMD ["./scripts/runtime/run.sh"]
Loading

0 comments on commit c36a5d2

Please sign in to comment.