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

Ember: Upgrade through 43 minor versions, 2 majors, and 2 paradigm shifts #2209

Merged
merged 24 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 7 additions & 17 deletions examples/emberjs/README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,26 @@
# Ember.js TodoMVC Example using Ember CLI v3.2
# Ember.js TodoMVC Example using Ember 5.3

> A framework for creating ambitious web applications.

> _[Ember.js - emberjs.com](http://emberjs.com)_
> _[Ember CLI - ember-cli.com](http://ember-cli.com)_

\*Ember is not an MVC framework.

## Note for people updating this app.

The `index.html` and the `assets` folder in the parent folder as simlinks into the items with the same names inside `dist`. The `dist` folder has to be checked in git and built for production.

You can develop this project as a standard Ember CLI application:

```bash
$ cd todomvc
$ npm install
$ ember server
```

Update to the latest Ember with `ember-cli-update` and with the latest codemods:
You can develop this project as a standard Ember application:

```bash
$ cd todomvc
$ npx ember-cli-update
$ git commit -m 'Update Ember with ember-cli-update' -a
$ npx ember-cli-update --run-codemods
$ git commit -m 'Update TodoMVC with codemods' -a
$ pnpm install
$ pnpm start
```

Build Ember TodoMVC for production:

```bash
$ ember build --prod
$ pnpm build
```

Run Cypress Test:
Expand Down
1 change: 0 additions & 1 deletion examples/emberjs/todomvc/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

root = true


[*]
end_of_line = lf
charset = utf-8
Expand Down
8 changes: 7 additions & 1 deletion examples/emberjs/todomvc/.ember-cli
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@

Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false
"disableAnalytics": false,

/**
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
}
9 changes: 2 additions & 7 deletions examples/emberjs/todomvc/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/

# misc
/coverage/
!.*
.*/

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
53 changes: 53 additions & 0 deletions examples/emberjs/todomvc/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
'use strict';

/**
* ESLint is really complicated right now, so all of it is abstracted away.
* Updates coming soon (and hopefully to the built-in ember experience).
*/
const { configs } = require('@nullvoxpopuli/eslint-configs');

const config = configs.ember();

const hasTS = (globArray) => globArray.some((glob) => glob.includes('ts'));

// Setup newer TS-aware lints
function addTSProject(override) {
if (!hasTS(override.files)) return override;

return {
...override,
/**
* This is how you tell @typescript-eslint to use your tsconfig.
* However, for gts files, we get this:
*
<repo>/app/components/welcome.gts
0:0 error Parsing error: ESLint was configured to run on
`<tsconfigRootDir>/app/components/welcome.gts/0_<repo>/app/components/welcome.gts/0_<repo>/app/components/welcome.gts/0_<repo>/app/components/welcome.gts`
using `parserOptions.project`: <tsconfigRootDir>/tsconfig.json
However, that TSConfig does not include this file. Either:
- Change ESLint's list of included files to not include this file
- Change that TSConfig to include this file
- Create a new TSConfig that includes this file and include it in your parserOptions.project

This is likely because we need to configure the TS parser to use glint instead of tsc
*/
// parserOptions: {
// ...override.parserOptions,
// extraFileExtensions: [".gts"],
// project: path.join(__dirname, "./tsconfig.json"),
// // TODO: try to set the Glint Program
// // https://typescript-eslint.io/packages/parser/
// // program: import("@glint/core"),
// },
rules: {
...override.rules,
// Disabled until the above issue is resolved
'@typescript-eslint/prefer-optional-chain': 'off',
},
};
}

module.exports = {
...config,
overrides: [...config.overrides].map(addTSProject),
};
40 changes: 0 additions & 40 deletions examples/emberjs/todomvc/.eslintrc.js

This file was deleted.

19 changes: 9 additions & 10 deletions examples/emberjs/todomvc/.gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
# /dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/.sass-cache
/connect.lock
/.env*
/.pnp*
/.eslintcache
/coverage/
/libpeerconnection.log
/npm-debug.log*
/testem.log
/yarn-error.log

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try

# broccoli-debug
/DEBUG/
9 changes: 9 additions & 0 deletions examples/emberjs/todomvc/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# best for apps, not for libraries
resolution-mode=highest

# ok for apps, disaster for libraries
auto-install-peers=true

# for cloudflare... but also because not all dependencies of the ecosystem have gotten strict yet
# TODO: set this to true
strict-peer-dependencies=false
19 changes: 19 additions & 0 deletions examples/emberjs/todomvc/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# unconventional js
/blueprints/*/files/

# compiled output
/dist/

# misc
/coverage/
!.*
.*/
README.md

# ember-try
/.node_modules.ember-try/

# everything else
*.yaml
.git/
.github/
23 changes: 23 additions & 0 deletions examples/emberjs/todomvc/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use strict';

module.exports = {
useTabs: true,
singleQuote: true,
printWidth: 100,
plugins: ['prettier-plugin-ember-template-tag'],
overrides: [
{
files: ['**/*.hbs'],
options: {
singleQuote: false,
},
},
{
files: ['**/*.gjs', '**/*.gts'],
plugins: ['prettier-plugin-ember-template-tag'],
options: {
templateSingleQuote: false,
},
},
],
};
8 changes: 8 additions & 0 deletions examples/emberjs/todomvc/.stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# unconventional files
/blueprints/*/files/

# compiled output
/dist/

# addons
/.node_modules.ember-try/
5 changes: 5 additions & 0 deletions examples/emberjs/todomvc/.stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'],
};
9 changes: 8 additions & 1 deletion examples/emberjs/todomvc/.template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
'use strict';

module.exports = {
extends: 'recommended'
extends: 'recommended',
rules: {
// Polaris allows <style> tags
// https://github.com/ember-template-lint/ember-template-lint/blob/master/lib/rules/no-forbidden-elements.js
'no-forbidden-elements': ['error', { forbidden: ['meta', 'html', 'script'] }],
// Stylistic
'no-inline-styles': false,
},
};
27 changes: 0 additions & 27 deletions examples/emberjs/todomvc/.travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions examples/emberjs/todomvc/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"embertooling.emberjs"
]
}
2 changes: 1 addition & 1 deletion examples/emberjs/todomvc/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ignore_dirs": ["tmp", "dist"]
"ignore_dirs": ["dist"]
}
53 changes: 53 additions & 0 deletions examples/emberjs/todomvc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# todomvc

## 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 todomvc`
- `pnpm install`

## Running / Development

- `ember serve`
- 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

- `ember test`
- `ember test --server`

### Linting

- `pnpm run lint`
- `pnpm lint:fix`

### Building

- `ember build` (development)
- `ember build --environment production` (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/)
Loading