Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx committed Aug 26, 2024
1 parent f044c87 commit d8075ba
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/module-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export class Resolver {
return this.external('early require', request, request.specifier);
}

request = this.decodeEncodedReques(request);
request = this.decodeEncodedRequest(request);
request = this.handleFastbootSwitch(request);
request = await this.handleGlobalsCompat(request);
request = this.handleImplicitModules(request);
Expand Down Expand Up @@ -294,7 +294,7 @@ export class Resolver {
let prefix = '@embroider/encoded-request/';
if (request.specifier.startsWith(prefix)) {
let specifier = request.specifier.slice(prefix.length);
let [from, to] = specifier.split('-embroider-to-');
let [from, to] = specifier.split('/-embroider-to-/');
return request.alias(to).rehome(from);
}
return request;
Expand Down
3 changes: 0 additions & 3 deletions packages/vite/src/esbuild-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { EsBuildModuleRequest } from './esbuild-request';
import assertNever from 'assert-never';
import { hbsToJS } from '@embroider/core';
import { Preprocessor } from 'content-tag';
import { RollupModuleRequest } from './request';

const templateOnlyComponent =
`import templateOnly from '@ember/component/template-only';\n` + `export default templateOnly();\n`;
Expand Down Expand Up @@ -60,8 +59,6 @@ export function esBuildResolver(): EsBuildPlugin {
let pkgCache = resolverLoader.resolver.packageCache;
let fromPkg = pkgCache.ownerOfFile(request.fromFile);
let toPkg = pkgCache.ownerOfFile(resolution.filename);
console.log(path, importer);
console.log(toPkg?.isV2App(), fromPkg?.isV2App());
if (toPkg?.isV2App()) {
if (!fromPkg?.isV2App()) {
let encoded = resolverLoader.resolver.generateEncodedRequest(request);
Expand Down
6 changes: 3 additions & 3 deletions packages/vite/src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const virtualPrefix = 'embroider_virtual:';

export class RollupModuleRequest implements ModuleRequest {
static from(
context: PluginContext | null,
context: PluginContext,
source: string,
importer: string | undefined,
custom: Record<string, any> | undefined
Expand Down Expand Up @@ -46,7 +46,7 @@ export class RollupModuleRequest implements ModuleRequest {
}

private constructor(
private context: PluginContext | null,
private context: PluginContext,
readonly specifier: string,
readonly fromFile: string,
readonly meta: Record<string, any> | undefined,
Expand Down Expand Up @@ -152,7 +152,7 @@ export class RollupModuleRequest implements ModuleRequest {
(err as any).code = 'MODULE_NOT_FOUND';
return { type: 'not_found', err };
}
let result = await this.context?.resolve(this.specifierWithQueryParams, this.fromFileWithQueryParams, {
let result = await this.context.resolve(this.specifierWithQueryParams, this.fromFileWithQueryParams, {
skipSelf: true,
custom: {
embroider: {
Expand Down
2 changes: 1 addition & 1 deletion tests/scenarios/compat-stage2-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ stage2Scenarios
'hello-world.js': `
import Component from '@ember/component';
import layout from '../templates/components/hello-world';
import computed from '@ember/object';
import { computed } from '@ember/object';
import somethingExternal from 'not-a-resolvable-package';
export default Component.extend({
dynamicComponentName: computed('useDynamic', function() {
Expand Down
1 change: 0 additions & 1 deletion tests/scenarios/helpers/command-watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export default class CommandWatcher {

constructor(private process: ExecaChildProcess) {
process.all!.on('data', data => {
console.log(data.toString());
const lines = data.toString().split(/\r?\n/);
this.lines.push(...lines);
this.currentWaiter?.();
Expand Down

0 comments on commit d8075ba

Please sign in to comment.