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

Setup turborepo #45

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 0 additions & 41 deletions .github/actions/assert-build/action.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/actions/download-built-package/action.yml

This file was deleted.

10 changes: 9 additions & 1 deletion .github/actions/pnpm/action.yml
Expand Up @@ -11,4 +11,12 @@ runs:
cache: 'pnpm'
- name: 'Install dependencies'
shell: 'bash'
run: pnpm install
run: |
pnpm -v
pnpm install --fix-lockfile
git_diff=$(git diff)
if [[ "$git_diff" -eq "" ]]; then
echo "Success: no lockfile differences" ;
else
echo "Error: lockfile differences detected";
fi
75 changes: 40 additions & 35 deletions .github/workflows/ci.yml
Expand Up @@ -13,38 +13,33 @@ concurrency:

env:
CI: true
# dist: ember-headless-form/dist
dist: packages/ember-headless-form/dist

jobs:
install_dependencies:
name: Install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: TurboRepo local server
uses: felixmosh/turborepo-gh-artifacts@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/pnpm

# build:
# name: Build Tests
# needs: [install_dependencies]
# timeout-minutes: 5
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: ./.github/actions/pnpm
# - uses: ./.github/actions/assert-build

lint:
name: Lint
runs-on: ubuntu-latest
needs:
- install_dependencies
# - build
steps:
- uses: actions/checkout@v3
- name: TurboRepo local server
uses: felixmosh/turborepo-gh-artifacts@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/pnpm
- run: pnpm build
# To be able to run glint, we need the dist directory
# - uses: ./.github/actions/download-built-package
- name: Lint + Format + Glint
run: pnpm lint

Expand All @@ -54,7 +49,6 @@ jobs:
timeout-minutes: 2
needs:
- install_dependencies
# - build
continue-on-error: true
strategy:
fail-fast: true
Expand All @@ -65,47 +59,48 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: TurboRepo local server
uses: felixmosh/turborepo-gh-artifacts@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/pnpm
# - uses: ./.github/actions/download-built-package
- run: pnpm build
- name: 'Change TS to ${{ matrix.typescript-scenario }}'
run: 'pnpm add --save-dev ${{ matrix.typescript-scenario}}'
working-directory: ./test-app
- name: 'Type checking'
run: |
pnpm --filter test-app exec tsc -v;
pnpm --filter test-app exec glint --version;
pnpm --filter test-app exec glint;
run: pnpm _turbo typecheck

default_tests:
name: Default Tests
timeout-minutes: 5
runs-on: ubuntu-latest
needs:
- install_dependencies
# - build
steps:
- uses: actions/checkout@v3
- name: TurboRepo local server
uses: felixmosh/turborepo-gh-artifacts@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/pnpm
- run: pnpm build
# - uses: ./.github/actions/download-built-package
- run: pnpm --filter test-app test:ember
- run: pnpm test

floating_tests:
name: Floating Deps Test
timeout-minutes: 5
runs-on: ubuntu-latest
needs:
- install_dependencies
# - build
steps:
- uses: actions/checkout@v3
- name: TurboRepo local server
uses: felixmosh/turborepo-gh-artifacts@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/pnpm
- name: Install Dependencies (without lockfile)
run: rm pnpm-lock.yaml && pnpm install
- run: pnpm build
# - uses: ./.github/actions/download-built-package
- run: pnpm --filter test-app test:ember
- run: pnpm test

try_scenarios:
name: ${{ matrix.try-scenario }}
Expand All @@ -128,14 +123,21 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: TurboRepo local server
uses: felixmosh/turborepo-gh-artifacts@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/pnpm
- run: pnpm build
# - uses: ./.github/actions/download-built-package
- name: Run Tests
working-directory: ./test-app
run: >-
node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
--skip-cleanup
# This command doesn't actually run the bash command, but
# instead falls back to ember test...
# run: >-
# node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
# --skip-cleanup --- bash -c "cd ../ && pnpm test"
# same as the above, but without the sub-shell
run: node_modules/.bin/ember try:one ${{matrix.try-scenario}} --skip-cleanup --- pnpm turbo --api='http://127.0.0.1:9080' test


# https://github.com/changesets/action
release:
Expand All @@ -153,9 +155,12 @@ jobs:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: TurboRepo local server
uses: felixmosh/turborepo-gh-artifacts@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/pnpm
- run: pnpm build
# - uses: ./.github/actions/download-built-package
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -7,6 +7,7 @@ dist/
node_modules/

# misc
.turbo/
/.env*
/.pnp*
/.pnpm-debug.log
Expand Down
14 changes: 9 additions & 5 deletions package.json
Expand Up @@ -8,19 +8,23 @@
"scripts": {
"release": "changeset publish",
"prepare": "pnpm build",
"build": "pnpm --filter ember-headless-form build && pnpm --filter '@ember-headless-form/*' build",
"start": "concurrently 'npm:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
"start:tests": "pnpm --filter test-app start",
"start:addon": "pnpm --filter !test-app start --no-watch.clearScreen",
"test": "pnpm --filter test-app test",
"lint": "pnpm --filter '*' lint",
"lint:fix": "pnpm --filter '*' lint:fix"
"build": "pnpm _turbo build",
"turbo:start": "pnpm _turbo start",
"test": "pnpm _turbo test",
"lint": "pnpm _turbo lint",
"lint:fix": "pnpm --filter '*' lint:fix",
"dev": "pnpm start",
"_turbo": "pnpm turbo --api='http://127.0.0.1:9080'"
},
"devDependencies": {
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.0",
"concurrently": "^7.6.0",
"prettier": "^2.8.3"
"prettier": "^2.8.3",
"turbo": "^1.7.4"
},
"pnpm": {
"overrides": {
Expand Down
10 changes: 6 additions & 4 deletions packages/ember-headless-form/package.json
Expand Up @@ -37,7 +37,8 @@
},
"peerDependencies": {
"@glimmer/component": "^1.1.2",
"@glimmer/tracking": "^1.1.2"
"@glimmer/tracking": "^1.1.2",
"ember-source": "^4.4.0"
},
"devDependencies": {
"@babel/core": "^7.17.0",
Expand Down Expand Up @@ -84,7 +85,8 @@
"rollup": "^2.67.0",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-ts": "^3.2.0",
"typescript": "^4.7.4"
"typescript": "^4.7.4",
"ember-source": "^4.4.0"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
Expand All @@ -106,8 +108,8 @@
"types": "./dist/*.d.ts",
"default": "./dist/*.js"
},
"./-private/*": null,
"./addon-main.js": "./addon-main.js"
"./addon-main.js": "./addon-main.js",
"./-private/*": null
},
"typesVersions": {
"*": {
Expand Down
@@ -1,8 +1,5 @@
{{#let
(unique-id)
(unique-id)
(fn @set @name)
(fn @triggerValidationFor @name)
(unique-id) (unique-id) (fn @set @name) (fn @triggerValidationFor @name)
as |fieldId errorId setValue triggerValidation|
}}
{{yield
Expand Down
4 changes: 3 additions & 1 deletion packages/yup/package.json
Expand Up @@ -31,7 +31,8 @@
},
"peerDependencies": {
"yup": "^1.0.0",
"ember-headless-form": "^0.0.0"
"ember-headless-form": "^0.0.0",
"ember-source": "^4.4.0"
},
"devDependencies": {
"@babel/core": "^7.17.0",
Expand Down Expand Up @@ -66,6 +67,7 @@
"concurrently": "^7.2.1",
"ember-headless-form": "workspace:*",
"ember-template-lint": "^4.0.0",
"ember-source": "^4.4.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.8",
Expand Down