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

Make app-template-minimal more minimal #2301

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NullVoxPopuli
Copy link
Collaborator

@NullVoxPopuli NullVoxPopuli commented Feb 21, 2025

Make the minimal template super minimal.

Learnings along the way:

  • we get to use type=module
  • we get to use package.json#imports
  • we can use src instead of app
  • we don't need a config directory
  • we still have to have ember-cli (for running tests)
  • ember-cli does not auto-detect a testem.cjs file, so we must use
    --config-file

Things that need to happen, but haven't yet, because I think we should make a better API in macros for this:

import { getGlobalConfig } from '@embroider/macros/src/addon/runtime';

const ENV = {
  modulePrefix: 'limber',
  environment: import.meta.env.DEV ? 'development' : 'production',
  rootURL: '/',
  locationType: 'history',
  EmberENV: {},
  APP: {},
};

export default ENV;

export function enterTestMode() {
  ENV.locationType = 'none';
  ENV.APP.rootElement = '#ember-testing';
  ENV.APP.autoboot = false;
  getGlobalConfig()['@embroider/macros'].isTesting = true;
}

otherwise macroCondition(isTesting()) always hits the else branch

@NullVoxPopuli NullVoxPopuli changed the title Remove @embroider/compat from app-template-minimal Make app-template-minimal more minimal Feb 21, 2025
NullVoxPopuli added a commit to NullVoxPopuli/vite-ember-exam-demo that referenced this pull request Feb 24, 2025
Learnings along the way:
- we get to use type=module
- we get to use package.json#imports
- we can use `src` instead of `app`
- we don't need a config directory
- we still have to have ember-cli (for running tests)
- ember-cli does not auto-detect a testem.cjs file, so we must use
  --config-file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant