-
-
Notifications
You must be signed in to change notification settings - Fork 12
Add --minimal and --no-compat
#49
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
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
e3a85e1
Add `--minimal` and `--no-compat`
NullVoxPopuli 7c6909b
Remove classicEmberSupport
NullVoxPopuli e4d122f
Update lint ignores
NullVoxPopuli b43790c
Update babel configs
NullVoxPopuli 66f8065
Update the HTMLs
NullVoxPopuli e56bceb
Update app.ts
NullVoxPopuli c02501a
Update the environment.ts
NullVoxPopuli 957318d
Update app -- wow so messy
NullVoxPopuli 0ce0641
Update package
NullVoxPopuli bfb8c45
Use conditional-files to clean up the no-compat variance
NullVoxPopuli 35684ef
ope
NullVoxPopuli 5d34dde
progress
NullVoxPopuli 3a4d9da
Upgrade ember-cli
NullVoxPopuli 301cbee
Update watchman usage
NullVoxPopuli 787a9b5
Fix tests
NullVoxPopuli 06a1e4d
Split minimal from no-compat tests, since minimal has no tests
NullVoxPopuli 8653b98
Cleanup test names
NullVoxPopuli 148f80c
Add new fixtures for minimal
NullVoxPopuli 3ff13d4
ope
NullVoxPopuli 553b6c1
Add ts minimal fixture
NullVoxPopuli 1d301c5
Unloop
NullVoxPopuli f4d15f1
Tests pass
NullVoxPopuli 8491650
Cleanup
NullVoxPopuli 23ee2c3
Update eslint config
NullVoxPopuli b2997a5
Skip lints on windows
NullVoxPopuli b4e3fab
Add tests for file generation / removing
NullVoxPopuli d05e9c1
Compat app can't use the strict resolver quite yet (see embroider's c…
NullVoxPopuli d87cbe1
Ensure that the compat tests include styles
NullVoxPopuli 461ef93
lint:fix
NullVoxPopuli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| /node_modules/ | ||
| /my-app/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| <% if (warpDrive) { %>import '@warp-drive/ember/install'; | ||
| <% } %>import Application from 'ember-strict-application-resolver'; | ||
|
|
||
| export default class App extends Application { | ||
| modules = { | ||
| ...import.meta.glob('./router.*', { eager: true }), | ||
| ...import.meta.glob('./templates/**/*', { eager: true }), | ||
| ...import.meta.glob('./services/**/*', { eager: true }), | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
|
|
||
| <template> | ||
| <h1>Welcome to Ember</h1> | ||
|
|
||
| {{outlet}} | ||
|
|
||
| </template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import { dirname } from 'node:path'; | ||
| import { fileURLToPath } from 'node:url'; | ||
| <% if (warpDrive) { %>import { setConfig } from '@warp-drive/core/build-config'; | ||
| <% } %>import { buildMacros } from '@embroider/macros/babel'; | ||
|
|
||
| <% if (warpDrive) { %>const macros = buildMacros({ | ||
| configure: (config) => { | ||
| setConfig(config, { | ||
| // for universal apps this MUST be at least 5.6 | ||
| compatWith: '5.6', | ||
| }); | ||
| }, | ||
| }); | ||
| <% } else { %>const macros = buildMacros(); | ||
| <% } %> | ||
| export default { | ||
| plugins: [ | ||
| [ | ||
| 'babel-plugin-ember-template-compilation', | ||
| { | ||
| compilerPath: 'ember-source/dist/ember-template-compiler.js', | ||
| transforms: [...macros.templateMacros], | ||
| }, | ||
| ], | ||
| [ | ||
| 'module:decorator-transforms', | ||
| { | ||
| runtime: { | ||
| import: import.meta.resolve('decorator-transforms/runtime-esm'), | ||
| }, | ||
| }, | ||
| ], | ||
| [ | ||
| '@babel/plugin-transform-runtime', | ||
| { | ||
| absoluteRuntime: dirname(fileURLToPath(import.meta.url)), | ||
| useESModules: true, | ||
| regenerator: false, | ||
| }, | ||
| ], | ||
| ...macros.babelMacros, | ||
| ], | ||
|
|
||
| generatorOpts: { | ||
| compact: false, | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import { dirname } from 'node:path'; | ||
| import { fileURLToPath } from 'node:url'; | ||
| <% if (warpDrive) { %>import { setConfig } from '@warp-drive/core/build-config'; | ||
| <% } %>import { buildMacros } from '@embroider/macros/babel'; | ||
|
|
||
| <% if (warpDrive) { %>const macros = buildMacros({ | ||
| configure: (config) => { | ||
| setConfig(config, { | ||
| // for universal apps this MUST be at least 5.6 | ||
| compatWith: '5.6', | ||
| }); | ||
| }, | ||
| }); | ||
| <% } else { %>const macros = buildMacros(); | ||
| <% } %> | ||
| export default { | ||
| plugins: [ | ||
| [ | ||
| '@babel/plugin-transform-typescript', | ||
| { | ||
| allExtensions: true, | ||
| onlyRemoveTypeImports: true, | ||
| allowDeclareFields: true, | ||
| }, | ||
| ], | ||
| [ | ||
| 'babel-plugin-ember-template-compilation', | ||
| { | ||
| compilerPath: 'ember-source/dist/ember-template-compiler.js', | ||
| transforms: [...macros.templateMacros], | ||
| }, | ||
| ], | ||
| [ | ||
| 'module:decorator-transforms', | ||
| { | ||
| runtime: { | ||
| import: import.meta.resolve('decorator-transforms/runtime-esm'), | ||
| }, | ||
| }, | ||
| ], | ||
| [ | ||
| '@babel/plugin-transform-runtime', | ||
| { | ||
| absoluteRuntime: dirname(fileURLToPath(import.meta.url)), | ||
| useESModules: true, | ||
| regenerator: false, | ||
| }, | ||
| ], | ||
| ...macros.babelMacros, | ||
| ], | ||
|
|
||
| generatorOpts: { | ||
| compact: false, | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <% if (warpDrive) { %>import '@warp-drive/ember/install';<% } %> | ||
| import Application from '@ember/application'; | ||
| import compatModules from '@embroider/virtual/compat-modules'; | ||
| import Resolver from 'ember-resolver'; | ||
| import config from '<%= modulePrefix %>/config/environment'; | ||
| import { importSync, isDevelopingApp, macroCondition } from '@embroider/macros'; | ||
| import setupInspector from '@embroider/legacy-inspector-support/ember-source-4.12'; | ||
|
|
||
| if (macroCondition(isDevelopingApp())) { | ||
| importSync('./deprecation-workflow'); | ||
| } | ||
|
|
||
| export default class App extends Application { | ||
| modulePrefix = config.modulePrefix; | ||
| podModulePrefix = config.podModulePrefix; | ||
| Resolver = Resolver.withModules(compatModules); | ||
| inspector = setupInspector(this); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| <% if (notMinimal) { %><% if (typescript) { %>// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| // @ts-expect-error | ||
| <% } %>import { getGlobalConfig } from '@embroider/macros/src/addon/runtime'; | ||
| <% } %> | ||
| interface Config { | ||
| isTesting?: boolean; | ||
| environment: string; | ||
| modulePrefix: string; | ||
| podModulePrefix?: string; | ||
| locationType: 'history' | 'hash' | 'none' | 'auto'; | ||
| rootURL: string; | ||
| EmberENV?: Record<string, unknown>; | ||
| APP: Record<string, unknown> & { rootElement?: string; autoboot?: boolean }; | ||
| } | ||
|
|
||
| const ENV: Config = { | ||
| modulePrefix: '<%= name %>', | ||
| environment: import.meta.env.DEV ? 'development' : 'production', | ||
| rootURL: '/', | ||
| locationType: 'history', | ||
| EmberENV: {}, | ||
| APP: {}, | ||
| }; | ||
|
|
||
| export default ENV; | ||
| <% if (notMinimal) { %> | ||
| export function enterTestMode() { | ||
| ENV.locationType = 'none'; | ||
| ENV.APP.rootElement = '#ember-testing'; | ||
| ENV.APP.autoboot = false; | ||
|
|
||
| <% if (typescript) { %>// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call | ||
| <% } %>const config = getGlobalConfig()['@embroider/macros']; | ||
|
|
||
| <% if (typescript) { %>// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | ||
| <% } %>if (config) config.isTesting = true; | ||
| } | ||
| <% } %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.