ember-try 3.0.0-beta.1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.release-plan.json +33 -0
- package/CHANGELOG.md +90 -0
- package/README.md +33 -16
- package/lib/commands/config.js +4 -2
- package/lib/commands/reset.js +3 -3
- package/lib/commands/try-each.js +3 -3
- package/lib/commands/try-ember.js +3 -3
- package/lib/commands/try-one.js +6 -7
- package/lib/dependency-manager-adapters/base.js +175 -0
- package/lib/dependency-manager-adapters/npm.js +9 -278
- package/lib/dependency-manager-adapters/pnpm.js +52 -158
- package/lib/dependency-manager-adapters/workspace.js +23 -28
- package/lib/dependency-manager-adapters/yarn.js +11 -0
- package/lib/tasks/reset.js +13 -8
- package/lib/tasks/try-each.js +37 -31
- package/lib/utils/backup.js +95 -0
- package/lib/utils/config.js +40 -18
- package/lib/utils/console.js +51 -0
- package/lib/utils/dependency-manager-adapter-factory.js +18 -22
- package/lib/utils/package-managers.js +9 -0
- package/lib/utils/result-summary.js +27 -23
- package/lib/utils/run.js +22 -2
- package/lib/utils/scenario-manager.js +11 -10
- package/package.json +35 -48
- package/lib/utils/find-by-name.js +0 -10
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"solution": {
|
|
3
|
+
"ember-try": {
|
|
4
|
+
"impact": "major",
|
|
5
|
+
"oldVersion": "3.0.0",
|
|
6
|
+
"newVersion": "4.0.0",
|
|
7
|
+
"constraints": [
|
|
8
|
+
{
|
|
9
|
+
"impact": "major",
|
|
10
|
+
"reason": "Appears in changelog section :boom: Breaking Change"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"impact": "minor",
|
|
14
|
+
"reason": "Appears in changelog section :rocket: Enhancement"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"impact": "patch",
|
|
18
|
+
"reason": "Appears in changelog section :bug: Bug Fix"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"impact": "patch",
|
|
22
|
+
"reason": "Appears in changelog section :memo: Documentation"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"impact": "patch",
|
|
26
|
+
"reason": "Appears in changelog section :house: Internal"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"pkgJSONPath": "./package.json"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"description": "## Release (2025-03-07)\n\nember-try 4.0.0 (major)\n\n#### :boom: Breaking Change\n* `ember-try`\n * [#1037](https://github.com/ember-cli/ember-try/pull/1037) Remove passing an ember-cli `project` instance to the config function ([@bertdeblock](https://github.com/bertdeblock))\n * [#994](https://github.com/ember-cli/ember-try/pull/994) pnpm: Ignore scripts by default ([@NullVoxPopuli](https://github.com/NullVoxPopuli))\n * [#968](https://github.com/ember-cli/ember-try/pull/968) Update Node support (drop v16, test against v20 and v21) ([@bertdeblock](https://github.com/bertdeblock))\n * [#965](https://github.com/ember-cli/ember-try/pull/965) Use the system's temp folder for backing up package-manager files ([@bertdeblock](https://github.com/bertdeblock))\n * [#964](https://github.com/ember-cli/ember-try/pull/964) Drop support for npm v4 ([@bertdeblock](https://github.com/bertdeblock))\n * [#962](https://github.com/ember-cli/ember-try/pull/962) Stop backing up the `node_modules` folder ([@bertdeblock](https://github.com/bertdeblock))\n\n#### :rocket: Enhancement\n* `ember-try`\n * [#1025](https://github.com/ember-cli/ember-try/pull/1025) Support a `packageManager` option (instead of `usePnpm` and `useYarn`) ([@bertdeblock](https://github.com/bertdeblock))\n * [#965](https://github.com/ember-cli/ember-try/pull/965) Use the system's temp folder for backing up package-manager files ([@bertdeblock](https://github.com/bertdeblock))\n\n#### :bug: Bug Fix\n* `ember-try`\n * [#1024](https://github.com/ember-cli/ember-try/pull/1024) Update all dependencies with non-breaking changes ([@bertdeblock](https://github.com/bertdeblock))\n * [#966](https://github.com/ember-cli/ember-try/pull/966) Enforce resolution-mode=highest for pnpm versions 8.0.0 to 8.6.* ([@lolmaus](https://github.com/lolmaus))\n * [#962](https://github.com/ember-cli/ember-try/pull/962) Stop backing up the `node_modules` folder ([@bertdeblock](https://github.com/bertdeblock))\n\n#### :memo: Documentation\n* `ember-try`\n * [#807](https://github.com/ember-cli/ember-try/pull/807) Use scenario names available in default `addon` blueprint ([@jelhan](https://github.com/jelhan))\n\n#### :house: Internal\n* `ember-try`\n * [#1088](https://github.com/ember-cli/ember-try/pull/1088) Update release-plan actions, workflows via create-release-plan-setup ([@kategengler](https://github.com/kategengler))\n * [#1085](https://github.com/ember-cli/ember-try/pull/1085) Update release-plan workflows. ([@kategengler](https://github.com/kategengler))\n * [#1036](https://github.com/ember-cli/ember-try/pull/1036) Don't use ember-cli `project` instance outside of ember-cli commands ([@bertdeblock](https://github.com/bertdeblock))\n * [#1048](https://github.com/ember-cli/ember-try/pull/1048) Use `pnpm` for running scripts ([@bertdeblock](https://github.com/bertdeblock))\n * [#1050](https://github.com/ember-cli/ember-try/pull/1050) use package.json pnpm version for release-plan ([@mansona](https://github.com/mansona))\n * [#1039](https://github.com/ember-cli/ember-try/pull/1039) Start using release-plan ([@mansona](https://github.com/mansona))\n * [#1049](https://github.com/ember-cli/ember-try/pull/1049) Pin `pnpm` version ([@bertdeblock](https://github.com/bertdeblock))\n * [#1038](https://github.com/ember-cli/ember-try/pull/1038) Switch to pnpm ([@mansona](https://github.com/mansona))\n * [#1035](https://github.com/ember-cli/ember-try/pull/1035) Remove custom `findByName` util ([@bertdeblock](https://github.com/bertdeblock))\n * [#1034](https://github.com/ember-cli/ember-try/pull/1034) Migrate test suite to ES modules ([@bertdeblock](https://github.com/bertdeblock))\n * [#1030](https://github.com/ember-cli/ember-try/pull/1030) Remove use of ember-cli `ui` instance ([@bertdeblock](https://github.com/bertdeblock))\n * [#1029](https://github.com/ember-cli/ember-try/pull/1029) Remove use of `mockery` ([@bertdeblock](https://github.com/bertdeblock))\n * [#1028](https://github.com/ember-cli/ember-try/pull/1028) Remove some unused files ([@bertdeblock](https://github.com/bertdeblock))\n * [#1026](https://github.com/ember-cli/ember-try/pull/1026) Use a completely separate adapter for yarn ([@bertdeblock](https://github.com/bertdeblock))\n * [#1027](https://github.com/ember-cli/ember-try/pull/1027) Update lint setup ([@bertdeblock](https://github.com/bertdeblock))\n * [#1022](https://github.com/ember-cli/ember-try/pull/1022) Use only one ESLint config file ([@bertdeblock](https://github.com/bertdeblock))\n * [#1023](https://github.com/ember-cli/ember-try/pull/1023) Use `ember version` command to make test output more readable ([@bertdeblock](https://github.com/bertdeblock))\n * [#1021](https://github.com/ember-cli/ember-try/pull/1021) Remove use of `rsvp` ([@bertdeblock](https://github.com/bertdeblock))\n * [#1020](https://github.com/ember-cli/ember-try/pull/1020) Remove use of `core-object` for adapters ([@bertdeblock](https://github.com/bertdeblock))\n * [#1000](https://github.com/ember-cli/ember-try/pull/1000) Remove use of `core-object` for utils ([@bertdeblock](https://github.com/bertdeblock))\n * [#999](https://github.com/ember-cli/ember-try/pull/999) Remove use of `core-object` for tasks ([@bertdeblock](https://github.com/bertdeblock))\n * [#1001](https://github.com/ember-cli/ember-try/pull/1001) Update ESLint config to properly support native classes ([@bertdeblock](https://github.com/bertdeblock))\n * [#1002](https://github.com/ember-cli/ember-try/pull/1002) Clean up everything related to Bower ([@bertdeblock](https://github.com/bertdeblock))\n * [#969](https://github.com/ember-cli/ember-try/pull/969) Update development dependencies ([@bertdeblock](https://github.com/bertdeblock))\n * [#972](https://github.com/ember-cli/ember-try/pull/972) Update branch name and remove Appveyor badge from README -- it is no longer used ([@kategengler](https://github.com/kategengler))\n * [#971](https://github.com/ember-cli/ember-try/pull/971) Update CodeCov upload ([@kategengler](https://github.com/kategengler))\n * [#963](https://github.com/ember-cli/ember-try/pull/963) Add test to verify original node modules are installed again ([@bertdeblock](https://github.com/bertdeblock))\n\n#### Committers: 6\n- Andrey Mikhaylov (lolmaus) ([@lolmaus](https://github.com/lolmaus))\n- Bert De Block ([@bertdeblock](https://github.com/bertdeblock))\n- Chris Manson ([@mansona](https://github.com/mansona))\n- Jeldrik Hanschke ([@jelhan](https://github.com/jelhan))\n- Katie Gengler ([@kategengler](https://github.com/kategengler))\n- [@NullVoxPopuli](https://github.com/NullVoxPopuli)\n"
|
|
33
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,95 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Release (2025-03-07)
|
|
4
|
+
|
|
5
|
+
ember-try 4.0.0 (major)
|
|
6
|
+
|
|
7
|
+
#### :boom: Breaking Change
|
|
8
|
+
* `ember-try`
|
|
9
|
+
* [#1037](https://github.com/ember-cli/ember-try/pull/1037) Remove passing an ember-cli `project` instance to the config function ([@bertdeblock](https://github.com/bertdeblock))
|
|
10
|
+
* [#994](https://github.com/ember-cli/ember-try/pull/994) pnpm: Ignore scripts by default ([@NullVoxPopuli](https://github.com/NullVoxPopuli))
|
|
11
|
+
* [#968](https://github.com/ember-cli/ember-try/pull/968) Update Node support (drop v16, test against v20 and v21) ([@bertdeblock](https://github.com/bertdeblock))
|
|
12
|
+
* [#965](https://github.com/ember-cli/ember-try/pull/965) Use the system's temp folder for backing up package-manager files ([@bertdeblock](https://github.com/bertdeblock))
|
|
13
|
+
* [#964](https://github.com/ember-cli/ember-try/pull/964) Drop support for npm v4 ([@bertdeblock](https://github.com/bertdeblock))
|
|
14
|
+
* [#962](https://github.com/ember-cli/ember-try/pull/962) Stop backing up the `node_modules` folder ([@bertdeblock](https://github.com/bertdeblock))
|
|
15
|
+
|
|
16
|
+
#### :rocket: Enhancement
|
|
17
|
+
* `ember-try`
|
|
18
|
+
* [#1025](https://github.com/ember-cli/ember-try/pull/1025) Support a `packageManager` option (instead of `usePnpm` and `useYarn`) ([@bertdeblock](https://github.com/bertdeblock))
|
|
19
|
+
* [#965](https://github.com/ember-cli/ember-try/pull/965) Use the system's temp folder for backing up package-manager files ([@bertdeblock](https://github.com/bertdeblock))
|
|
20
|
+
|
|
21
|
+
#### :bug: Bug Fix
|
|
22
|
+
* `ember-try`
|
|
23
|
+
* [#1024](https://github.com/ember-cli/ember-try/pull/1024) Update all dependencies with non-breaking changes ([@bertdeblock](https://github.com/bertdeblock))
|
|
24
|
+
* [#966](https://github.com/ember-cli/ember-try/pull/966) Enforce resolution-mode=highest for pnpm versions 8.0.0 to 8.6.* ([@lolmaus](https://github.com/lolmaus))
|
|
25
|
+
* [#962](https://github.com/ember-cli/ember-try/pull/962) Stop backing up the `node_modules` folder ([@bertdeblock](https://github.com/bertdeblock))
|
|
26
|
+
|
|
27
|
+
#### :memo: Documentation
|
|
28
|
+
* `ember-try`
|
|
29
|
+
* [#807](https://github.com/ember-cli/ember-try/pull/807) Use scenario names available in default `addon` blueprint ([@jelhan](https://github.com/jelhan))
|
|
30
|
+
|
|
31
|
+
#### :house: Internal
|
|
32
|
+
* `ember-try`
|
|
33
|
+
* [#1088](https://github.com/ember-cli/ember-try/pull/1088) Update release-plan actions, workflows via create-release-plan-setup ([@kategengler](https://github.com/kategengler))
|
|
34
|
+
* [#1085](https://github.com/ember-cli/ember-try/pull/1085) Update release-plan workflows. ([@kategengler](https://github.com/kategengler))
|
|
35
|
+
* [#1036](https://github.com/ember-cli/ember-try/pull/1036) Don't use ember-cli `project` instance outside of ember-cli commands ([@bertdeblock](https://github.com/bertdeblock))
|
|
36
|
+
* [#1048](https://github.com/ember-cli/ember-try/pull/1048) Use `pnpm` for running scripts ([@bertdeblock](https://github.com/bertdeblock))
|
|
37
|
+
* [#1050](https://github.com/ember-cli/ember-try/pull/1050) use package.json pnpm version for release-plan ([@mansona](https://github.com/mansona))
|
|
38
|
+
* [#1039](https://github.com/ember-cli/ember-try/pull/1039) Start using release-plan ([@mansona](https://github.com/mansona))
|
|
39
|
+
* [#1049](https://github.com/ember-cli/ember-try/pull/1049) Pin `pnpm` version ([@bertdeblock](https://github.com/bertdeblock))
|
|
40
|
+
* [#1038](https://github.com/ember-cli/ember-try/pull/1038) Switch to pnpm ([@mansona](https://github.com/mansona))
|
|
41
|
+
* [#1035](https://github.com/ember-cli/ember-try/pull/1035) Remove custom `findByName` util ([@bertdeblock](https://github.com/bertdeblock))
|
|
42
|
+
* [#1034](https://github.com/ember-cli/ember-try/pull/1034) Migrate test suite to ES modules ([@bertdeblock](https://github.com/bertdeblock))
|
|
43
|
+
* [#1030](https://github.com/ember-cli/ember-try/pull/1030) Remove use of ember-cli `ui` instance ([@bertdeblock](https://github.com/bertdeblock))
|
|
44
|
+
* [#1029](https://github.com/ember-cli/ember-try/pull/1029) Remove use of `mockery` ([@bertdeblock](https://github.com/bertdeblock))
|
|
45
|
+
* [#1028](https://github.com/ember-cli/ember-try/pull/1028) Remove some unused files ([@bertdeblock](https://github.com/bertdeblock))
|
|
46
|
+
* [#1026](https://github.com/ember-cli/ember-try/pull/1026) Use a completely separate adapter for yarn ([@bertdeblock](https://github.com/bertdeblock))
|
|
47
|
+
* [#1027](https://github.com/ember-cli/ember-try/pull/1027) Update lint setup ([@bertdeblock](https://github.com/bertdeblock))
|
|
48
|
+
* [#1022](https://github.com/ember-cli/ember-try/pull/1022) Use only one ESLint config file ([@bertdeblock](https://github.com/bertdeblock))
|
|
49
|
+
* [#1023](https://github.com/ember-cli/ember-try/pull/1023) Use `ember version` command to make test output more readable ([@bertdeblock](https://github.com/bertdeblock))
|
|
50
|
+
* [#1021](https://github.com/ember-cli/ember-try/pull/1021) Remove use of `rsvp` ([@bertdeblock](https://github.com/bertdeblock))
|
|
51
|
+
* [#1020](https://github.com/ember-cli/ember-try/pull/1020) Remove use of `core-object` for adapters ([@bertdeblock](https://github.com/bertdeblock))
|
|
52
|
+
* [#1000](https://github.com/ember-cli/ember-try/pull/1000) Remove use of `core-object` for utils ([@bertdeblock](https://github.com/bertdeblock))
|
|
53
|
+
* [#999](https://github.com/ember-cli/ember-try/pull/999) Remove use of `core-object` for tasks ([@bertdeblock](https://github.com/bertdeblock))
|
|
54
|
+
* [#1001](https://github.com/ember-cli/ember-try/pull/1001) Update ESLint config to properly support native classes ([@bertdeblock](https://github.com/bertdeblock))
|
|
55
|
+
* [#1002](https://github.com/ember-cli/ember-try/pull/1002) Clean up everything related to Bower ([@bertdeblock](https://github.com/bertdeblock))
|
|
56
|
+
* [#969](https://github.com/ember-cli/ember-try/pull/969) Update development dependencies ([@bertdeblock](https://github.com/bertdeblock))
|
|
57
|
+
* [#972](https://github.com/ember-cli/ember-try/pull/972) Update branch name and remove Appveyor badge from README -- it is no longer used ([@kategengler](https://github.com/kategengler))
|
|
58
|
+
* [#971](https://github.com/ember-cli/ember-try/pull/971) Update CodeCov upload ([@kategengler](https://github.com/kategengler))
|
|
59
|
+
* [#963](https://github.com/ember-cli/ember-try/pull/963) Add test to verify original node modules are installed again ([@bertdeblock](https://github.com/bertdeblock))
|
|
60
|
+
|
|
61
|
+
#### Committers: 6
|
|
62
|
+
- Andrey Mikhaylov (lolmaus) ([@lolmaus](https://github.com/lolmaus))
|
|
63
|
+
- Bert De Block ([@bertdeblock](https://github.com/bertdeblock))
|
|
64
|
+
- Chris Manson ([@mansona](https://github.com/mansona))
|
|
65
|
+
- Jeldrik Hanschke ([@jelhan](https://github.com/jelhan))
|
|
66
|
+
- Katie Gengler ([@kategengler](https://github.com/kategengler))
|
|
67
|
+
- [@NullVoxPopuli](https://github.com/NullVoxPopuli)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
## v3.0.0 (2023-08-16)
|
|
72
|
+
|
|
73
|
+
#### :boom: Breaking Change
|
|
74
|
+
* [#920](https://github.com/ember-cli/ember-try/pull/920) Drop Node.js 14 support ([@SergeAstapov](https://github.com/SergeAstapov))
|
|
75
|
+
|
|
76
|
+
#### :rocket: Enhancement
|
|
77
|
+
* [#960](https://github.com/ember-cli/ember-try/pull/960) Use pnpm's --no-lockfile ([@NullVoxPopuli](https://github.com/NullVoxPopuli))
|
|
78
|
+
* [#956](https://github.com/ember-cli/ember-try/pull/956) Remove warning about pnpm ([@NullVoxPopuli](https://github.com/NullVoxPopuli))
|
|
79
|
+
* [#850](https://github.com/ember-cli/ember-try/pull/850) Add support for npm overrides ([@mansona](https://github.com/mansona))
|
|
80
|
+
|
|
81
|
+
#### :memo: Documentation
|
|
82
|
+
* [#957](https://github.com/ember-cli/ember-try/pull/957) Document pnpm options and behavior ([@NullVoxPopuli](https://github.com/NullVoxPopuli))
|
|
83
|
+
|
|
84
|
+
#### :house: Internal
|
|
85
|
+
* [#934](https://github.com/ember-cli/ember-try/pull/934) Update github CI yaml ([@mansona](https://github.com/mansona))
|
|
86
|
+
* [#933](https://github.com/ember-cli/ember-try/pull/933) Update smoke test to fix CI ([@mansona](https://github.com/mansona))
|
|
87
|
+
* [#893](https://github.com/ember-cli/ember-try/pull/893) update smoke-test-app to fix CI ([@mansona](https://github.com/mansona))
|
|
88
|
+
|
|
89
|
+
#### Committers: 3
|
|
90
|
+
- Chris Manson ([@mansona](https://github.com/mansona))
|
|
91
|
+
- Sergey Astapov ([@SergeAstapov](https://github.com/SergeAstapov))
|
|
92
|
+
- [@NullVoxPopuli](https://github.com/NullVoxPopuli)
|
|
3
93
|
|
|
4
94
|
## v3.0.0-beta.1 (2023-03-01)
|
|
5
95
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ember-try
|
|
2
2
|
|
|
3
|
-
[](https://badge.fury.io/js/ember-try) [](https://github.com/ember-cli/ember-try/actions/workflows/ci.yml?query=branch%
|
|
3
|
+
[](https://badge.fury.io/js/ember-try) [](https://github.com/ember-cli/ember-try/actions/workflows/ci.yml?query=branch%3Amain) [](http://emberobserver.com/addons/ember-try) [](https://codeclimate.com/github/ember-cli/ember-try) [](https://codecov.io/gh/ember-cli/ember-try)
|
|
4
4
|
|
|
5
5
|
An ember-cli addon to test against multiple dependencies, such as `ember` and `ember-data`.
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ ember install ember-try
|
|
|
14
14
|
|
|
15
15
|
This addon provides a few commands:
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
#### `ember try:each`
|
|
18
18
|
|
|
19
19
|
This command will run `ember test` or the configured command with each scenario's specified in the config and exit appropriately.
|
|
20
20
|
|
|
@@ -37,31 +37,31 @@ This command will run any `ember-cli` command with the specified scenario. The c
|
|
|
37
37
|
For example:
|
|
38
38
|
|
|
39
39
|
```
|
|
40
|
-
ember try:one ember-
|
|
40
|
+
ember try:one ember-beta --- ember test --reporter xunit
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
or
|
|
44
44
|
|
|
45
45
|
```
|
|
46
|
-
ember try:one ember-
|
|
46
|
+
ember try:one ember-beta --- ember serve
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
When running in a CI environment where changes are discarded you can skip resetting your environment back to its original state by specifying --skip-cleanup=true as an option to ember try.
|
|
50
|
-
|
|
50
|
+
_Warning: If you use this option and, without cleaning up, build and deploy as the result of a passing test suite, it will build with the last set of dependencies ember try was run with._
|
|
51
51
|
|
|
52
52
|
```
|
|
53
|
-
ember try:one ember-
|
|
53
|
+
ember try:one ember-beta --skip-cleanup=true --- ember test
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
In order to use an alternate config path or to group various scenarios, you can use the `--config-path` option.
|
|
57
57
|
|
|
58
58
|
```
|
|
59
|
-
ember try:one ember-
|
|
59
|
+
ember try:one ember-beta --config-path="config/legacy-scenarios.js"
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
#### `ember try:reset`
|
|
63
63
|
|
|
64
|
-
This command restores
|
|
64
|
+
This command restores all original files, and installs the original node modules again. For use if any of the other commands fail to clean up after (they run this by default on completion) or after running with ‘—skip-cleanup’.
|
|
65
65
|
|
|
66
66
|
#### `ember try:ember <semver-string>`
|
|
67
67
|
|
|
@@ -74,6 +74,7 @@ Displays the configuration that will be used. Also takes an optional `--config-p
|
|
|
74
74
|
### Config
|
|
75
75
|
|
|
76
76
|
##### versionCompatibility
|
|
77
|
+
|
|
77
78
|
If you're using `ember-try` with an Ember addon, there is a short cut to test many Ember versions. In your `package.json` under the `ember-addon` key, add the following:
|
|
78
79
|
|
|
79
80
|
```json
|
|
@@ -109,17 +110,17 @@ module.exports = async function() {
|
|
|
109
110
|
/*
|
|
110
111
|
`npmOptions` - options to be passed to `npm`.
|
|
111
112
|
*/
|
|
112
|
-
npmOptions: ['--loglevel=silent'
|
|
113
|
+
npmOptions: ['--loglevel=silent'],
|
|
113
114
|
/*
|
|
114
115
|
If set to true, the `versionCompatibility` key under `ember-addon` in `package.json` will be used to
|
|
115
116
|
automatically generate scenarios that will deep merge with any in this configuration file.
|
|
116
117
|
*/
|
|
117
118
|
useVersionCompatibility: true,
|
|
118
119
|
/*
|
|
119
|
-
|
|
120
|
-
dependencies will be restored to their prior state.
|
|
120
|
+
The package manager to use for all scenarios. By default, lockfiles will be ignored when installing dependencies.
|
|
121
|
+
At cleanup, all dependencies will be restored to their prior state.
|
|
121
122
|
*/
|
|
122
|
-
|
|
123
|
+
packageManager: 'npm' | 'pnpm' | 'yarn',
|
|
123
124
|
|
|
124
125
|
/*
|
|
125
126
|
buildManagerOptions allows you to opt-out of the default options such as `--ignore-engines --no-lockfile`.
|
|
@@ -144,7 +145,15 @@ module.exports = async function() {
|
|
|
144
145
|
'ember-source': '2.11.0'
|
|
145
146
|
},
|
|
146
147
|
/*
|
|
147
|
-
|
|
148
|
+
You can optionally define npm or pnpm overrides to enforce a specific dependency version
|
|
149
|
+
to be installed. This is useful if other libraries you depend on include different
|
|
150
|
+
versions of a package. This does nothing if `packageManager` is `yarn`;
|
|
151
|
+
*/
|
|
152
|
+
overrides: {
|
|
153
|
+
'lodash': '5.0.0'
|
|
154
|
+
}
|
|
155
|
+
/*
|
|
156
|
+
When `packageManager` is `yarn`, you can optionally define yarn resolutions to enforce a
|
|
148
157
|
specific dependency version to be installed. This is useful if other libraries
|
|
149
158
|
you depend on include different versions of a package.
|
|
150
159
|
*/
|
|
@@ -196,11 +205,19 @@ The `name` can be used to try just one scenario using the `ember try:one` comman
|
|
|
196
205
|
|
|
197
206
|
##### Yarn
|
|
198
207
|
|
|
199
|
-
If you include `
|
|
208
|
+
If you include `packageManager: 'yarn'` in your `ember-try` config, all npm scenarios will use `yarn` for install with the `--no-lockfile` option. At cleanup, your dependencies will be restored to their prior state.
|
|
209
|
+
|
|
210
|
+
##### Pnpm
|
|
211
|
+
|
|
212
|
+
If you include `packageManager: 'pnpm'` in your `ember-try` config, all npm scenarios will use `pnpm` for install with the `--no-lockfile` options. At cleanup, your dependencies will be restored to their prior state.
|
|
213
|
+
|
|
214
|
+
> ⚠ pnpm versions from 8.0.0 to 8.6.x have the default value of [resolution-mode](https://pnpm.io/npmrc#resolution-mode) setting changed to `lowest-direct`. This violates `ember-try` expectations as `resolution-mode` is expected to be `highest`, like in `npm` and `pnpm` versions < 8.0.0 and >= 8.7.0.
|
|
215
|
+
>
|
|
216
|
+
> If you run into this issue, we recommend to upgrade pnpm to latest version. If you are unable to upgrade, you can set `resolution-mode = highest` in the `.npmrc` file.
|
|
200
217
|
|
|
201
218
|
##### A note on npm scenarios with lockfiles
|
|
202
219
|
|
|
203
|
-
Lockfiles are ignored by `ember-try`. (`yarn` will run with `--no-lockfile` and `npm` will be run with `--no-
|
|
220
|
+
Lockfiles are ignored by `ember-try`. (`yarn` will run with `--no-lockfile` and `npm` will be run with `--no-package-lock` and `pnpm` will be run with `--no-lockfile`).
|
|
204
221
|
When testing various scenarios, it's important to "float" dependencies so that the scenarios are run with the latest satisfying versions of dependencies a user of the project would get.
|
|
205
222
|
|
|
206
223
|
##### Workspaces
|
|
@@ -210,6 +227,7 @@ in `package.json`, allowing you to try scenarios in monorepo style repositories.
|
|
|
210
227
|
[Yarn's documentation of workspaces](https://yarnpkg.com/lang/en/docs/workspaces/) for more details.
|
|
211
228
|
|
|
212
229
|
### Video
|
|
230
|
+
|
|
213
231
|
[](https://vimeo.com/157688157)
|
|
214
232
|
|
|
215
233
|
See an example of using `ember-try` for CI [here](https://github.com/kategengler/ember-feature-flags/commit/aaf0226975c76630c875cf6b923fdc23b025aa79), and the resulting build [output](https://travis-ci.org/kategengler/ember-feature-flags/builds/55597086).
|
|
@@ -218,7 +236,6 @@ See an example of using `ember-try` for CI [here](https://github.com/kategengler
|
|
|
218
236
|
|
|
219
237
|
- Much credit is due to [Edward Faulkner](https://github.com/ef4) The scripts in [liquid-fire](https://github.com/ef4/liquid-fire) that test against multiple ember versions were the inspiration for this project.
|
|
220
238
|
|
|
221
|
-
|
|
222
239
|
### Developing
|
|
223
240
|
|
|
224
241
|
- Be sure to run `npm link` and `npm link ember-try`, otherwise any `ember try` commands you run will use the version of ember-try included by ember-cli itself.
|
package/lib/commands/config.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const debug = require('debug')('ember-try:commands:config');
|
|
4
|
+
const { log } = require('../utils/console');
|
|
4
5
|
|
|
5
6
|
module.exports = {
|
|
6
7
|
name: 'try:config',
|
|
@@ -11,11 +12,12 @@ module.exports = {
|
|
|
11
12
|
async run(commandOptions) {
|
|
12
13
|
debug('Options:\n', commandOptions);
|
|
13
14
|
|
|
15
|
+
let cwd = this.project.root;
|
|
14
16
|
let config = await require('../utils/config')({
|
|
15
|
-
project: this.project,
|
|
16
17
|
configPath: commandOptions.configPath,
|
|
18
|
+
cwd,
|
|
17
19
|
});
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
log(JSON.stringify(config, null, 2));
|
|
20
22
|
},
|
|
21
23
|
};
|
package/lib/commands/reset.js
CHANGED
|
@@ -6,13 +6,13 @@ module.exports = {
|
|
|
6
6
|
works: 'insideProject',
|
|
7
7
|
|
|
8
8
|
async run() {
|
|
9
|
-
let
|
|
9
|
+
let cwd = this.project.root;
|
|
10
|
+
let config = await require('../utils/config')({ cwd });
|
|
10
11
|
let ResetTask = require('../tasks/reset');
|
|
11
12
|
|
|
12
13
|
let resetTask = new ResetTask({
|
|
13
|
-
ui: this.ui,
|
|
14
|
-
project: this.project,
|
|
15
14
|
config,
|
|
15
|
+
cwd,
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
return await resetTask.run();
|
package/lib/commands/try-each.js
CHANGED
|
@@ -18,17 +18,17 @@ module.exports = {
|
|
|
18
18
|
async run(commandOptions) {
|
|
19
19
|
debug('Options:\n', commandOptions);
|
|
20
20
|
|
|
21
|
+
let cwd = this.project.root;
|
|
21
22
|
let config = await this._getConfig({
|
|
22
|
-
project: this.project,
|
|
23
23
|
configPath: commandOptions.configPath,
|
|
24
|
+
cwd,
|
|
24
25
|
});
|
|
25
26
|
|
|
26
27
|
debug('Config: %s', JSON.stringify(config));
|
|
27
28
|
|
|
28
29
|
let tryEachTask = new this._TryEachTask({
|
|
29
|
-
ui: this.ui,
|
|
30
|
-
project: this.project,
|
|
31
30
|
config,
|
|
31
|
+
cwd,
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
return await tryEachTask.run(config.scenarios, { skipCleanup: commandOptions.skipCleanup });
|
|
@@ -24,9 +24,10 @@ module.exports = {
|
|
|
24
24
|
debug('Options:\n', commandOptions);
|
|
25
25
|
debug('Ember semver statement', emberVersion);
|
|
26
26
|
|
|
27
|
+
let cwd = this.project.root;
|
|
27
28
|
let config = await this._getConfig({
|
|
28
|
-
project: this.project,
|
|
29
29
|
configPath: commandOptions.configPath,
|
|
30
|
+
cwd,
|
|
30
31
|
versionCompatibility: {
|
|
31
32
|
ember: emberVersion,
|
|
32
33
|
},
|
|
@@ -35,9 +36,8 @@ module.exports = {
|
|
|
35
36
|
debug('Config: %s', JSON.stringify(config));
|
|
36
37
|
|
|
37
38
|
let tryEachTask = new this._TryEachTask({
|
|
38
|
-
ui: this.ui,
|
|
39
|
-
project: this.project,
|
|
40
39
|
config,
|
|
40
|
+
cwd,
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
return await tryEachTask.run(config.scenarios, { skipCleanup: commandOptions.skipCleanup });
|
package/lib/commands/try-one.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const findByName = require('../utils/find-by-name');
|
|
4
3
|
const debug = require('debug')('ember-try:commands:try-one');
|
|
5
4
|
|
|
6
5
|
module.exports = {
|
|
@@ -43,25 +42,25 @@ module.exports = {
|
|
|
43
42
|
throw new Error('The `ember try:one` command requires a ' + 'scenario name to be specified.');
|
|
44
43
|
}
|
|
45
44
|
|
|
45
|
+
let cwd = this.project.root;
|
|
46
46
|
let config = await this._getConfig({
|
|
47
|
-
project: this.project,
|
|
48
47
|
configPath: commandOptions.configPath,
|
|
48
|
+
cwd,
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
debug('Config: %s', JSON.stringify(config));
|
|
52
52
|
|
|
53
|
-
let scenario =
|
|
53
|
+
let scenario = config.scenarios.find((s) => s.name === scenarioName);
|
|
54
54
|
if (!scenario) {
|
|
55
55
|
throw new Error(
|
|
56
|
-
'The `ember try:one` command requires a scenario ' + 'specified in the config.'
|
|
56
|
+
'The `ember try:one` command requires a scenario ' + 'specified in the config.',
|
|
57
57
|
);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
let tryEachTask = new this._TryEachTask({
|
|
61
|
-
ui: this.ui,
|
|
62
|
-
project: this.project,
|
|
63
|
-
config,
|
|
64
61
|
commandArgs,
|
|
62
|
+
config,
|
|
63
|
+
cwd,
|
|
65
64
|
});
|
|
66
65
|
|
|
67
66
|
return await tryEachTask.run([scenario], { skipCleanup: commandOptions.skipCleanup });
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const debug = require('debug');
|
|
4
|
+
const { get, set } = require('es-toolkit/compat');
|
|
5
|
+
const fs = require('fs-extra');
|
|
6
|
+
const path = require('node:path');
|
|
7
|
+
const semver = require('semver');
|
|
8
|
+
const Backup = require('../utils/backup');
|
|
9
|
+
const { warn } = require('../utils/console');
|
|
10
|
+
const { LOCKFILE, PACKAGE_JSON } = require('../utils/package-managers');
|
|
11
|
+
|
|
12
|
+
class BaseAdapter {
|
|
13
|
+
configKey = 'npm';
|
|
14
|
+
defaultInstallOptions = [];
|
|
15
|
+
lockfile = '';
|
|
16
|
+
name = '';
|
|
17
|
+
overridesKey = '';
|
|
18
|
+
|
|
19
|
+
backup = null;
|
|
20
|
+
debugFunction = null;
|
|
21
|
+
|
|
22
|
+
constructor(options) {
|
|
23
|
+
this.backup = new Backup({ cwd: options.cwd });
|
|
24
|
+
this.buildManagerOptions = options.buildManagerOptions;
|
|
25
|
+
this.cwd = options.cwd;
|
|
26
|
+
this.managerOptions = options.managerOptions;
|
|
27
|
+
this.run = options.run ?? require('../utils/run');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
debug(...args) {
|
|
31
|
+
if (this.debugFunction === null) {
|
|
32
|
+
this.debugFunction = debug(`ember-try:dependency-manager-adapter:${this.name}`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
this.debugFunction(...args);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async setup() {
|
|
39
|
+
this._checkForDifferentLockfiles();
|
|
40
|
+
|
|
41
|
+
await this.backup.addFiles([PACKAGE_JSON, this.lockfile]);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async changeToDependencySet(dependencySet) {
|
|
45
|
+
await this.applyDependencySet(dependencySet);
|
|
46
|
+
await this._install(dependencySet);
|
|
47
|
+
|
|
48
|
+
const dependencies = {
|
|
49
|
+
...dependencySet.dependencies,
|
|
50
|
+
...dependencySet.devDependencies,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const currentDependencies = Object.keys(dependencies).map((name) => ({
|
|
54
|
+
name,
|
|
55
|
+
packageManager: this.name,
|
|
56
|
+
versionExpected: dependencies[name],
|
|
57
|
+
versionSeen: this._findCurrentVersionOf(name),
|
|
58
|
+
}));
|
|
59
|
+
|
|
60
|
+
this.debug('Switched to dependencies: \n', currentDependencies);
|
|
61
|
+
|
|
62
|
+
return currentDependencies;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async applyDependencySet(dependencySet) {
|
|
66
|
+
if (dependencySet === undefined) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
this.debug('Changing to dependency set: %s', JSON.stringify(dependencySet));
|
|
71
|
+
|
|
72
|
+
const oldPackageJSON = JSON.parse(fs.readFileSync(this.backup.pathForFile(PACKAGE_JSON)));
|
|
73
|
+
const newPackageJSON = this._packageJSONForDependencySet(oldPackageJSON, dependencySet);
|
|
74
|
+
|
|
75
|
+
this.debug('Write package.json with: \n', JSON.stringify(newPackageJSON));
|
|
76
|
+
|
|
77
|
+
fs.writeFileSync(path.join(this.cwd, PACKAGE_JSON), JSON.stringify(newPackageJSON, null, 2));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async cleanup() {
|
|
81
|
+
try {
|
|
82
|
+
await this.backup.restoreFiles([PACKAGE_JSON, this.lockfile]);
|
|
83
|
+
await this.backup.cleanUp();
|
|
84
|
+
await this._install();
|
|
85
|
+
} catch (error) {
|
|
86
|
+
console.error('Error cleaning up scenario:', error);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
_checkForDifferentLockfiles() {
|
|
91
|
+
for (const packageManager in LOCKFILE) {
|
|
92
|
+
const lockfile = LOCKFILE[packageManager];
|
|
93
|
+
|
|
94
|
+
if (lockfile === this.lockfile) {
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
try {
|
|
99
|
+
if (fs.statSync(path.join(this.cwd, lockfile)).isFile()) {
|
|
100
|
+
warn(
|
|
101
|
+
`Detected a \`${lockfile}\` file. Add \`packageManager: '${packageManager}'\` to your \`config/ember-try.js\` configuration file if you want to use ${packageManager} to install dependencies.`,
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
} catch {
|
|
105
|
+
// Move along.
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
_findCurrentVersionOf(name) {
|
|
111
|
+
const filename = path.join(this.cwd, 'node_modules', name, PACKAGE_JSON);
|
|
112
|
+
|
|
113
|
+
if (fs.existsSync(filename)) {
|
|
114
|
+
return JSON.parse(fs.readFileSync(filename)).version;
|
|
115
|
+
} else {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
async _install(dependencySet) {
|
|
121
|
+
let managerOptions = this.managerOptions || [];
|
|
122
|
+
|
|
123
|
+
if (typeof this.buildManagerOptions === 'function') {
|
|
124
|
+
managerOptions = this.buildManagerOptions(dependencySet);
|
|
125
|
+
|
|
126
|
+
if (Array.isArray(managerOptions) === false) {
|
|
127
|
+
throw new Error('buildManagerOptions must return an array of options');
|
|
128
|
+
}
|
|
129
|
+
} else if (this.defaultInstallOptions.length) {
|
|
130
|
+
for (const option of this.defaultInstallOptions) {
|
|
131
|
+
if (managerOptions.includes(option) === false) {
|
|
132
|
+
managerOptions.push(option);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
this.debug(`Running ${this.name} install with options %s`, managerOptions);
|
|
138
|
+
|
|
139
|
+
await this.run(this.name, ['install', ...managerOptions], { cwd: this.cwd });
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
_packageJSONForDependencySet(packageJSON, dependencySet) {
|
|
143
|
+
this._overridePackageJSONDependencies(packageJSON, dependencySet, 'dependencies');
|
|
144
|
+
this._overridePackageJSONDependencies(packageJSON, dependencySet, 'devDependencies');
|
|
145
|
+
this._overridePackageJSONDependencies(packageJSON, dependencySet, 'peerDependencies');
|
|
146
|
+
this._overridePackageJSONDependencies(packageJSON, dependencySet, 'ember');
|
|
147
|
+
this._overridePackageJSONDependencies(packageJSON, dependencySet, this.overridesKey);
|
|
148
|
+
|
|
149
|
+
return packageJSON;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
_overridePackageJSONDependencies(packageJSON, dependencySet, kindOfDependency) {
|
|
153
|
+
if (get(dependencySet, kindOfDependency) === undefined) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
let packageNames = Object.keys(get(dependencySet, kindOfDependency));
|
|
158
|
+
|
|
159
|
+
for (let packageName of packageNames) {
|
|
160
|
+
let version = get(dependencySet, `${kindOfDependency}.${packageName}`);
|
|
161
|
+
|
|
162
|
+
if (version === null) {
|
|
163
|
+
delete get(packageJSON, kindOfDependency)[packageName];
|
|
164
|
+
} else {
|
|
165
|
+
set(packageJSON, `${kindOfDependency}.${packageName}`, version);
|
|
166
|
+
|
|
167
|
+
if (semver.prerelease(version) || /^https*:\/\/.*\.tg*z/.test(version)) {
|
|
168
|
+
set(packageJSON, `${this.overridesKey}.${packageName}`, `$${packageName}`);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
module.exports = { BaseAdapter };
|