Skip to content

Commit 8b734f5

Browse files
committed
chore: upgrade deps
1 parent 8b066b8 commit 8b734f5

File tree

14 files changed

+74
-239
lines changed

14 files changed

+74
-239
lines changed

client/gulpfile.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ const drWorker = dumber({
128128
{name: 'punycode', main: 'punycode.js', lazyMain: true},
129129
// Dumber has not supported package.json exports yet
130130
{name: 'locate-character', main: 'src/index.js'},
131-
{name: 'code-red', main: 'src/index.js'},
132131
],
133132
append: [
134133
isTest ?

client/src-worker/dumber-session.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ export class DumberSession {
205205
// console.log(`[dumber] `);
206206

207207
const isAurelia1 = _.some(deps, {name: 'aurelia-bootstrapper'});
208+
// package "esm-env" uses "exports" in package.json that dumber is yet to support.
209+
const usesEsmEnv = _.some(deps, {name: 'esm-env'});
210+
208211
this.config = config;
209212

210213
const opts = {
@@ -228,6 +231,14 @@ export class DumberSession {
228231
deps: deps
229232
};
230233

234+
if (usesEsmEnv) {
235+
opts.onRequire = moduleId => {
236+
if (moduleId === 'esm-env') {
237+
return 'export const env = {BROWSER: true, DEV: true, NODE: false};';
238+
}
239+
};
240+
}
241+
231242
this.instance = new this.Dumber(opts);
232243

233244
let transpilerOptions = {};

client/src-worker/transpilers/svelte.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ export class SvelteTranspiler {
8989
);
9090

9191
const compiled = compile(preprocessed.toString(), {
92-
filename: filename,
93-
format: 'esm',
9492
outputFilename: newFilename
9593
});
9694

client/src/navigation/dialogs/select-skeleton-dialog.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,6 @@ export class SelectSkeletonDialog {
9191
label: 'Mocha + Chai',
9292
image: 'data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20192%20191.99999%22%20width%3D%22192%22%20height%3D%22192%22%3E%3Cpath%20d%3D%22M169.47386%20143.90113l-68.70282%2039.69498c-2.958045%201.71756-6.584028%201.71756-9.542066%200L22.52614%20143.90113c-2.958038-1.71757-4.77103-4.86645-4.77103-8.20617V56.305021c0-3.435142%201.812992-6.488601%204.77103-8.206172L91.228974%208.403878c2.958038-1.717571%206.584021-1.717571%209.542056%200l68.70282%2039.694971c2.95804%201.717571%204.77104%204.866451%204.77104%208.206172v79.389939c-.0954%203.33972-1.90842%206.4886-4.77104%208.20617z%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%238d6748%22%20fill-rule%3D%22evenodd%22%2F%3E%3Cpath%20d%3D%22M95.904583%2022.049024c.954207%200%201.812992.286262%202.671781.763365l59.351606%2034.255996c1.62216.954206%202.67177%202.767198%202.67177%204.67561v68.511985c0%201.90842-1.04962%203.72141-2.67177%204.67562l-59.351606%2034.25599c-.858789.47711-1.717574.76336-2.671781.76336-.954206%200-1.908412-.28625-2.671777-.76336L33.881192%20134.9316c-1.62215-.95421-2.671778-2.7672-2.671778-4.67562V61.743995c0-1.908412%201.049628-3.721404%202.671778-4.67561l59.351614-34.255996c.858785-.477103%201.812992-.763365%202.671777-.763365m0-2.862618c-1.431309%200-2.862618.381683-4.103085%201.145048L32.449883%2054.58745c-2.576357%201.431309-4.103086%204.198506-4.103086%207.061124v68.511996c0%202.95803%201.526729%205.62981%204.103086%207.06112l59.351615%2034.25599c1.240467.76337%202.671776%201.14506%204.103085%201.14506%201.431309%200%202.862617-.38169%204.103097-1.14506l59.35159-34.25599c2.57636-1.43131%204.10309-4.1985%204.10309-7.06112V61.648574c0-2.958038-1.52673-5.629815-4.10309-7.061124l-59.35159-34.255996c-1.24048-.763365-2.671788-1.145048-4.103097-1.145048z%22%20fill%3D%22%23fff%22%2F%3E%3Cpath%20d%3D%22M104.3493%2061.648574c0-.477103-.381682-.954206-.954206-.954206H85.456021c-.477103%200-.954206.381682-.954206.954206%200%203.2443.477103%2014.40851%205.248133%2019.847485.190841.190841.381683.286262.667944.286262h8.01533c.286263%200%20.477104-.09542.667945-.286262%204.77103-5.343554%205.248133-16.507764%205.248133-19.847485zm-7.061124%2017.36655H91.65836c-.286262%200-.477103-.095421-.667944-.286263-3.2443-3.816824-3.625983-11.450472-3.721403-14.122249%200-.477103.381682-.954206.954206-.954206h12.595519c.477103%200%20.954206.381683.954206.954206%200%202.671777-.477103%2010.210005-3.721403%2014.12225-.286262.19084-.477103.286261-.763365.286261zM96.23855%2058.785956s3.43514-2.003833%201.335888-5.629816c-1.240468-1.908412-1.812992-3.530562-1.335889-4.198506-1.240468%201.52673-3.339721%203.14888-1.049627%206.584021.763365.858786%201.145048%202.671777%201.049627%203.2443zM92.421725%2059.072217s2.290094-1.335888.858785-3.816824c-.858785-1.240467-1.240467-2.385515-.858785-2.767197-.858785%201.049627-2.194674%202.099253-.667944%204.484768.477103.477103.667944%201.717571.667944%202.099253z%22%20fill%3D%22%23fff%22%2F%3E%3Cpath%20d%3D%22M100.246214%2070.141007c-.381682%202.576357-1.145047%205.534395-2.767197%207.442807-.190841.190841-.381682.286262-.572524.286262h-4.77103c-.190841%200-.477103-.09542-.572523-.286262-1.145048-1.431309-1.908412-3.33972-2.385515-5.343553%200%200%205.534394.763364%208.683274-.381683%202.290095-.858785%202.385515-1.71757%202.385515-1.71757z%22%20fill%3D%22%23fff%22%2F%3E%3Cg%20fill%3D%22%23fff%22%3E%3Cpath%20d%3D%22M37.554879%2085.599145h3.530562l5.820657%208.969536%205.820657-8.969536h3.530562v19.08412h-3.339721V91.03812l-6.011498%208.969537h-.09542L40.8946%2091.13354v13.645146h-3.339721V85.599145zM73.528446%20104.969527c-1.43131%200-2.767198-.286262-4.007665-.763365-1.240468-.477103-2.290095-1.240468-3.14888-2.099253-.858786-.858785-1.52673-1.908412-2.003833-3.14888-.477103-1.145047-.763365-2.480936-.763365-3.816824v-.09542c0-1.335889.286262-2.576357.763365-3.816825.477103-1.145047%201.145047-2.194674%202.099253-3.14888.858786-.858785%201.908412-1.62215%203.14888-2.099253%201.240468-.572523%202.576356-.763365%204.007665-.763365%201.43131%200%202.767198.286262%204.007666.763365%201.240468.477103%202.290094%201.240468%203.14888%202.099253.858785.858786%201.52673%201.908412%202.003832%203.14888.477103%201.145048.763365%202.480936.763365%203.816824v.095421c0%201.335888-.286262%202.576356-.763365%203.816824-.477103%201.145047-1.145047%202.194674-2.099253%203.14888-.858785.858785-1.908412%201.62215-3.14888%202.099253-1.240468.572524-2.576356.763365-4.007665.763365zm0-3.05346c.954206%200%201.812991-.19084%202.576356-.572523.763365-.381682%201.43131-.858785%202.003833-1.431309.572523-.572524.954206-1.335888%201.335888-2.099253.286262-.858786.477103-1.717571.477103-2.576356v-.095421c0-.954206-.190841-1.812991-.477103-2.671777-.286262-.858785-.763365-1.52673-1.335888-2.194674-.572524-.572523-1.240468-1.049626-2.003833-1.431309-.763365-.381682-1.62215-.572523-2.576356-.572523-.954206%200-1.812992.19084-2.576356.572523-.763365.381683-1.43131.858786-2.003833%201.43131-.572524.572523-.954206%201.335888-1.335888%202.099253-.286262.858785-.477104%201.71757-.477104%202.576356v.09542c0%20.954206.190842%201.812992.477104%202.671777.286261.858786.763364%201.52673%201.335888%202.194674.572524.572524%201.240468%201.049627%202.003833%201.43131.763364.381682%201.71757.572523%202.576356.572523zM99.67369%20104.969527c-1.431308%200-2.671776-.286262-3.816823-.763365-1.145048-.477103-2.194674-1.240468-3.05346-2.099253-.858785-.858785-1.52673-1.908412-2.003832-3.14888-.477103-1.240468-.763365-2.480936-.763365-3.816824v-.09542c0-1.335889.286262-2.671777.763365-3.816825.477103-1.145047%201.145047-2.194674%202.003832-3.14888.858786-.858785%201.908412-1.62215%203.14888-2.099253%201.240468-.477103%202.480936-.763365%204.007666-.763365.858785%200%201.62215.095421%202.385515.190842.763364.19084%201.335888.381682%202.003832.572523.572524.286262%201.145047.572524%201.62215.954206.477104.381683.954207.763365%201.43131%201.240468l-2.194674%202.480936c-.763365-.667945-1.52673-1.240468-2.385515-1.717571-.858786-.477103-1.812992-.667944-2.958039-.667944-.954206%200-1.71757.19084-2.480936.572523-.763364.381683-1.431309.858786-2.003832%201.43131-.572524.572523-.954206%201.335888-1.335889%202.099253-.286262.858785-.477103%201.71757-.477103%202.576356v.09542c0%20.954206.190841%201.812992.477103%202.671777.286262.858786.763365%201.52673%201.335889%202.194674.572523.572524%201.240468%201.145047%202.003832%201.43131.763365.28626%201.62215.572523%202.480936.572523%201.145047%200%202.194674-.190841%202.958039-.667944.763364-.477103%201.62215-1.049627%202.480935-1.812992l2.194674%202.194674c-.477103.572524-.954206.954206-1.52673%201.431309-.572523.477103-1.145047.763365-1.71757%201.049627-.572524.286261-1.335889.572523-2.003833.667944-.858785.190841-1.71757.190841-2.576356.190841zM114.177622%2085.599145h3.339721v7.91991h9.160378v-7.91991h3.339721v19.08412h-3.33972v-8.01533h-9.160379v8.01533h-3.33972v-19.08412zM144.807636%2085.503724h3.053459l8.397013%2019.179541h-3.530563l-1.908412-4.580189h-8.969536l-2.003833%204.58019h-3.435141l8.397013-19.179542zm4.77103%2011.641314l-3.2443-7.633649-3.244301%207.633649h6.4886z%22%2F%3E%3C%2Fg%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M35.169365%20110.69476h121.66127v1.049627H35.169365zM156.83062%2074.816618h-51.71797c0%20.381682-.0954.667943-.0954%201.049626h51.81338v-1.049626zM35.169364%2074.816618v1.049626h48.759928c0-.381683-.09542-.667944-.09542-1.049626H35.169365z%22%2F%3E%3C%2Fsvg%3E'
9393
},
94-
{
95-
value: 'zora',
96-
label: 'Zora',
97-
icon: 'fas fa-tape'
98-
}
9994
];
10095

10196
constructor(controller) {

client/src/skeletons/aurelia.js

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -127,35 +127,6 @@ describe('Component app', () => {
127127
});
128128
`;
129129

130-
const zoraTest = `import {StageComponent} from 'aurelia-testing';
131-
import {bootstrap} from 'aurelia-bootstrapper';
132-
import {test} from 'zora';
133-
134-
test('Component app should render message', async t => {
135-
let component = StageComponent
136-
.withResources('app')
137-
.inView('<app></app>')
138-
.boundTo({});
139-
140-
return component.create(bootstrap)
141-
.then(
142-
() => {
143-
const view = component.element;
144-
t.equal(view.textContent.trim(), 'Hello Aurelia!');
145-
},
146-
e => {
147-
t.fail(e);
148-
}
149-
)
150-
.then(() => {
151-
if (component) {
152-
component.dispose();
153-
component = null;
154-
}
155-
});
156-
});
157-
`;
158-
159130
export default function({transpiler, testFramework}) {
160131
const ext = transpiler === 'typescript' ? '.ts' : '.js';
161132
const files = [
@@ -192,16 +163,11 @@ export default function({transpiler, testFramework}) {
192163
filename: `test/app.spec${ext}`,
193164
content: jasmineTest
194165
});
195-
} if (testFramework === 'mocha') {
166+
} else if (testFramework === 'mocha') {
196167
files.push({
197168
filename: `test/app.spec${ext}`,
198169
content: mochaTest
199170
});
200-
} if (testFramework === 'zora') {
201-
files.push({
202-
filename: `test/app.spec${ext}`,
203-
content:zoraTest
204-
});
205171
}
206172
}
207173

client/src/skeletons/aurelia2.js

Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -50,49 +50,65 @@ const appTs = `export class MyApp {
5050
}
5151
`;
5252

53-
const testHelper = ext => `import Aurelia, { CustomElement } from 'aurelia';
54-
export async function render(template${ext === '.ts' ? ': string' : ''}, ...deps${ext === '.ts' ? ': readonly unknown[]' : ''}) {
55-
const wrapper = CustomElement.define({name: 'wrapper', template});
56-
const div = document.createElement('div');
57-
const au = Aurelia.register(deps).app({
58-
host: div,
59-
component: wrapper
60-
});
61-
await au.start();
62-
return div;
53+
const testSetup = ext => `import { BrowserPlatform } from '@aurelia/platform-browser';
54+
import { setPlatform, onFixtureCreated${ext === '.ts' ? ', type IFixture' : ''} } from '@aurelia/testing';
55+
56+
// Sets up the Aurelia environment for testing
57+
function bootstrapTextEnv() {
58+
const platform = new BrowserPlatform(window);
59+
setPlatform(platform);
60+
BrowserPlatform.set(globalThis, platform);
6361
}
64-
`;
6562
66-
const jasmineTest = `import { render } from './helper';
67-
import { MyApp } from '../src/my-app';
63+
const fixtures${ext === '.ts' ? ': IFixture<object>[]' : ''} = [];
64+
beforeAll(() => {
65+
bootstrapTextEnv();
66+
onFixtureCreated(fixture => {
67+
fixtures.push(fixture);
68+
});
69+
});
6870
69-
describe('Component App', () => {
70-
it('should render message', async () => {
71-
const div = await render('<my-app></my-app>', MyApp);
72-
expect(div.textContent.trim()).toEqual('Hello Aurelia 2!');
71+
afterEach(() => {
72+
fixtures.forEach(async f => {
73+
try {
74+
await f.stop(true);
75+
} catch {
76+
// ignore
77+
}
7378
});
79+
fixtures.length = 0;
7480
});
7581
`;
7682

77-
const mochaTest = `import { render } from './helper';
78-
import {expect} from 'chai';
83+
const jasmineTest = `import { createFixture } from '@aurelia/testing';
7984
import { MyApp } from '../src/my-app';
8085
8186
describe('Component App', () => {
8287
it('should render message', async () => {
83-
const div = await render('<my-app></my-app>', MyApp);
84-
expect(div.textContent.trim()).to.equal('Hello Aurelia 2!');
88+
const { assertText } = await createFixture(
89+
'<my-app></my-app>',
90+
{},
91+
[MyApp],
92+
).started;
93+
94+
assertText('Hello Aurelia 2!', { compact: true });
8595
});
8696
});
87-
`
97+
`;
8898

89-
const zoraTest = `import { render } from './helper';
90-
import {test} from 'zora';
99+
const mochaTest = `import { createFixture } from '@aurelia/testing';
91100
import { MyApp } from '../src/my-app';
92101
93-
test('should render message', async t => {
94-
const div = await render('<my-app></my-app>', MyApp);
95-
t.equal(div.textContent.trim(), 'Hello Aurelia 2!');
102+
describe('Component App', () => {
103+
it('should render message', async () => {
104+
const { assertText } = await createFixture(
105+
'<my-app></my-app>',
106+
{},
107+
[MyApp],
108+
).started;
109+
110+
assertText('Hello Aurelia 2!', { compact: true });
111+
});
96112
});
97113
`;
98114

@@ -123,25 +139,20 @@ export default function({transpiler, testFramework}) {
123139

124140
if (testFramework !== 'none') {
125141
files.push({
126-
filename: `test/helper${ext}`,
127-
content: testHelper(ext)
142+
filename: `test/setup${ext}`,
143+
content: testSetup(ext)
128144
});
129145

130146
if (testFramework === 'jasmine') {
131147
files.push({
132148
filename: `test/app.spec${ext}`,
133149
content: jasmineTest
134150
});
135-
} if (testFramework === 'mocha') {
151+
} else if (testFramework === 'mocha') {
136152
files.push({
137153
filename: `test/app.spec${ext}`,
138154
content: mochaTest
139155
});
140-
} if (testFramework === 'zora') {
141-
files.push({
142-
filename: `test/app.spec${ext}`,
143-
content: zoraTest
144-
});
145156
}
146157
}
147158

client/src/skeletons/backbone.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,6 @@ describe('Component App', () => {
5959
expect(div.textContent).to.equal('Hello Backbone!');
6060
});
6161
});
62-
`
63-
64-
const zoraTest = `import {test} from 'zora';
65-
import App from '../src/app';
66-
67-
test('should render message', t => {
68-
const div = document.createElement('div');
69-
const app = new App({el: div});
70-
app.render();
71-
t.equal(div.textContent, 'Hello Backbone!');
72-
});
7362
`;
7463

7564
export default function({transpiler, testFramework}) {
@@ -98,16 +87,11 @@ export default function({transpiler, testFramework}) {
9887
filename: `test/app.spec${ext}`,
9988
content: jasmineTest
10089
});
101-
} if (testFramework === 'mocha') {
90+
} else if (testFramework === 'mocha') {
10291
files.push({
10392
filename: `test/app.spec${ext}`,
10493
content: mochaTest
10594
});
106-
} if (testFramework === 'zora') {
107-
files.push({
108-
filename: `test/app.spec${ext}`,
109-
content: zoraTest
110-
});
11195
}
11296

11397
return files;

client/src/skeletons/inferno.js

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,6 @@ describe('Component App', () => {
6363
});
6464
`;
6565

66-
const zoraTest = `import { render } from 'inferno';
67-
import App from '../src/App';
68-
import {test} from 'zora';
69-
70-
test('renders without crashing', t => {
71-
const div = document.createElement('div');
72-
render(<App />, div);
73-
t.equal(div.textContent, 'Hello Inferno!')
74-
});
75-
`;
76-
77-
7866
export default function({transpiler, testFramework}) {
7967
const ext = transpiler === 'typescript' ? '.tsx' : '.jsx';
8068
const files = [
@@ -101,16 +89,11 @@ export default function({transpiler, testFramework}) {
10189
filename: `test/app.spec${ext}`,
10290
content: jasmineTest
10391
});
104-
} if (testFramework === 'mocha') {
92+
} else if (testFramework === 'mocha') {
10593
files.push({
10694
filename: `test/app.spec${ext}`,
10795
content: mochaTest
10896
});
109-
} if (testFramework === 'zora') {
110-
files.push({
111-
filename: `test/app.spec${ext}`,
112-
content: zoraTest
113-
});
11497
}
11598

11699
return files;

client/src/skeletons/none.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,6 @@ describe('Component app', () => {
4545
});
4646
`;
4747

48-
const zoraTest = `import {test} from 'zora';
49-
import app from '../src/app';
50-
51-
test('should render message', t => {
52-
t.equal(app.textContent, 'Hello Dumber Gist!');
53-
});
54-
`;
55-
5648
export default function({transpiler, testFramework}) {
5749
const ext = transpiler === 'typescript' ? '.ts' : '.js';
5850
const files = [
@@ -78,16 +70,11 @@ export default function({transpiler, testFramework}) {
7870
filename: `test/app.spec${ext}`,
7971
content: jasmineTest
8072
});
81-
} if (testFramework === 'mocha') {
73+
} else if (testFramework === 'mocha') {
8274
files.push({
8375
filename: `test/app.spec${ext}`,
8476
content: mochaTest
8577
});
86-
} if (testFramework === 'zora') {
87-
files.push({
88-
filename: `test/app.spec${ext}`,
89-
content: zoraTest
90-
});
9178
}
9279

9380
return files;

client/src/skeletons/preact.js

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,9 @@ describe('Component App', () => {
6767
expect(div.textContent).to.equal('Hello Preact!');
6868
});
6969
});
70-
`
71-
72-
const zoraTest = `import { h, render } from 'preact';
73-
import {test} from 'zora';
74-
import App from '../src/app';
75-
76-
test('should render message', t => {
77-
const div = document.createElement('div');
78-
render(<App />, div);
79-
t.equal(div.textContent, 'Hello Preact!');
80-
});
8170
`;
8271

72+
8373
export default function({transpiler, testFramework}) {
8474
const ext = transpiler === 'typescript' ? '.tsx' : '.jsx';
8575
const files = [
@@ -106,16 +96,11 @@ export default function({transpiler, testFramework}) {
10696
filename: `test/app.spec${ext}`,
10797
content: jasmineTest
10898
});
109-
} if (testFramework === 'mocha') {
99+
} else if (testFramework === 'mocha') {
110100
files.push({
111101
filename: `test/app.spec${ext}`,
112102
content: mochaTest
113103
});
114-
} if (testFramework === 'zora') {
115-
files.push({
116-
filename: `test/app.spec${ext}`,
117-
content: zoraTest
118-
});
119104
}
120105

121106
return files;

0 commit comments

Comments
 (0)