Skip to content

Update to [email protected] and reset to the new app blueprint #10976

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 3 additions & 5 deletions .ember-cli
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
/**
Ember CLI sends analytics information by default. The data is completely
anonymous, but there are times when you might want to disable this behavior.

Setting `disableAnalytics` to true will prevent any data from being sent.
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.
*/
"disableAnalytics": false
"isTypeScriptProject": false
}
41 changes: 17 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,35 +1,28 @@
# compiled output
/dist/
/declarations/
/target
.cargo

# compiled output
/dist
/tmp

# dependencies
node_modules/
/bower_components
package-lock.json
yarn.lock

# misc
/.env*
/.pnp*
/.eslintcache
/.sass-cache
/connect.lock
/coverage/*
/coverage_*
/local_uploads
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
.env
docker-compose.override.yml
*~
src/schema.rs.orig
/coverage/
/npm-debug.log*
/testem.log
/yarn-error.log

# playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
# 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/
17 changes: 16 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
dist/
# unconventional js
/blueprints/*/files/

# compiled output
/dist/

# misc
/coverage/
!.*
.*/
/pnpm-lock.yaml
ember-cli-update.json
*.html

# ember-try
/.node_modules.ember-try/
7 changes: 6 additions & 1 deletion app/app.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import Application from '@ember/application';

import { importSync, isDevelopingApp, macroCondition } from '@embroider/macros';
import loadInitializers from 'ember-load-initializers';
import Resolver from 'ember-resolver';

import config from './config/environment';
import config from 'crates-io/config/environment';

import * as Sentry from './sentry';

// eslint-disable-next-line unicorn/prefer-add-event-listener
window.onerror = undefined;
Sentry.init();
if (macroCondition(isDevelopingApp())) {
importSync('./deprecation-workflow');
}

export default class App extends Application {
modulePrefix = config.modulePrefix;
Expand Down
29 changes: 29 additions & 0 deletions app/deprecation-workflow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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,
/* 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
*/
workflow: [
{
handler: 'silence',
matchId: 'importing-inject-from-ember-service',
},
{
handler: 'silence',
matchId: 'ember-data:deprecate-legacy-imports',
},
],
});
14 changes: 7 additions & 7 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
<html lang="en" class="notranslate" translate="no">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>crates.io: Rust Package Registry</title>
{{content-for "head"}}

{{content-for 'head'}}
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/crates-io.css">

<link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link rel="stylesheet" href="{{rootURL}}assets/crates-io.css">
<link rel="stylesheet" href="https://code.cdn.mozilla.net/fonts/fira.css">

<link rel="manifest" href="{{rootURL}}manifest.webmanifest">
<meta name="msapplication-config" content="{{rootURL}}browserconfig.xml">

{{content-for 'head-footer'}}
{{content-for "head-footer"}}
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/assets/cargo.png" type="image/png">
<link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="crates.io">
Expand All @@ -30,14 +30,14 @@
<noscript>
For full functionality of this site it is necessary to enable JavaScript.
</noscript>
{{content-for "body"}}

{{content-for 'body'}}

<!-- if you change the following inline script make sure to change the CSP settings of nginx! -->
<script>window.onerror=function(){document.body.innerHTML='<p style="width: 70%;background: var(--main-bg);padding: 10px;">Sorry, it looks like we were not able to load the page. Please make sure your network connection works and you are using an up-to-date browser. If the issue persists, please visit our <a href="https://github.com/rust-lang/crates.io/issues/new/choose">issue tracker</a> to report the problem.</p>'}</script>
<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/crates-io.js"></script>

{{content-for 'body-footer'}}
{{content-for "body-footer"}}
</body>
</html>
2 changes: 1 addition & 1 deletion app/router.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import EmberRouter from '@ember/routing/router';

import config from './config/environment';
import config from 'crates-io/config/environment';

export default class Router extends EmberRouter {
location = config.locationType;
Expand Down
21 changes: 21 additions & 0 deletions config/ember-cli-update.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"schemaVersion": "1.0.0",
"packages": [
{
"name": "ember-cli",
"version": "6.3.1",
"blueprints": [
{
"name": "app",
"outputRepo": "https://github.com/ember-cli/ember-new-output",
"codemodsSource": "ember-app-codemods-manifest@1",
"isBaseBlueprint": true,
"options": [
"--pnpm",
"--ci-provider=github"
]
}
]
}
]
}
10 changes: 3 additions & 7 deletions config/environment.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
'use strict';

module.exports = function (environment) {
let ENV = {
const ENV = {
modulePrefix: 'crates-io',
environment,
rootURL: '/',
locationType: 'history',
historySupportMiddleware: true,
EmberENV: {
EXTEND_PROTOTYPES: false,
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-controller': true
},
EXTEND_PROTOTYPES: {
// Prevent Ember Data from overriding Date.parse.
Date: false,
// e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true
},
},

Expand Down
3 changes: 2 additions & 1 deletion config/optional-features.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"application-template-wrapper": false,
"default-async-observers": true,
"jquery-integration": false,
"template-only-glimmer-components": true
"template-only-glimmer-components": true,
"no-implicit-route-model": true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extracted to #10978

}
26 changes: 15 additions & 11 deletions config/targets.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
'use strict';

const browsers = [
// These are the browsers we actually are attempting to support:
'last 2 Chrome versions',
'last 1 Firefox version',
'Firefox ESR',
'last 1 Safari version',
'last 1 iOS version',
'last 1 Edge version',
'last 1 UCAndroid version',
'last 1 years',
];

module.exports = {
browsers: [
// These are the browsers we actually are attempting to support:
'last 2 Chrome versions',
'last 1 Firefox version',
'Firefox ESR',
'last 1 Safari version',
'last 1 iOS version',
'last 1 Edge version',
'last 1 UCAndroid version',
'last 1 years',
],
browsers,
};
8 changes: 0 additions & 8 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ module.exports = function (defaults) {
let browsers = require('./config/targets').browsers;

let app = new EmberApp(defaults, {
'@embroider/macros': {
setConfig: {
'@ember-data/store': {
polyfillUUID: true,
},
},
},

autoImport: {
webpack: {
devtool: isProd ? 'source-map' : 'eval-source-map',
Expand Down
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@
"@ember/optional-features": "2.2.0",
"@ember/render-modifiers": "3.0.0",
"@ember/string": "4.0.1",
"@ember/test-helpers": "5.2.1",
"@ember/test-helpers": "5.1.0",
"@ember/test-waiters": "4.1.0",
"@embroider/compat": "3.9.0",
"@embroider/core": "3.5.6",
"@embroider/macros": "1.16.12",
"@embroider/webpack": "4.1.0",
"@eslint/eslintrc": "3.3.1",
"@eslint/js": "9.24.0",
Expand All @@ -83,20 +84,23 @@
"broccoli-funnel": "3.0.8",
"ember-a11y-testing": "7.1.1",
"ember-auto-import": "2.10.0",
"ember-cli": "6.3.1",
"ember-cli": "~6.3.1",
"ember-cli-babel": "8.2.0",
"ember-cli-bundle-analyzer": "1.0.0",
"ember-cli-clean-css": "3.0.0",
"ember-cli-code-coverage": "3.1.0",
"ember-cli-dependency-checker": "3.3.3",
"ember-cli-dependency-lint": "2.0.1",
"ember-cli-deprecation-workflow": "3.3.0",
"ember-cli-head": "2.0.0",
"ember-cli-htmlbars": "6.3.0",
"ember-cli-inject-live-reload": "2.1.0",
"ember-cli-notifications": "9.1.0",
"ember-cli-terser": "4.0.2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"ember-click-outside": "6.1.1",
"ember-concurrency": "4.0.3",
"ember-css-modules": "2.1.0",
"ember-data": "5.3.11",
"ember-data": "~5.3.12",
"ember-disable-prototype-extensions": "1.1.3",
"ember-error-route": "0.2.0",
"ember-event-helpers": "0.1.1",
Expand All @@ -109,8 +113,9 @@
"ember-page-title": "9.0.1",
"ember-qunit": "9.0.2",
"ember-resolver": "13.1.0",
"ember-source": "6.0.1",
"ember-source": "~6.3.0",
"ember-svg-jar": "2.6.2",
"ember-template-imports": "4.3.0",
"ember-template-lint": "7.0.4",
"ember-test-selectors": "7.1.0",
"ember-truth-helpers": "4.0.3",
Expand All @@ -136,6 +141,7 @@
"playwright-msw": "3.0.1",
"postcss-preset-env": "10.1.5",
"prettier": "3.5.3",
"prettier-plugin-ember-template-tag": "2.0.4",
"qunit": "2.24.1",
"qunit-console-grouper": "0.3.0",
"qunit-dom": "3.4.0",
Expand Down
Loading
Loading