Skip to content

Commit

Permalink
Merge pull request #454 from NullVoxPopuli/remove-ember-test-waiters
Browse files Browse the repository at this point in the history
Remove dual-package emit
  • Loading branch information
kategengler authored Oct 12, 2023
2 parents 337983f + 4668589 commit 9567956
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 136 deletions.
File renamed without changes.
16 changes: 0 additions & 16 deletions addon/ember-test-waiters/index.ts

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions addon/@ember/test-waiters/wait-for.ts → addon/wait-for.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type DecoratorArguments = [object, string, PropertyDescriptor, string?];
* @example
*
* import Component from '@ember/component';
* import { waitFor } from 'ember-test-waiters';
* import { waitFor } from '@ember/test-waiters';
*
* export default Component.extend({
* doAsyncStuff: waitFor(async function doAsyncStuff() {
Expand All @@ -39,7 +39,7 @@ type DecoratorArguments = [object, string, PropertyDescriptor, string?];
* @example
*
* import Component from '@ember/component';
* import { waitFor } from 'ember-test-waiters';
* import { waitFor } from '@ember/test-waiters';
*
* export default class Friendz extends Component {
* @waitFor
Expand All @@ -52,7 +52,7 @@ type DecoratorArguments = [object, string, PropertyDescriptor, string?];
*
* import Component from '@ember/component';
* import { task } from 'ember-concurrency';
* import { waitFor } from 'ember-test-waiters';
* import { waitFor } from '@ember/test-waiters';
*
* export default Component.extend({
* doTaskStuff: task(waitFor(function* doTaskStuff() {
Expand All @@ -64,7 +64,7 @@ type DecoratorArguments = [object, string, PropertyDescriptor, string?];
*
* import Component from '@ember/component';
* import { task } from 'ember-concurrency-decorators';
* import { waitFor } from 'ember-test-waiters';
* import { waitFor } from '@ember/test-waiters';
*
* export default class Friendz extends Component {
* @task
Expand Down
File renamed without changes.
58 changes: 0 additions & 58 deletions force-highlander-addon.js

This file was deleted.

39 changes: 0 additions & 39 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,5 @@
'use strict';

const calculateCacheKeyForTree = require('calculate-cache-key-for-tree');
const { forceHighlander } = require('./force-highlander-addon');

module.exports = {
name: require('./package').name,

/**
* Returns a stable cache key with the addon name appended
*
* Because this addon eventually forces highlander for both `@ember/test-waiters`
* and `ember-test-waiters` we need to append the addon's name here; the end result
* is that we get a different stable cache key, one for `@ember/test-waiters` and
* another for `ember-test-waiters`
*
* The reason for this is that Embroider doesn't currently take into account the addon's
* name when dealing with cache keys internally & as a result, it gets confused that
* (seemingly) two different addons have the same cache key. This will eventually be fixed
* in Embroider, but in the short-term we're implementing this here to account for this issue.
*
* @name cacheKeyForTree
* @param {string} treeType
* @returns {string} the stable cache key
*/
cacheKeyForTree(treeType) {
return `${calculateCacheKeyForTree(treeType, this)}-${this.name}`;
},

included() {
this._super.included.apply(this, arguments);
forceHighlander(this.project);
},

treeForAddon(tree) {
/*
We're intentionally not calling super here in order to correctly output
multiple modules (@ember/test-helpers and ember-test-helpers).
*/
let babel = this.addons.find((a) => a.name === 'ember-cli-babel');

return babel.transpileTree(tree);
},
};
13 changes: 6 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"Steve Calvert <steve.calvert@gmail.com>",
"Robert Jackson <me@rwjblue.com>"
],
"main": "addon/@ember/test-waiters/index.js",
"types": "index.d.ts",
"directories": {
"doc": "doc",
Expand All @@ -29,16 +28,16 @@
"prepack:addon": "babel --extensions '.ts' --presets @babel/preset-typescript addon --out-dir addon --ignore '**/*.d.ts'",
"postpack": "ember ts:clean",
"start": "ember serve",
"test": "npm-run-all lint \"test:!(ember-compatibility|prod)\"",
"test": "ember test",
"test:ember": "ember test",
"test:ember-compatibility": "ember try:each",
"test:prod": "ember test --environment=production"
},
"dependencies": {
"@glimmer/env": "^0.1.7",
"ember-auto-import": "^2.6.3",
"calculate-cache-key-for-tree": "^2.0.0",
"ember-cli-babel": "^7.26.6",
"ember-cli-typescript": "^4.2.1",
"ember-cli-typescript": "^5.0.0",
"ember-cli-version-checker": "^5.1.2",
"semver": "^7.3.5"
},
Expand All @@ -47,7 +46,6 @@
"@babel/preset-typescript": "^7.15.0",
"@ember/optional-features": "^2.0.0",
"@ember/string": "^3.0.1",
"@glimmer/env": "^0.1.7",
"@types/ember": "^3.16.5",
"@types/ember__test-helpers": "^2.6.1",
"@types/ember-test-helpers": "^1.0.10",
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/import-legacy-module-test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { _reset, buildWaiter } from 'ember-test-waiters';
import { _reset, buildWaiter } from '@ember/test-waiters';
import { module, test } from 'qunit';

import { resetError } from './utils/mock-stable-error';
Expand Down
8 changes: 2 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,8 @@
"paths": {
"dummy/tests/*": ["tests/*"],
"dummy/*": ["tests/dummy/app/*", "app/*"],
"ember-test-waiters": ["addon/ember-test-waiters"],
"ember-test-waiters/*": ["addon/ember-test-waiters/*"],
"@ember/test-waiters": ["addon/@ember/test-waiters"],
"@ember/test-waiters/*": ["addon/@ember/test-waiters/*"],
"ember-test-waiters/test-support": ["addon-test-support"],
"ember-test-waiters/test-support/*": ["addon-test-support/*"],
"@ember/test-waiters": ["addon"],
"@ember/test-waiters/*": ["addon/*"],
"*": ["types/*"]
}
},
Expand Down

0 comments on commit 9567956

Please sign in to comment.