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

build!: Migrate to pub workspace #2704

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
6 changes: 3 additions & 3 deletions .github/workflows/conventional_commits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
- name: Install dart
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 # v1
with:
sdk: 3.5
sdk: 3.6
- name: Install commitlint_cli
run: dart pub get
run: dart pub global activate commitlint_cli 0.8.1

- name: Lint conventional commits
run: dart run commitlint_cli --from=${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to=${{ github.event.pull_request.head.sha }}
run: dart pub global run commitlint_cli --from=${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to=${{ github.event.pull_request.head.sha }}
4 changes: 2 additions & 2 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Install dart
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 # v1
with:
sdk: 3.5
sdk: 3.6
- name: Setup
run: ./tool/setup.sh

Expand All @@ -48,7 +48,7 @@ jobs:
if: ${{ matrix.dependencies == 'downgrade' }}
run: |
git apply .github/workflows/dependency_overrides.patch
melos exec dart pub downgrade
fvm dart pub downgrade
- name: Check formatting
run: melos run format:check
- name: Lint code
Expand Down
457 changes: 7 additions & 450 deletions .github/workflows/dependency_overrides.patch

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/generate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Install dart
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 # v1
with:
sdk: 3.5
sdk: 3.6
- name: Setup
run: ./tool/setup.sh

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Install dart
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 # v1
with:
sdk: 3.5
sdk: 3.6
- name: Setup
run: ./tool/setup.sh

Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
- name: Install dart
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 # v1
with:
sdk: 3.5
sdk: 3.6
- name: Setup
run: ./tool/setup.sh
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_presets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Install dart
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 # v1
with:
sdk: 3.5
sdk: 3.6
- name: Setup
run: ./tool/setup.sh

Expand Down
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
.dart_tool
pubspec.lock
.flutter-plugins
.flutter-plugins-dependencies

packages/**/.idea
packages/**/*.iml
packages/**/*.symbols
packages/**/*.log
packages/**/.flutter-plugins
packages/**/.flutter-plugins-dependencies
packages/**/coverage
packages/**/build
packages/**/build-dir
packages/**/.flatpak-builder
packages/**/doc/api

!packages/neon_framework/example/pubspec.lock

# Melos recommends adding them, but renovate does not generate them which would end up with broken lockfiles
# **/pubspec_overrides.yaml

Expand Down
4 changes: 2 additions & 2 deletions docs/workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
If you need to add a new package to the Neon project please make sure to execute all the following steps:
1. Use the according template by running `fvm dart create -t package package_name` or `fvm flutter create -t package package_name`.
2. Make sure to activate our strict linting by adding it to the package.
3. Regenerate the dependency overrides by executing `melos bootstrap`.
4. Add a Symlink to our main [license](../assets/AGPL-3.0.txt).
3. Add a Symlink to our main [license](../assets/AGPL-3.0.txt).
4. Update the workspace [pubspec.yaml](../pubspec.yaml) by adding the new package path.
5. Update [commitlint.yaml](../commitlint.yaml) by adding the new package name.
6. Remove the package `.gitignore` (a global `.gitignore` for all packages is used instead).

Expand Down
5 changes: 1 addition & 4 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ command:
post: melos run format
version:
hooks:
preCommit: |
melos bootstrap
git add packages/neon_framework/example/pubspec.lock
# Needed until https://github.com/invertase/melos/issues/591 is supported
post: |
git commit --amend --signoff --no-edit
Expand All @@ -44,7 +41,7 @@ scripts:
test:dart: >
melos exec --no-flutter --concurrency=1 --fail-fast --dir-exists=test -- "
dart test --concurrency=$(nproc --all) --coverage=coverage &&
dart pub global run coverage:format_coverage --packages=.dart_tool/package_config.json --report-on=lib --lcov -o ./coverage/lcov.info -i ./coverage
dart pub global run coverage:format_coverage --packages=MELOS_ROOT_PATH/.dart_tool/package_config.json --report-on=lib --lcov -o ./coverage/lcov.info -i ./coverage
"
test:flutter: melos exec --flutter --concurrency=1 --fail-fast --dir-exists=test -- flutter test --concurrency=$(nproc --all) --coverage
generate:neon:build_runner: melos exec --scope="neon*" --file-exists="build.yaml" -- dart run build_runner build --delete-conflicting-outputs && melos run format
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@ description: >-
A library that tests whether implementations of package:cookie_store's `CookieStore`
class behave as expected.
publish_to: none
resolution: workspace

environment:
sdk: ^3.0.0
sdk: ^3.5.0

dependencies:
cookie_store:
git:
url: https://github.com/nextcloud/neon
path: packages/cookie_store
path: ../..
meta: ^1.0.0
test: ^1.21.2

dev_dependencies:
neon_lints:
git:
url: https://github.com/nextcloud/neon
path: packages/neon_lints
path: ../../../neon_lints
Comment on lines 18 to +19
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have it as a dev_dependency of the workspace package and just use a global analysis_options.yaml.

Every package may still alter the rule set but this would make our lints the default (also for newly added packages).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't think about this, but yes it makes sense. How are we going to handle custom_lint though? We need to disable some of the rules for specific packages?
OTOH this brings up the point of removing custom_lint entirely, given that it mostly causes headaches and hasn't caught so many problems so far.

This file was deleted.

13 changes: 5 additions & 8 deletions packages/cookie_store/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@ name: cookie_store
description: A RFC compliant cookie store
version: 0.1.0
publish_to: none
resolution: workspace

environment:
sdk: ^3.0.0
sdk: ^3.5.0

dependencies:
meta: ^1.0.0
timezone: ^0.10.0

dev_dependencies:
cookie_store_conformance_tests:
git:
url: https://github.com/nextcloud/neon
path: packages/cookie_store/packages/cookie_store_conformance_tests
path: packages/cookie_store_conformance_tests
neon_lints:
git:
url: https://github.com/nextcloud/neon
path: packages/neon_lints
test: ^1.25.8
path: ../neon_lints
test: ^1.24.0
6 changes: 0 additions & 6 deletions packages/cookie_store/pubspec_overrides.yaml

This file was deleted.

7 changes: 3 additions & 4 deletions packages/dynamite/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ name: dynamite_petstore_example
description: An example showing how to use dynamite for the Petstore example API.
version: 1.0.0
publish_to: none
resolution: workspace

environment:
sdk: ^3.0.0
sdk: ^3.5.0

dependencies:
built_collection: ^5.0.0
Expand All @@ -19,6 +20,4 @@ dev_dependencies:
built_value_generator: ^8.9.3
dynamite: ^0.5.0+1
neon_lints:
git:
url: https://github.com/nextcloud/neon
path: packages/neon_lints
path: ../../neon_lints
8 changes: 0 additions & 8 deletions packages/dynamite/example/pubspec_overrides.yaml

This file was deleted.

10 changes: 5 additions & 5 deletions packages/dynamite/packages/dynamite_end_to_end_test/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ name: dynamite_end_to_end_test
publish_to: none
description: Tests for dynamite. Not meant for publishing.
version: 1.0.0
resolution: workspace

environment:
sdk: ^3.0.0
sdk: ^3.5.0

dependencies:
built_collection: ^5.0.0
Expand All @@ -21,7 +22,6 @@ dev_dependencies:
built_value_test: ^8.9.3
dynamite: ^0.5.0+1
neon_lints:
git:
url: https://github.com/nextcloud/neon
path: packages/neon_lints
test: ^1.25.8
path: ../../../neon_lints
test: ^1.24.0

This file was deleted.

10 changes: 5 additions & 5 deletions packages/dynamite/packages/dynamite_runtime/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ topics:
- openapi
- codegen
- build-runner
resolution: workspace

environment:
sdk: ^3.0.0
sdk: ^3.5.0

dependencies:
built_collection: ^5.0.0
Expand All @@ -24,10 +25,9 @@ dev_dependencies:
build_runner: ^2.4.14
built_value_generator: ^8.9.3
neon_lints:
git:
url: https://github.com/nextcloud/neon
path: packages/neon_lints
test: ^1.25.8
path: ../../../neon_lints
test: ^1.24.0


platforms:
windows:
Expand Down

This file was deleted.

9 changes: 4 additions & 5 deletions packages/dynamite/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ topics:
- openapi
- codegen
- build-runner
resolution: workspace

environment:
sdk: ^3.0.0
sdk: ^3.5.0

dependencies:
build: ^2.0.0
Expand All @@ -35,7 +36,5 @@ dev_dependencies:
built_value_generator: ^8.9.3
built_value_test: ^8.9.3
neon_lints:
git:
url: https://github.com/nextcloud/neon
path: packages/neon_lints
test: ^1.25.8
path: ../neon_lints
test: ^1.24.0
4 changes: 0 additions & 4 deletions packages/dynamite/pubspec_overrides.yaml

This file was deleted.

14 changes: 6 additions & 8 deletions packages/interceptor_http_client/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ name: interceptor_http_client
description: A http client with request and response interceptors.
version: 0.1.0
publish_to: none
resolution: workspace

environment:
sdk: ^3.0.0
sdk: ^3.5.0

dependencies:
built_collection: ^5.0.0
cookie_store:
git:
url: https://github.com/nextcloud/neon
path: packages/cookie_store
path: ../cookie_store
http: ^1.0.0
meta: ^1.0.0

Expand All @@ -23,7 +22,6 @@ dev_dependencies:
ref: 76512c4cbf987361421030349fd1946e63e33359
mocktail: ^1.0.4
neon_lints:
git:
url: https://github.com/nextcloud/neon
path: packages/neon_lints
test: ^1.25.8
path: ../neon_lints
test: ^1.24.0

6 changes: 0 additions & 6 deletions packages/interceptor_http_client/pubspec_overrides.yaml

This file was deleted.

Loading
Loading