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

undefined does not serialize with broccoli-babel-transpiler #886

Merged
merged 2 commits into from
Jul 2, 2021
Merged
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
2 changes: 1 addition & 1 deletion packages/macros/src/babel/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default interface State {
// the package root directory of the app, if the app is under active
// development. Needed so that we can get consistent answers to
// `isDevelopingApp` and `isDeveopingThisPackage`
appPackageRoot: string | undefined;
appPackageRoot: string;

embroiderMacrosConfigMarker: true;

Expand Down
2 changes: 1 addition & 1 deletion packages/macros/src/macros-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export default class MacrosConfig {
owningPackageRoot,

isDevelopingPackageRoots: [...this.isDevelopingPackageRoots].map(root => this.moves.get(root) || root),
appPackageRoot: this.appPackageRoot ? this.moves.get(this.appPackageRoot) || this.appPackageRoot : undefined,
appPackageRoot: this.appPackageRoot ? this.moves.get(this.appPackageRoot) || this.appPackageRoot : '',

// This is used as a signature so we can detect ourself among the plugins
// emitted from v1 addons.
Expand Down
1 change: 1 addition & 0 deletions tests/app-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"scripts": {
"build": "ember build",
"build:production": "ember build -prod",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
"lint:hbs": "ember-template-lint .",
Expand Down
5 changes: 5 additions & 0 deletions tests/scenarios/macro-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ appScenarios
assert.equal(result.exitCode, 0, result.output);
});

test(`yarn build production`, async function (assert) {
let result = await app.execute(`cross-env THROW_UNLESS_PARALLELIZABLE=1 yarn build:production`);
assert.equal(result.exitCode, 0, result.output);
});

test(`CLASSIC=true yarn test`, async function (assert) {
// throw_unless_parallelizable is enabled to ensure that @embroider/macros is parallelizable
let result = await app.execute(`cross-env THROW_UNLESS_PARALLELIZABLE=1 CLASSIC=true yarn test`);
Expand Down