diff --git a/wnma_dart_package/__brick__/{{project_name.snakeCase()}}/analysis_options.yaml b/wnma_dart_package/__brick__/{{project_name.snakeCase()}}/analysis_options.yaml index 245ed9f..0556da5 100644 --- a/wnma_dart_package/__brick__/{{project_name.snakeCase()}}/analysis_options.yaml +++ b/wnma_dart_package/__brick__/{{project_name.snakeCase()}}/analysis_options.yaml @@ -1 +1,2 @@ -include: package:lintervention/analysis_options.yaml +{{#publishable}}include: package:lintervention/package.yaml{{/publishable}} +{{^publishable}}include: package:lintervention/app.yaml{{/publishable}} diff --git a/wnma_dart_package/__brick__/{{project_name.snakeCase()}}/lib/{{project_name.snakeCase()}}.dart b/wnma_dart_package/__brick__/{{project_name.snakeCase()}}/lib/{{project_name.snakeCase()}}.dart index e95435a..a04d5f2 100644 --- a/wnma_dart_package/__brick__/{{project_name.snakeCase()}}/lib/{{project_name.snakeCase()}}.dart +++ b/wnma_dart_package/__brick__/{{project_name.snakeCase()}}/lib/{{project_name.snakeCase()}}.dart @@ -1,4 +1,4 @@ /// {{{description}}} -library {{project_name.snakeCase()}}; +library; export 'src/{{project_name.snakeCase()}}.dart'; diff --git a/wnma_dart_package/__brick__/{{project_name.snakeCase()}}/pubspec.yaml b/wnma_dart_package/__brick__/{{project_name.snakeCase()}}/pubspec.yaml index 84e1f19..b65f3e4 100644 --- a/wnma_dart_package/__brick__/{{project_name.snakeCase()}}/pubspec.yaml +++ b/wnma_dart_package/__brick__/{{project_name.snakeCase()}}/pubspec.yaml @@ -2,11 +2,12 @@ name: {{project_name.snakeCase()}} description: {{{description}}} version: 0.1.0 {{^publishable}}publish_to: none{{/publishable}} +{{#workspace}}resolution: workspace{{/workspace}} environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ">=3.9.0 <4.0.0" dev_dependencies: - lintervention: ^0.3.1 + lintervention: ^0.4.0 mocktail: ^1.0.4 - test: ^1.26.2 + test: ^1.26.3 diff --git a/wnma_dart_package/__brick__/{{project_name.snakeCase()}}/test/src/{{project_name.snakeCase()}}_test.dart b/wnma_dart_package/__brick__/{{project_name.snakeCase()}}/test/src/{{project_name.snakeCase()}}_test.dart index 2405481..ad79e00 100644 --- a/wnma_dart_package/__brick__/{{project_name.snakeCase()}}/test/src/{{project_name.snakeCase()}}_test.dart +++ b/wnma_dart_package/__brick__/{{project_name.snakeCase()}}/test/src/{{project_name.snakeCase()}}_test.dart @@ -1,3 +1,4 @@ +// We ignore prefer_const_constructors here to make testing more convenient. // ignore_for_file: prefer_const_constructors import 'package:test/test.dart'; import 'package:{{project_name.snakeCase()}}/{{project_name.snakeCase()}}.dart'; diff --git a/wnma_dart_package/brick.yaml b/wnma_dart_package/brick.yaml index fcc6e98..018028a 100644 --- a/wnma_dart_package/brick.yaml +++ b/wnma_dart_package/brick.yaml @@ -22,3 +22,8 @@ vars: description: Whether the generated package is intended to be published. default: false prompt: Will the package be published? + workspace: + type: boolean + description: Whether this package is part of a dart workspace (such as melos >7.0.0) + default: true + prompt: Is this package part of a workspace? diff --git a/wnma_dart_package/config.json b/wnma_dart_package/config.json index f4a2882..495fea2 100644 --- a/wnma_dart_package/config.json +++ b/wnma_dart_package/config.json @@ -1,5 +1,6 @@ { "project_name": "test_package", "description": "Package for testing", - "publishable": true + "publishable": true, + "workspace": false } \ No newline at end of file diff --git a/wnma_flutter_package/__brick__/{{project_name.snakeCase()}}/analysis_options.yaml b/wnma_flutter_package/__brick__/{{project_name.snakeCase()}}/analysis_options.yaml index 245ed9f..0556da5 100644 --- a/wnma_flutter_package/__brick__/{{project_name.snakeCase()}}/analysis_options.yaml +++ b/wnma_flutter_package/__brick__/{{project_name.snakeCase()}}/analysis_options.yaml @@ -1 +1,2 @@ -include: package:lintervention/analysis_options.yaml +{{#publishable}}include: package:lintervention/package.yaml{{/publishable}} +{{^publishable}}include: package:lintervention/app.yaml{{/publishable}} diff --git a/wnma_flutter_package/__brick__/{{project_name.snakeCase()}}/lib/{{project_name.snakeCase()}}.dart b/wnma_flutter_package/__brick__/{{project_name.snakeCase()}}/lib/{{project_name.snakeCase()}}.dart index e95435a..a04d5f2 100644 --- a/wnma_flutter_package/__brick__/{{project_name.snakeCase()}}/lib/{{project_name.snakeCase()}}.dart +++ b/wnma_flutter_package/__brick__/{{project_name.snakeCase()}}/lib/{{project_name.snakeCase()}}.dart @@ -1,4 +1,4 @@ /// {{{description}}} -library {{project_name.snakeCase()}}; +library; export 'src/{{project_name.snakeCase()}}.dart'; diff --git a/wnma_flutter_package/__brick__/{{project_name.snakeCase()}}/pubspec.yaml b/wnma_flutter_package/__brick__/{{project_name.snakeCase()}}/pubspec.yaml index 5789543..862d413 100644 --- a/wnma_flutter_package/__brick__/{{project_name.snakeCase()}}/pubspec.yaml +++ b/wnma_flutter_package/__brick__/{{project_name.snakeCase()}}/pubspec.yaml @@ -2,10 +2,11 @@ name: {{project_name.snakeCase()}} description: {{{description}}} version: 0.1.0 {{^publishable}}publish_to: none{{/publishable}} +{{#workspace}}resolution: workspace{{/workspace}} environment: - sdk: ">=3.8.0 <4.0.0" - flutter: ">=3.32.0" + sdk: ">=3.9.0 <4.0.0" + flutter: ">=3.35.0" dependencies: flutter: @@ -14,5 +15,5 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - lintervention: ^0.3.1 + lintervention: ^0.4.0 mocktail: ^1.0.4 diff --git a/wnma_flutter_package/__brick__/{{project_name.snakeCase()}}/test/src/{{project_name.snakeCase()}}_test.dart b/wnma_flutter_package/__brick__/{{project_name.snakeCase()}}/test/src/{{project_name.snakeCase()}}_test.dart index 988c871..ee4a38e 100644 --- a/wnma_flutter_package/__brick__/{{project_name.snakeCase()}}/test/src/{{project_name.snakeCase()}}_test.dart +++ b/wnma_flutter_package/__brick__/{{project_name.snakeCase()}}/test/src/{{project_name.snakeCase()}}_test.dart @@ -1,3 +1,4 @@ +// We ignore prefer_const_constructors here to make testing more convenient. // ignore_for_file: prefer_const_constructors import 'package:flutter_test/flutter_test.dart'; import 'package:{{project_name.snakeCase()}}/{{project_name.snakeCase()}}.dart'; diff --git a/wnma_flutter_package/brick.yaml b/wnma_flutter_package/brick.yaml index e5bc29d..2bd584f 100644 --- a/wnma_flutter_package/brick.yaml +++ b/wnma_flutter_package/brick.yaml @@ -22,4 +22,8 @@ vars: description: Whether the generated package is intended to be published. default: false prompt: Will the package be published? - \ No newline at end of file + workspace: + type: boolean + description: Whether this package is part of a dart workspace (such as melos >7.0.0) + default: true + prompt: Is this package part of a workspace? \ No newline at end of file diff --git a/wnma_flutter_package/config.json b/wnma_flutter_package/config.json index f4a2882..495fea2 100644 --- a/wnma_flutter_package/config.json +++ b/wnma_flutter_package/config.json @@ -1,5 +1,6 @@ { "project_name": "test_package", "description": "Package for testing", - "publishable": true + "publishable": true, + "workspace": false } \ No newline at end of file diff --git a/wnma_workspace/__brick__/{{project_name.snakeCase()}}/analysis_options.yaml b/wnma_workspace/__brick__/{{project_name.snakeCase()}}/analysis_options.yaml index 245ed9f..08474f6 100644 --- a/wnma_workspace/__brick__/{{project_name.snakeCase()}}/analysis_options.yaml +++ b/wnma_workspace/__brick__/{{project_name.snakeCase()}}/analysis_options.yaml @@ -1 +1 @@ -include: package:lintervention/analysis_options.yaml +include: package:lintervention/app.yaml diff --git a/wnma_workspace/__brick__/{{project_name.snakeCase()}}/melos.yaml b/wnma_workspace/__brick__/{{project_name.snakeCase()}}/melos.yaml deleted file mode 100644 index 74c9d56..0000000 --- a/wnma_workspace/__brick__/{{project_name.snakeCase()}}/melos.yaml +++ /dev/null @@ -1,66 +0,0 @@ -name: {{project_name.snakeCase()}}_workspace - -packages: - - packages/* - -command: - version: - updateGitTagRefs: true - workspaceChangelog: false - hooks: - preCommit: | - melos run generate - git add . - -scripts: - analyze: - run: | - dart analyze . --fatal-infos - exec: - # We are setting the concurrency to 1 because a higher concurrency can crash - # the analysis server on low performance machines (like GitHub Actions). - concurrency: 1 - description: | - Run `dart analyze` in all packages. - - Note: you can also rely on your IDEs Dart Analysis / Issues window. - - test:select: - run: flutter test - exec: - failFast: true - concurrency: 6 - packageFilters: - dirExists: test - description: Run `flutter test test` for selected packages. - - test: - run: melos run test:select --no-select - description: Run all tests in this project. - - coverage:select: - run: | - flutter test --coverage - exec: - failFast: true - concurrency: 6 - packageFilters: - dirExists: test - description: Generate coverage for the selected package. - - coverage: - run: melos run coverage:select --no-select - description: Generate coverage for all packages. - - generate:select: - description: Run code generation for selected packages. - run: dart run build_runner build --delete-conflicting-outputs - exec: - concurrency: 1 - failFast: true - packageFilters: - dependsOn: - - build_runner - - generate: - description: Run code generation for all packages. - run: melos run generate:select --no-select \ No newline at end of file diff --git a/wnma_workspace/__brick__/{{project_name.snakeCase()}}/pubspec.yaml b/wnma_workspace/__brick__/{{project_name.snakeCase()}}/pubspec.yaml index ec506a3..d62edee 100644 --- a/wnma_workspace/__brick__/{{project_name.snakeCase()}}/pubspec.yaml +++ b/wnma_workspace/__brick__/{{project_name.snakeCase()}}/pubspec.yaml @@ -3,10 +3,77 @@ description: {{{description}}} version: 0.1.0 publish_to: none +# TODO Add your workspace packages or apps here +# workspace: +# - packages/my_package + environment: - sdk: ">=3.8.0 <4.0.0" - flutter: ">=3.32.0" + sdk: ">=3.9.0 <4.0.0" + flutter: ">=3.35.0" dev_dependencies: - lintervention: ^0.3.1 - melos: ^6.3.3 + lintervention: ^0.4.0 + melos: ^7.1.1 + +melos: + command: + version: + updateGitTagRefs: true + workspaceChangelog: false + hooks: + preCommit: | + melos run generate + git add . + + scripts: + analyze: + run: | + dart analyze . --fatal-infos + exec: + # We are setting the concurrency to 1 because a higher concurrency can crash + # the analysis server on low performance machines (like GitHub Actions). + concurrency: 1 + description: | + Run `dart analyze` in all packages. + - Note: you can also rely on your IDEs Dart Analysis / Issues window. + + test:select: + run: flutter test + exec: + failFast: true + concurrency: 6 + packageFilters: + dirExists: test + description: Run `flutter test test` for selected packages. + + test: + run: melos run test:select --no-select + description: Run all tests in this project. + + coverage:select: + run: | + flutter test --coverage + exec: + failFast: true + concurrency: 6 + packageFilters: + dirExists: test + description: Generate coverage for the selected package. + + coverage: + run: melos run coverage:select --no-select + description: Generate coverage for all packages. + + generate:select: + description: Run code generation for selected packages. + run: dart run build_runner build --delete-conflicting-outputs + exec: + concurrency: 1 + failFast: true + packageFilters: + dependsOn: + - build_runner + + generate: + description: Run code generation for all packages. + run: melos run generate:select --no-select \ No newline at end of file