-
Notifications
You must be signed in to change notification settings - Fork 64
feat: add ember-vite example #108
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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# 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": false, | ||
|
||
/** | ||
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,47 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
pull_request: {} | ||
|
||
concurrency: | ||
group: ci-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint: | ||
name: "Lint" | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: npm | ||
- name: Install Dependencies | ||
run: npm ci | ||
- name: Lint | ||
run: npm run lint | ||
|
||
test: | ||
name: "Test" | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: npm | ||
- name: Install Dependencies | ||
run: npm ci | ||
- name: Run Tests | ||
run: npm test |
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 | ||
/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,13 @@ | ||
# unconventional js | ||
/blueprints/*/files/ | ||
|
||
# compiled output | ||
/dist/ | ||
|
||
# misc | ||
/coverage/ | ||
!.* | ||
.*/ | ||
/pnpm-lock.yaml | ||
ember-cli-update.json | ||
*.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,39 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
plugins: ['prettier-plugin-ember-template-tag'], | ||
singleQuote: true, | ||
overrides: [ | ||
{ | ||
files: ['*.js', '*.ts', '*.cjs', '.mjs', '.cts', '.mts', '.cts'], | ||
options: { | ||
trailingComma: 'es5', | ||
}, | ||
}, | ||
{ | ||
files: ['*.html'], | ||
options: { | ||
singleQuote: false, | ||
}, | ||
}, | ||
{ | ||
files: ['*.json'], | ||
options: { | ||
singleQuote: false, | ||
}, | ||
}, | ||
{ | ||
files: ['*.hbs'], | ||
options: { | ||
singleQuote: false, | ||
}, | ||
}, | ||
{ | ||
files: ['*.gjs', '*.gts'], | ||
options: { | ||
templateSingleQuote: false, | ||
trailingComma: 'es5', | ||
}, | ||
}, | ||
], | ||
}; |
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,5 @@ | ||
# unconventional files | ||
/blueprints/*/files/ | ||
|
||
# compiled output | ||
/dist/ |
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,5 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
extends: ['stylelint-config-standard'], | ||
}; |
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,5 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
extends: 'recommended', | ||
}; |
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 @@ | ||
{ | ||
"ignore_dirs": ["dist"] | ||
} |
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,56 @@ | ||
# ember-vite | ||
|
||
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/) (with npm) | ||
- [Ember CLI](https://cli.emberjs.com/release/) | ||
- [Google Chrome](https://google.com/chrome/) | ||
|
||
## Installation | ||
|
||
- `git clone <repository-url>` this repository | ||
- `cd ember-vite` | ||
- `npm install` | ||
|
||
## Running / Development | ||
|
||
- `npm run 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 | ||
|
||
- `npm run test` | ||
- `npm run test:ember -- --server` | ||
|
||
### Linting | ||
|
||
- `npm run lint` | ||
- `npm run lint:fix` | ||
|
||
### Building | ||
|
||
- `npm exec ember build` (development) | ||
- `npm run 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,18 @@ | ||
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 'ember-vite/config/environment'; | ||
import { importSync, isDevelopingApp, macroCondition } from '@embroider/macros'; | ||
|
||
if (macroCondition(isDevelopingApp())) { | ||
importSync('./deprecation-workflow'); | ||
} | ||
|
||
export default class App extends Application { | ||
modulePrefix = config.modulePrefix; | ||
podModulePrefix = config.podModulePrefix; | ||
Resolver = Resolver.withModules(compatModules); | ||
} | ||
|
||
loadInitializers(App, config.modulePrefix, compatModules); |
Empty file.
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,27 @@ | ||
import loadConfigFromMeta from '@embroider/config-meta-loader'; | ||
import { assert } from '@ember/debug'; | ||
|
||
const config = loadConfigFromMeta('ember-vite'); | ||
|
||
assert( | ||
'config is not an object', | ||
typeof config === 'object' && config !== null | ||
); | ||
assert( | ||
'modulePrefix was not detected on your config', | ||
'modulePrefix' in config && typeof config.modulePrefix === 'string' | ||
); | ||
assert( | ||
'locationType was not detected on your config', | ||
'locationType' in config && typeof config.locationType === 'string' | ||
); | ||
assert( | ||
'rootURL was not detected on your config', | ||
'rootURL' in config && typeof config.rootURL === 'string' | ||
); | ||
assert( | ||
'APP was not detected on your config', | ||
'APP' in config && typeof config.APP === 'object' | ||
); | ||
|
||
export default config; |
Empty file.
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,24 @@ | ||
import setupDeprecationWorkflow from 'ember-cli-deprecation-workflow'; | ||
|
||
/** | ||
* Docs: https://github.com/ember-cli/ember-cli-deprecation-workflow | ||
*/ | ||
setupDeprecationWorkflow({ | ||
/** | ||
false by default, but if a developer / team wants to be more aggressive about being proactive with | ||
handling their deprecations, this should be set to "true" | ||
*/ | ||
throwOnUnhandled: false, | ||
workflow: [ | ||
/* ... handlers ... */ | ||
/* to generate this list, run your app for a while (or run the test suite), | ||
* and then run in the browser console: | ||
* | ||
* deprecationWorkflow.flushDeprecations() | ||
* | ||
* And copy the handlers here | ||
*/ | ||
/* example: */ | ||
/* { handler: 'silence', matchId: 'template-action' }, */ | ||
], | ||
}); |
Empty file.
Empty file.
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,9 @@ | ||
import EmberRouter from '@ember/routing/router'; | ||
import config from 'ember-vite/config/environment'; | ||
|
||
export default class Router extends EmberRouter { | ||
location = config.locationType; | ||
rootURL = config.rootURL; | ||
} | ||
|
||
Router.map(function () {}); |
Empty file.
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 @@ | ||
/* Ember supports plain CSS out of the box. More info: https://cli.emberjs.com/release/advanced-use/stylesheets/ */ |
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 { pageTitle } from 'ember-page-title'; | ||
import { WelcomePage } from 'ember-welcome-page'; | ||
|
||
<template> | ||
{{pageTitle "MyApp"}} | ||
Nsttt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
{{outlet}} | ||
|
||
{{! The following component displays Ember's default welcome message. }} | ||
<WelcomePage /> | ||
{{! Feel free to remove this! }} | ||
</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,42 @@ | ||
const { | ||
babelCompatSupport, | ||
templateCompatSupport, | ||
} = require('@embroider/compat/babel'); | ||
|
||
module.exports = { | ||
plugins: [ | ||
[ | ||
'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: [...templateCompatSupport()], | ||
}, | ||
], | ||
[ | ||
'module:decorator-transforms', | ||
{ | ||
runtime: { | ||
import: require.resolve('decorator-transforms/runtime-esm'), | ||
}, | ||
}, | ||
], | ||
[ | ||
'@babel/plugin-transform-runtime', | ||
{ | ||
absoluteRuntime: __dirname, | ||
useESModules: true, | ||
regenerator: false, | ||
}, | ||
], | ||
...babelCompatSupport(), | ||
], | ||
|
||
generatorOpts: { | ||
compact: false, | ||
}, | ||
}; |
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.