Skip to content

Commit

Permalink
Merge pull request #1771 from embroider-build/simplify-vite-app-template
Browse files Browse the repository at this point in the history
Simplify vite-app template
  • Loading branch information
ef4 authored Jan 25, 2024
2 parents 69a0e58 + 4ac78ae commit 2287af7
Show file tree
Hide file tree
Showing 7 changed files with 188 additions and 414 deletions.
513 changes: 128 additions & 385 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

54 changes: 53 additions & 1 deletion tests/scenarios/vite-app-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,59 @@ function execPromise(command: string): Promise<string> {
}

viteAppScenarios
.map('vite-app-basics', _project => {})
.map('vite-app-basics', project => {
project.mergeFiles({
app: {
adapters: {
'post.js': `
import JSONAPIAdapter from '@ember-data/adapter/json-api';
export default class extends JSONAPIAdapter {
urlForFindRecord(/* id, modelName */) {
return \`\${super.urlForFindRecord(...arguments)}.json\`;
}
}
`,
},
models: {
'post.js': `
import Model, { attr } from '@ember-data/model';
export default class extends Model {
@attr message;
}
`,
},
routes: {
'application.ts': `
import Route from '@ember/routing/route';
import { service } from '@ember/service';
export default class extends Route {
@service store;
async model() {
return await this.store.findRecord('post', 1);
}
}
`,
},
},
public: {
posts: {
'1.json': JSON.stringify(
{
data: {
type: 'post',
id: '1',
attributes: {
message: 'From Ember Data',
},
},
},
null,
2
),
},
},
});
})
.forEachScenario(scenario => {
Qmodule(scenario.name, function (hooks) {
let app: PreparedApp;
Expand Down
6 changes: 0 additions & 6 deletions tests/vite-app/app/adapters/post.js

This file was deleted.

4 changes: 0 additions & 4 deletions tests/vite-app/app/models/post.js

This file was deleted.

5 changes: 2 additions & 3 deletions tests/vite-app/app/routes/application.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import Route from '@ember/routing/route';
import { service } from '@ember/service';

export default class extends Route {
@service store;
async model() {
return await this.store.findRecord('post', 1);
return { message: 'Hello world' };
}
}
11 changes: 5 additions & 6 deletions tests/vite-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,19 @@
"ember-auto-import": "^2.6.3",
"ember-cli": "~5.0.0",
"ember-cli-app-version": "^6.0.0",
"ember-cli-babel": "^7.26.11",
"ember-cli-babel": "^8.2.0",
"ember-cli-clean-css": "^2.0.0",
"ember-cli-dependency-checker": "^3.3.1",
"ember-cli-htmlbars": "^6.2.0",
"ember-cli-inject-live-reload": "^2.1.0",
"ember-cli-sri": "^2.1.1",
"ember-cli-terser": "^4.0.2",
"ember-data": "~5.3.0",
"ember-load-initializers": "^2.1.2",
"ember-modifier": "^4.1.0",
"ember-page-title": "^7.0.0",
"ember-qunit": "^7.0.0",
"ember-resolver": "^10.1.0",
"ember-source": "~5.1.0",
"ember-source": "5.7.0-beta.1",
"ember-template-lint": "^5.10.3",
"ember-welcome-page": "^7.0.2",
"eslint": "^8.42.0",
Expand All @@ -67,18 +66,18 @@
"eslint-plugin-n": "^16.0.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-qunit": "^7.3.4",
"js-reporters": "^2.1.0",
"loader.js": "^4.7.0",
"prettier": "^2.8.8",
"puppeteer-chromium-resolver": "^21.0.0",
"qunit": "^2.19.4",
"qunit-dom": "^2.0.0",
"stylelint": "^15.7.0",
"stylelint-config-standard": "^33.0.0",
"stylelint-prettier": "^3.0.0",
"tracked-built-ins": "^3.1.1",
"typescript": "^5.1.6",
"vite": "^5.0.9",
"js-reporters": "^2.1.0",
"puppeteer-chromium-resolver": "^21.0.0"
"vite": "^5.0.9"
},
"engines": {
"node": "16.* || >= 18"
Expand Down
9 changes: 0 additions & 9 deletions tests/vite-app/public/posts/1.json

This file was deleted.

0 comments on commit 2287af7

Please sign in to comment.