From 2e6920a85855b439c96e7b3913d60825072f7281 Mon Sep 17 00:00:00 2001 From: Chris Manson Date: Fri, 10 Nov 2023 22:51:29 +0000 Subject: [PATCH 1/2] enable ember-cli as a real project --- app/components/ember-cli-landing-page.hbs | 6 ++++++ app/router.js | 1 - app/routes/index.js | 6 +++--- app/routes/project.js | 2 +- app/services/meta-store.js | 2 ++ app/templates/project-version/index.hbs | 2 ++ app/utils/get-last-version.js | 2 +- 7 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 app/components/ember-cli-landing-page.hbs diff --git a/app/components/ember-cli-landing-page.hbs b/app/components/ember-cli-landing-page.hbs new file mode 100644 index 00000000..0ef9bf50 --- /dev/null +++ b/app/components/ember-cli-landing-page.hbs @@ -0,0 +1,6 @@ +
+

+ Ember CLI Overview +

+

TODO

+
\ No newline at end of file diff --git a/app/router.js b/app/router.js index a3e7db36..3e27e8d4 100644 --- a/app/router.js +++ b/app/router.js @@ -34,7 +34,6 @@ class AppRouter extends EmberRouter { } AppRouter.map(function () { - this.route('ember-cli'); this.route('project', { path: '/:project' }); this.route( diff --git a/app/routes/index.js b/app/routes/index.js index 5caca4df..437a65c4 100644 --- a/app/routes/index.js +++ b/app/routes/index.js @@ -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'); } } diff --git a/app/routes/project.js b/app/routes/project.js index bcc5f143..36965e1e 100644 --- a/app/routes/project.js +++ b/app/routes/project.js @@ -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, { diff --git a/app/services/meta-store.js b/app/services/meta-store.js index 11cf2433..75afc1a0 100644 --- a/app/services/meta-store.js +++ b/app/services/meta-store.js @@ -10,6 +10,7 @@ export default class MetaStoreService extends Service { @tracked availableProjectVersions = { ember: A(), 'ember-data': A(), + 'ember-cli': A(), }; @tracked projectRevMap = {}; @@ -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; } diff --git a/app/templates/project-version/index.hbs b/app/templates/project-version/index.hbs index af49c718..426b869d 100644 --- a/app/templates/project-version/index.hbs +++ b/app/templates/project-version/index.hbs @@ -1,5 +1,7 @@ {{#if (eq @model.id "ember-data")}} +{{else if (eq @model.id "ember-cli")}} + {{else}} {{/if}} diff --git a/app/utils/get-last-version.js b/app/utils/get-last-version.js index 4c3792ad..ac807f27 100644 --- a/app/utils/get-last-version.js +++ b/app/utils/get-last-version.js @@ -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); }); From 095f87a6b10e4f283f33bc35d8e843a4132a6681 Mon Sep 17 00:00:00 2001 From: Chris Manson Date: Fri, 10 Nov 2023 22:55:09 +0000 Subject: [PATCH 2/2] [WIP] do not merge - change branch that is cloned --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index df8a6815..f22d954c 100644 --- a/package.json +++ b/package.json @@ -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",