Skip to content

Commit

Permalink
Make minimal
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Dec 10, 2024
1 parent 44d55b2 commit 1bbaf0d
Show file tree
Hide file tree
Showing 14 changed files with 177 additions and 62 deletions.
170 changes: 133 additions & 37 deletions pnpm-lock.yaml

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

10 changes: 5 additions & 5 deletions tests/app-template-minimal/app/app.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import Application from '@ember/application';
import compatModules from '@embroider/virtual/compat-modules';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

const templates = import.meta.glob(`templates/**/*`, { eager: true });

export default class App extends Application {
modulePrefix = config.modulePrefix;
podModulePrefix = config.podModulePrefix;
Resolver = Resolver.withModules(compatModules);
Resolver = Resolver.withModules({
...templates,
});
}

loadInitializers(App, config.modulePrefix, compatModules);
Empty file.
34 changes: 32 additions & 2 deletions tests/app-template-minimal/app/config/environment.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
import loadConfigFromMeta from '@embroider/config-meta-loader';
export default {
modulePrefix: 'app-template-minimal',
environment: import.meta.env.DEV ? 'development' : 'production',
rootURL: '/',
locationType: 'history',
EmberENV: {
EXTEND_PROTOTYPES: false,
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true
},
},

export default loadConfigFromMeta('app-template');
...(import.meta.env.MODE === 'test'
? {
locationType: 'none',
}
: {}),
APP: {
// Here you can pass flags/options to your application instance
// when it is created
...(import.meta.env.MODE === 'test'
? {
// keep test console output quieter
LOG_ACTIVE_GENERATION: false,
LOG_VIEW_LOOKUPS: false,

rootElement: '#ember-testing',
autoboot: false,
}
: {}),
},
};
Empty file.
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion tests/app-template-minimal/app/router.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import EmberRouter from '@ember/routing/router';
import config from 'app-template/config/environment';
import config from 'app-template-minimal/config/environment';

export default class Router extends EmberRouter {
location = config.locationType;
Expand Down
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion tests/app-template-minimal/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module.exports = function (environment) {
const ENV = {
modulePrefix: 'app-template',
modulePrefix: 'app-template-minimal',
environment,
rootURL: '/',
locationType: 'history',
Expand Down
14 changes: 2 additions & 12 deletions tests/app-template-minimal/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "app-template",
"name": "app-template-minimal",
"version": "0.0.0",
"private": true,
"description": "Small description for app-template goes here",
Expand Down Expand Up @@ -37,7 +37,6 @@
"@ember/string": "^3.1.1",
"@ember/test-helpers": "^4.0.4",
"@embroider/compat": "workspace:*",
"@embroider/config-meta-loader": "workspace:*",
"@embroider/core": "workspace:*",
"@embroider/router": "workspace:*",
"@embroider/test-setup": "workspace:*",
Expand All @@ -47,31 +46,22 @@
"@rollup/plugin-babel": "^5.3.1",
"babel-plugin-ember-template-compilation": "^2.3.0",
"concurrently": "^8.2.0",
"ember-auto-import": "^2.6.3",
"decorator-transforms": "^2.0.0",
"ember-cli": "~5.0.0",
"ember-cli-app-version": "^6.0.0",
"ember-cli-babel": "^7.26.11",
"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-load-initializers": "^3.0.0",
"ember-modifier": "^4.1.0",
"ember-page-title": "^7.0.0",
"ember-qunit": "^8.1.1",
"ember-resolver": "^13.1.0",
"ember-source": "~5.12.0",
"ember-source": "~6.1.0-beta.1",
"ember-template-lint": "^5.10.1",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-ember": "^11.8.0",
"eslint-plugin-n": "^16.0.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-qunit": "^7.3.4",
"loader.js": "^4.7.0",
"prettier": "^2.8.8",
"qunit": "^2.19.4",
"qunit-dom": "^2.0.0",
Expand Down
4 changes: 2 additions & 2 deletions tests/app-template-minimal/tests/test-helper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Application from 'app-template/app';
import config from 'app-template/config/environment';
import Application from 'app-template-minimal/app';
import config from 'app-template-minimal/config/environment';
import * as QUnit from 'qunit';
import { setApplication } from '@ember/test-helpers';
import { setup } from 'qunit-dom';
Expand Down
3 changes: 1 addition & 2 deletions tests/app-template-minimal/vite.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { defineConfig } from "vite";
import { extensions, classicEmberSupport, ember } from "@embroider/vite";
import { extensions, ember } from "@embroider/vite";
import { babel } from "@rollup/plugin-babel";

export default defineConfig({
plugins: [
classicEmberSupport(),
ember(),
// extra plugins here
babel({
Expand Down

0 comments on commit 1bbaf0d

Please sign in to comment.