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

Enable ember-cli as a real project #897

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
6 changes: 6 additions & 0 deletions app/components/ember-cli-landing-page.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<article class="chapter">
<h1>
Ember CLI Overview
</h1>
<p>TODO</p>
</article>
1 change: 0 additions & 1 deletion app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class AppRouter extends EmberRouter {
}

AppRouter.map(function () {
this.route('ember-cli');
this.route('project', { path: '/:project' });

this.route(
Expand Down
6 changes: 3 additions & 3 deletions app/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ export default class IndexRoute extends Route {
});
foundProject = 'ember-data';
} catch (e) {
await this.store.findRecord('project', 'ember-cli', {
includes: 'project-version',
});
foundProject = 'ember-cli';
}
}

if (foundProject === 'ember-cli') {
return this.router.transitionTo('ember-cli');
}
return this.router.transitionTo('project-version', foundProject, 'release');
}
}
2 changes: 1 addition & 1 deletion app/routes/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class ProjectRoute extends Route.extend(ScrollTracker) {
}

if (projectName.indexOf('cli') !== -1) {
return this.router.transitionTo('ember-cli');
projectNameToLookUp = 'ember-cli';
}

return this.store.findRecord('project', projectNameToLookUp, {
Expand Down
2 changes: 2 additions & 0 deletions app/services/meta-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default class MetaStoreService extends Service {
@tracked availableProjectVersions = {
ember: A(),
'ember-data': A(),
'ember-cli': A(),
};
@tracked projectRevMap = {};

Expand Down Expand Up @@ -40,6 +41,7 @@ export default class MetaStoreService extends Service {
this.availableProjectVersions = {
ember: A(availableProjectVersions['ember']),
'ember-data': A(availableProjectVersions['ember-data']),
'ember-cli': A(availableProjectVersions['ember-cli']),
};
this.projectRevMap = projectRevMap;
}
Expand Down
2 changes: 2 additions & 0 deletions app/templates/project-version/index.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{{#if (eq @model.id "ember-data")}}
<EmberDataLandingPage />
{{else if (eq @model.id "ember-cli")}}
<EmberCliLandingPage />
{{else}}
<EmberLandingPage />
{{/if}}
2 changes: 1 addition & 1 deletion app/utils/get-last-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import semverCompare from 'semver-compare';

export default function getLastVersion(projectVersions) {
const sortedVersions = projectVersions
.map((v) => v.replace(/ember-data-|ember-/g, ''))
.map((v) => v.replace(/ember-cli-|ember-data-|ember-/g, ''))
.sort((v1, v2) => {
return semverCompare(v1, v2);
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test": "tests"
},
"scripts": {
"clone": "rm -rf ember-api-docs-data && git clone --depth=1 https://github.com/ember-learn/ember-api-docs-data.git",
"clone": "rm -rf ember-api-docs-data && git clone -b ember-cli --single-branch --depth=1 https://github.com/ember-learn/ember-api-docs-data.git",
"build": "ember build --environment=production",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
Expand Down