-
-
Notifications
You must be signed in to change notification settings - Fork 156
feat(compiler): add support for Ember #419
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 13 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
ca19178
wip: start ember types
rtablada 3e25e78
feat: init ember-example
rtablada bd9de95
update examples
rtablada 8141f5a
dont change js fn type
rtablada d4c2fc2
feat: working example of ember compiler
rtablada a08066b
fix: lint errors in ember example
rtablada 7425c72
ember-vite example
rtablada 34f0948
feat: ember-cli snuck in git submodule again...
rtablada 2f55ec7
ember-vite is a real folder
rtablada e3f477f
doc: update docs for ember plugin
rtablada 8141fb2
Make ember examples minimal: remove ember-data, linting, testing, pre…
NullVoxPopuli 2f70e5f
Move 'ember' to 'webpack-ember'
NullVoxPopuli 5198494
Lockfile
NullVoxPopuli 299b997
Remove READMEs
NullVoxPopuli b902334
TIL: the whole public folders aren't needed
NullVoxPopuli 541f356
Reorder
NullVoxPopuli 109242b
Cleanup the ember part of the readme
NullVoxPopuli c5731f5
Cleanup the ember part of the readme
NullVoxPopuli 7cb6e3d
De-prioritize the ember-webpack instructions
NullVoxPopuli 1e995c0
Delete extraneous files
NullVoxPopuli eed3c35
vite-ember has no ember-cli, so we can remove .ember-cli file for teh…
NullVoxPopuli 9e17c0f
Vite-ember example has no tests, so we don't need to care about .env.…
NullVoxPopuli c5f5de8
lint:fix
NullVoxPopuli 934fa2a
Add override to eslint due to an oopsie from array-callback-return
NullVoxPopuli 2a2da4d
Use antfu eslint-config apis instead of eslint-overrides entry
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
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,19 @@ | ||
| # EditorConfig helps developers define and maintain consistent | ||
userquin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| # coding styles between different editors and IDEs | ||
| # editorconfig.org | ||
|
|
||
| root = true | ||
|
|
||
| [*] | ||
| end_of_line = lf | ||
| charset = utf-8 | ||
| trim_trailing_whitespace = true | ||
| insert_final_newline = true | ||
| indent_style = space | ||
| indent_size = 2 | ||
|
|
||
| [*.hbs] | ||
| insert_final_newline = false | ||
|
|
||
| [*.{diff,md}] | ||
| trim_trailing_whitespace = 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,19 @@ | ||
| { | ||
| /** | ||
| Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript | ||
| rather than JavaScript by default, when a TypeScript version of a given blueprint is available. | ||
| */ | ||
| "isTypeScriptProject": true, | ||
|
|
||
| /** | ||
| Setting `componentAuthoringFormat` to "strict" will force the blueprint generators to generate GJS | ||
| or GTS files for the component and the component rendering test. "loose" is the default. | ||
| */ | ||
| "componentAuthoringFormat": "strict", | ||
|
|
||
| /** | ||
| Setting `routeAuthoringFormat` to "strict" will force the blueprint generators to generate GJS | ||
| or GTS templates for routes. "loose" is the default | ||
| */ | ||
| "routeAuthoringFormat": "strict" | ||
| } |
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,8 @@ | ||
| # This file is committed to git and should not contain any secrets. | ||
| # | ||
| # Vite recommends using .env.local or .env.[mode].local if you need to manage secrets | ||
| # SEE: https://vite.dev/guide/env-and-mode.html#env-files for more information. | ||
|
|
||
|
|
||
| # Default NODE_ENV with vite build --mode=test is production | ||
| NODE_ENV=development |
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,26 @@ | ||
| # compiled output | ||
userquin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| /dist/ | ||
| /declarations/ | ||
| /tmp/ | ||
|
|
||
| # dependencies | ||
| /node_modules/ | ||
|
|
||
| # misc | ||
| /.env* | ||
| /.pnp* | ||
| /.eslintcache | ||
| /coverage/ | ||
| /npm-debug.log* | ||
| /testem.log | ||
| /yarn-error.log | ||
|
|
||
| # ember-try | ||
| /.node_modules.ember-try/ | ||
| /npm-shrinkwrap.json.ember-try | ||
| /package.json.ember-try | ||
| /package-lock.json.ember-try | ||
| /yarn.lock.ember-try | ||
|
|
||
| # broccoli-debug | ||
| /DEBUG/ | ||
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,57 @@ | ||
| # ember-vite-example | ||
userquin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| This README outlines the details of collaborating on this Ember application. | ||
| A short introduction of this app could easily go here. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| You will need the following things properly installed on your computer. | ||
|
|
||
| - [Git](https://git-scm.com/) | ||
| - [Node.js](https://nodejs.org/) | ||
| - [pnpm](https://pnpm.io/) | ||
| - [Ember CLI](https://cli.emberjs.com/release/) | ||
| - [Google Chrome](https://google.com/chrome/) | ||
|
|
||
| ## Installation | ||
|
|
||
| - `git clone <repository-url>` this repository | ||
| - `cd ember-vite-example` | ||
| - `pnpm install` | ||
|
|
||
| ## Running / Development | ||
|
|
||
| - `pnpm start` | ||
| - Visit your app at [http://localhost:4200](http://localhost:4200). | ||
| - Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests). | ||
|
|
||
| ### Code Generators | ||
|
|
||
| Make use of the many generators for code, try `ember help generate` for more details | ||
|
|
||
| ### Running Tests | ||
|
|
||
| - `pnpm test` | ||
| - `pnpm test --server` | ||
|
|
||
| ### Linting | ||
|
|
||
| - `pnpm lint` | ||
| - `pnpm lint:fix` | ||
|
|
||
| ### Building | ||
|
|
||
| - `pnpm ember build` (development) | ||
| - `pnpm build` (production) | ||
|
|
||
| ### Deploying | ||
|
|
||
| Specify what it takes to deploy your app. | ||
|
|
||
| ## Further Reading / Useful Links | ||
|
|
||
| - [ember.js](https://emberjs.com/) | ||
| - [ember-cli](https://cli.emberjs.com/release/) | ||
| - Development Browser Extensions | ||
| - [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi) | ||
| - [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/) | ||
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,20 @@ | ||
| import Application from 'ember-strict-application-resolver'; | ||
| import EmberRouter from '@embroider/router'; | ||
| import compatModules from '@embroider/virtual/compat-modules'; | ||
|
|
||
| class Router extends EmberRouter { | ||
| location = 'history'; | ||
| rootURL = '/'; | ||
| } | ||
|
|
||
| Router.map(() => { | ||
| // Add route declarations here | ||
| }); | ||
|
|
||
| export default class App extends Application { | ||
| modules = { | ||
| './router': Router, | ||
| ...import.meta.glob('./templates/**/*.{gjs,gts}', { 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,12 @@ | ||
| import Tomster from '~icons/logos/ember-tomster'; | ||
|
|
||
| import FileJavaScript from '~icons/devicon/javascript'; | ||
| import styles from './application.module.css'; | ||
|
|
||
| <template> | ||
| <h2 id="title">Welcome to Ember</h2> | ||
| <Tomster /> | ||
| <FileJavaScript class={{styles.large}} /> | ||
|
|
||
| {{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,4 @@ | ||
| .large { | ||
| width: 50px; | ||
| height: 50px; | ||
| } |
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,51 @@ | ||
| const { buildMacros } = require('@embroider/macros/babel') | ||
|
|
||
| const macros = buildMacros() | ||
|
|
||
| module.exports = { | ||
| plugins: [ | ||
| [ | ||
| '@babel/plugin-transform-typescript', | ||
| { | ||
| allExtensions: true, | ||
| onlyRemoveTypeImports: true, | ||
| allowDeclareFields: true, | ||
| }, | ||
| ], | ||
| [ | ||
| 'babel-plugin-ember-template-compilation', | ||
| { | ||
| compilerPath: 'ember-source/dist/ember-template-compiler.js', | ||
| enableLegacyModules: [ | ||
| 'ember-cli-htmlbars', | ||
| 'ember-cli-htmlbars-inline-precompile', | ||
| 'htmlbars-inline-precompile', | ||
| ], | ||
| transforms: [...macros.templateMacros], | ||
|
|
||
| }, | ||
| ], | ||
| [ | ||
| 'module:decorator-transforms', | ||
| { | ||
| runtime: { | ||
| import: require.resolve('decorator-transforms/runtime-esm'), | ||
| }, | ||
| }, | ||
| ], | ||
| [ | ||
| '@babel/plugin-transform-runtime', | ||
| { | ||
| absoluteRuntime: __dirname, | ||
| 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,16 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <meta charset="utf-8"> | ||
| <title>EmberViteExample</title> | ||
| <meta name="description" content=""> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
| </head> | ||
| <body> | ||
| <script type="module"> | ||
| import Application from './app/app'; | ||
|
|
||
| Application.create({}); | ||
| </script> | ||
| </body> | ||
| </html> |
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,42 @@ | ||
| { | ||
| "name": "ember-vite-example", | ||
| "type": "module", | ||
| "private": true, | ||
| "license": "MIT", | ||
| "exports": { | ||
| "./tests/*": "./tests/*", | ||
| "./*": "./app/*" | ||
| }, | ||
| "engines": { | ||
| "node": ">= 22" | ||
| }, | ||
| "scripts": { | ||
| "start": "vite" | ||
| }, | ||
| "devDependencies": { | ||
| "@babel/core": "^7.27.1", | ||
| "@babel/plugin-transform-runtime": "^7.27.1", | ||
| "@babel/plugin-transform-typescript": "^7.27.1", | ||
| "@babel/runtime": "^7.27.1", | ||
| "@ember/app-tsconfig": "^1.0.3", | ||
| "@embroider/core": "^4.1.0", | ||
| "@embroider/macros": "^1.18.0", | ||
| "@embroider/router": "^3.0.1", | ||
| "@embroider/vite": "^1.1.5", | ||
| "@glimmer/component": "^2.0.0", | ||
| "@glint/ember-tsc": "^1.0.3", | ||
| "@glint/template": "^1.6.1", | ||
| "@glint/tsserver-plugin": "^2.0.3", | ||
| "@iconify-json/devicon": "^1.2.29", | ||
| "@iconify-json/logos": "^1.2.5", | ||
| "@rollup/plugin-babel": "^6.0.4", | ||
| "@types/rsvp": "^4.0.9", | ||
| "babel-plugin-ember-template-compilation": "^2.4.1", | ||
| "decorator-transforms": "^2.3.0", | ||
| "ember-source": "~6.7.0", | ||
| "ember-strict-application-resolver": "0.1.0", | ||
| "typescript": "^5.8.3", | ||
| "unplugin-icons": "workspace:*", | ||
| "vite": "^7.1.9" | ||
| } | ||
| } |
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,3 @@ | ||
| # http://www.robotstxt.org | ||
userquin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| User-agent: * | ||
| Disallow: | ||
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,17 @@ | ||
| { | ||
| "extends": "@ember/app-tsconfig", | ||
| "compilerOptions": { | ||
| "paths": { | ||
| "ember-vite-example/tests/*": ["./tests/*"], | ||
| "ember-vite-example/*": ["./app/*"], | ||
| "*": ["./types/*"] | ||
| }, | ||
| "types": [ | ||
| "ember-source/types", | ||
| "@embroider/core/virtual", | ||
| "vite/client", | ||
| "unplugin-icons/types/ember" | ||
| ], | ||
| "allowJs": true | ||
| } | ||
| } |
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.