Skip to content

Commit

Permalink
refactor: monorepo structure with turborepo for local development
Browse files Browse the repository at this point in the history
  • Loading branch information
raaymax committed Mar 6, 2024
1 parent ac0522e commit c34f63f
Show file tree
Hide file tree
Showing 85 changed files with 320 additions and 7,262 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: npm run build

- name: Install E2E browsers
working-directory: e2e_tests
working-directory: e2e
run: npx playwright install ${{ matrix.browser }} --with-deps

- name: Run E2E tests
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ src/streamsync.egg-info/
*:Zone.Identifier
*.DS_Store
src/streamsync/static
cli/src/streamsync/static
playground/
*.mp4
*.mp4
.turbo
5 changes: 2 additions & 3 deletions alfred/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import alfred


@alfred.command("build", help="build apps package for pypi")
@alfred.option("--ignore-ci", is_flag=True, help="ignore continuous integration pipeline")
def build(ignore_ci: bool = False):
Expand All @@ -17,8 +16,8 @@ def build(ignore_ci: bool = False):

@alfred.command("build.app_provisionning", help="update app templates using ./apps", hidden=True)
def build_app_provisionning():
if os.path.isdir('src/streamsync/app_templates'):
shutil.rmtree('src/streamsync/app_templates')
if os.path.isdir('cli/src/streamsync/app_templates'):
shutil.rmtree('cli/src/streamsync/app_templates')

shutil.copytree( 'apps/default', 'src/streamsync/app_templates/default')
shutil.copytree( 'apps/hello', 'src/streamsync/app_templates/hello')
Expand Down
8 changes: 4 additions & 4 deletions alfred/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ def ci(front, back, e2e):
if e2e:
alfred.invoke_command("npm.e2e", browser=e2e)

@alfred.command("ci.mypy", help="typing checking with mypy on ./src/streamsync")
@alfred.command("ci.mypy", help="typing checking with mypy on ./cli/src/streamsync")
def ci_mypy():
alfred.run("mypy ./src/streamsync --exclude app_templates/*")
alfred.run("mypy ./cli/src/streamsync --exclude app_templates/*")


@alfred.command("ci.pytest", help="run pytest on ./tests")
@alfred.command("ci.pytest", help="run pytest on ./cli/tests")
def ci_test():
os.chdir("tests")
os.chdir("cli/tests")
alfred.run("pytest")
4 changes: 2 additions & 2 deletions alfred/npm.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def npm_test(browser):

@alfred.command("npm.build", help="build ui code")
def npm_build():
alfred.run("npm run build")
alfred.run("npm run build:ci")

@alfred.command("npm.build_custom_components", help="build custom components")
def ui_build_custom():
alfred.run("npm run custom.build")
alfred.run("npm run custom.build:ci")
12 changes: 6 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -e
# UI BUILD

cd ./ui
npm run build
npm run build:ci
cd ..

# PYTEST
Expand All @@ -17,14 +17,14 @@ cd ..

# TYPE CHECKS (MYPY)

poetry run mypy ./src/streamsync/*.py
poetry run mypy ./cli/src/streamsync/*.py

# APP PROVISIONING

rm -rf ./src/streamsync/app_templates/*
cp -r ./apps/default ./src/streamsync/app_templates
cp -r ./apps/hello ./src/streamsync/app_templates
cp -r ./apps/quickstart ./src/streamsync/app_templates
rm -rf ./cli/src/streamsync/app_templates/*
cp -r ./apps/default ./cli/src/streamsync/app_templates
cp -r ./apps/hello ./cli/src/streamsync/app_templates
cp -r ./apps/quickstart ./cli/src/streamsync/app_templates

# PYTHON PACKAGE BUILD

Expand Down
11 changes: 11 additions & 0 deletions cli/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "streamsync-cli",
"version": "0.0.0",
"scripts": {
"test": "pytest tests -o log_cli=true ",
"lint": "mypy ./src/streamsync --exclude app_templates/*"
},
"dependencies": {
"streamsync-ui": "*"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
Loading

0 comments on commit c34f63f

Please sign in to comment.