├── .npmrc ├── app ├── templates │ ├── data-class.hbs │ ├── data-module.hbs │ ├── loading.hbs │ ├── project-version │ │ ├── index.hbs │ │ ├── functions │ │ │ └── function.hbs │ │ └── modules │ │ │ └── module.hbs │ ├── application.hbs │ ├── not-found.hbs │ ├── head.hbs │ ├── ember-cli.hbs │ ├── error.hbs │ └── project-version.hbs ├── components │ ├── api-index-filter.hbs │ ├── import-example.hbs │ ├── api-index.hbs │ ├── events.hbs │ ├── methods.hbs │ ├── properties.hbs │ ├── import-example.js │ ├── loading-spinner.hbs │ ├── class-field-description.js │ ├── table-of-projects.hbs │ ├── scroll-to-top-button.gjs │ ├── api-index.js │ ├── ember-data-landing-page.hbs │ ├── table-of-contents.hbs │ ├── class-field-description.hbs │ ├── ember-landing-page.hbs │ └── api-index-filter.js ├── models │ ├── missing.js │ ├── namespace.js │ ├── project.js │ ├── module.js │ ├── project-version.js │ └── class.js ├── styles │ └── app.css ├── utils │ ├── parent-name.js │ ├── get-compact-version.js │ ├── get-last-version.js │ ├── github-map.js │ ├── create-excerpt.js │ └── get-full-version.js ├── controllers │ ├── class.js │ ├── project-version │ │ ├── namespaces │ │ │ └── namespace.js │ │ ├── index.js │ │ ├── modules │ │ │ └── module.js │ │ └── classes │ │ │ └── class.js │ └── application.js ├── helpers │ ├── eq.js │ ├── function-heading-id.js │ ├── better-get.js │ ├── is-latest.js │ ├── version-lt.js │ └── github-link.js ├── registry.d.ts ├── initializers │ ├── set-global-promise.js │ └── add-string-includes-polyfill.js ├── services │ ├── head-data.js │ ├── filter-data.js │ ├── project.js │ ├── algolia.js │ ├── search.js │ ├── meta-store.js │ └── legacy-module-mappings.js ├── routes │ ├── project-version │ │ ├── index.js │ │ ├── namespaces │ │ │ └── namespace.js │ │ ├── modules │ │ │ └── module.js │ │ ├── functions │ │ │ └── function.js │ │ └── classes │ │ │ └── class.js │ ├── index.js │ ├── project.js │ ├── module.js │ ├── data-class.js │ ├── not-found.js │ ├── data-module.js │ ├── class.js │ └── application.js ├── metrics-adapters │ └── local-adapter.js ├── app.js ├── instance-initializers │ └── ember-meta-store.js ├── deprecation-workflow.js ├── index.html ├── serializers │ └── application.js ├── router.js └── adapters │ └── application.js ├── .watchmanconfig ├── public ├── robots.txt ├── favicon.ico ├── assets │ └── images │ │ ├── link.png │ │ ├── favicon.png │ │ ├── ember-logo.png │ │ ├── stinky-fish.png │ │ ├── launch-icon-1x.png │ │ ├── launch-icon-2x.png │ │ ├── launch-icon-3x.png │ │ ├── launch-icon-4x.png │ │ ├── browserstack-logo.png │ │ ├── launch-icon-0-75x.png │ │ ├── launch-icon-1-5x.png │ │ ├── success.svg │ │ ├── fa-pencil.svg │ │ ├── ribbon-html.svg │ │ ├── heroku-logo.svg │ │ ├── pen.svg │ │ ├── copy.svg │ │ ├── header.svg │ │ ├── link.svg │ │ ├── discord-logo.svg │ │ ├── search-icon.svg │ │ ├── twitter-logo.svg │ │ ├── google-plus-logo.svg │ │ ├── ribbon-js.svg │ │ ├── github-logo.svg │ │ ├── fastly-logo.svg │ │ ├── ribbon-hbs.svg │ │ ├── ember-logo.svg │ │ └── dnsimple-logo-dark.svg └── _redirects ├── .stylelintrc.js ├── .template-lintrc.js ├── .stylelintignore ├── Procfile ├── lib └── api-docs-data │ ├── package.json │ └── index.js ├── config ├── optional-features.json ├── targets.js ├── ember-cli-update.json ├── fastboot.js ├── deploy.js ├── manifest.js └── environment.js ├── tests ├── .eslintrc.js ├── unit │ ├── helpers │ │ ├── eq-test.js │ │ └── github-link-test.js │ ├── services │ │ ├── search-test.js │ │ └── head-data-test.js │ ├── utils │ │ ├── get-compact-version-test.js │ │ ├── get-last-version-test.js │ │ └── create-excerpt-test.js │ └── controllers │ │ └── project-version-test.js ├── helpers │ ├── search-selectors.js │ └── index.js ├── test-helper.js ├── acceptance │ ├── warp-drive-test.js │ ├── release-url-test.js │ ├── title-test.js │ ├── app-layout-test.js │ ├── method-inheritance-test.js │ ├── open-graph-tags-test.js │ ├── redirects-test.js │ ├── percy-test.js │ ├── function-test.js │ ├── link-from-ember-data-to-ember-test.js │ ├── head-test.js │ ├── sidebar-nav-test.js │ ├── search-test.js │ ├── module-test.js │ ├── switch-project-test.js │ ├── convert-legacy-url-to-current-test.js │ └── class-test.js ├── integration │ ├── components │ │ ├── table-of-projects-test.js │ │ ├── loading-spinner-test.js │ │ ├── import-example-test.js │ │ ├── class-field-description-test.js │ │ └── table-of-contents-test.js │ └── helpers │ │ ├── function-heading-id-test.js │ │ ├── better-get-test.js │ │ ├── is-latest-test.js │ │ └── version-lt-test.js └── index.html ├── .prettierrc.js ├── fastboot └── initializers │ └── ajax.js ├── jsconfig.json ├── .eslintignore ├── .ember-cli ├── app.json ├── .prettierignore ├── .editorconfig ├── .github └── workflows │ ├── gh-pages.yml │ └── ci.yml ├── .gitignore ├── LICENSE ├── run-tests.js ├── ember-cli-build.js ├── .eslintrc.js ├── DEPLOYING.md ├── bin └── ember-fastboot ├── testem.js └── README.md /.npmrc: -------------------------------------------------------------------------------- 1 | use-node-version=22.19.0 2 | -------------------------------------------------------------------------------- /app/templates/data-class.hbs: -------------------------------------------------------------------------------- 1 | {{outlet}} 2 | -------------------------------------------------------------------------------- /app/templates/data-module.hbs: -------------------------------------------------------------------------------- 1 | {{outlet}} 2 | -------------------------------------------------------------------------------- /app/templates/loading.hbs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | { 2 | "ignore_dirs": ["tmp", "dist"] 3 | } 4 | -------------------------------------------------------------------------------- /app/components/api-index-filter.hbs: -------------------------------------------------------------------------------- 1 | {{yield this.filteredData}} 2 | -------------------------------------------------------------------------------- /app/components/import-example.hbs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # http://www.robotstxt.org 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-learn/ember-api-docs/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /app/components/api-index.hbs: -------------------------------------------------------------------------------- 1 |
2 | {{yield (hash 3 | sections=this.sections) 4 | }} 5 |
-------------------------------------------------------------------------------- /app/models/missing.js: -------------------------------------------------------------------------------- 1 | import Class from './class'; 2 | 3 | export default class Missing extends Class {} 4 | -------------------------------------------------------------------------------- /.stylelintrc.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | extends: ['stylelint-config-standard'], 5 | }; 6 | -------------------------------------------------------------------------------- /public/assets/images/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-learn/ember-api-docs/HEAD/public/assets/images/link.png -------------------------------------------------------------------------------- /app/styles/app.css: -------------------------------------------------------------------------------- 1 | /* Empty for build pipeline */ 2 | 3 | /* https://github.com/embroider-build/embroider/issues/1358 */ 4 | -------------------------------------------------------------------------------- /public/assets/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-learn/ember-api-docs/HEAD/public/assets/images/favicon.png -------------------------------------------------------------------------------- /.template-lintrc.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node:true */ 2 | 'use strict'; 3 | 4 | module.exports = { 5 | extends: 'recommended', 6 | }; 7 | -------------------------------------------------------------------------------- /app/utils/parent-name.js: -------------------------------------------------------------------------------- 1 | export function parentName(routeName) { 2 | return routeName.split('.').slice(0, 3).join('.'); 3 | } 4 | -------------------------------------------------------------------------------- /public/assets/images/ember-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-learn/ember-api-docs/HEAD/public/assets/images/ember-logo.png -------------------------------------------------------------------------------- /public/assets/images/stinky-fish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-learn/ember-api-docs/HEAD/public/assets/images/stinky-fish.png -------------------------------------------------------------------------------- /app/controllers/class.js: -------------------------------------------------------------------------------- 1 | import Controller from '@ember/controller'; 2 | 3 | export default class ClassController extends Controller {} 4 | -------------------------------------------------------------------------------- /public/assets/images/launch-icon-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-learn/ember-api-docs/HEAD/public/assets/images/launch-icon-1x.png -------------------------------------------------------------------------------- /public/assets/images/launch-icon-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-learn/ember-api-docs/HEAD/public/assets/images/launch-icon-2x.png -------------------------------------------------------------------------------- /public/assets/images/launch-icon-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-learn/ember-api-docs/HEAD/public/assets/images/launch-icon-3x.png -------------------------------------------------------------------------------- /public/assets/images/launch-icon-4x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-learn/ember-api-docs/HEAD/public/assets/images/launch-icon-4x.png -------------------------------------------------------------------------------- /public/assets/images/browserstack-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-learn/ember-api-docs/HEAD/public/assets/images/browserstack-logo.png -------------------------------------------------------------------------------- /public/assets/images/launch-icon-0-75x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-learn/ember-api-docs/HEAD/public/assets/images/launch-icon-0-75x.png -------------------------------------------------------------------------------- /public/assets/images/launch-icon-1-5x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-learn/ember-api-docs/HEAD/public/assets/images/launch-icon-1-5x.png -------------------------------------------------------------------------------- /.stylelintignore: -------------------------------------------------------------------------------- 1 | # unconventional files 2 | /blueprints/*/files/ 3 | 4 | # compiled output 5 | /dist/ 6 | 7 | # addons 8 | /.node_modules.ember-try/ 9 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: ./bin/ember-fastboot tmp/deploy-dist --port $PORT 2 | release: npm i -g fastly-cli && fastly purge-all -k $FASTLY_PURGE_KEY -s $FASTLY_SERVICE_ID -------------------------------------------------------------------------------- /app/utils/get-compact-version.js: -------------------------------------------------------------------------------- 1 | export default function getCompactVersion(fullVersion) { 2 | return fullVersion.split('.').slice(0, 2).join('.'); 3 | } 4 | -------------------------------------------------------------------------------- /app/controllers/project-version/namespaces/namespace.js: -------------------------------------------------------------------------------- 1 | import ClassController from '../classes/class'; 2 | 3 | export default class NamespaceController extends ClassController {} 4 | -------------------------------------------------------------------------------- /app/helpers/eq.js: -------------------------------------------------------------------------------- 1 | import { helper } from '@ember/component/helper'; 2 | 3 | export function eq(params) { 4 | return params[0] === params[1]; 5 | } 6 | 7 | export default helper(eq); 8 | -------------------------------------------------------------------------------- /app/templates/project-version/index.hbs: -------------------------------------------------------------------------------- 1 | {{#if (eq @model.project "ember-data")}} 2 | 3 | {{else}} 4 | 5 | {{/if}} 6 | -------------------------------------------------------------------------------- /lib/api-docs-data/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "api-docs-data", 3 | "keywords": [ 4 | "ember-addon" 5 | ], 6 | "peerDependencies": { 7 | "broccoli-funnel": "*" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /config/optional-features.json: -------------------------------------------------------------------------------- 1 | { 2 | "application-template-wrapper": false, 3 | "default-async-observers": true, 4 | "jquery-integration": false, 5 | "template-only-glimmer-components": true 6 | } 7 | -------------------------------------------------------------------------------- /tests/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | module.exports = { 3 | globals: { 4 | currentURL: true, 5 | pauseTest: true, 6 | selectChoose: true, 7 | selectSearch: true, 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /app/models/namespace.js: -------------------------------------------------------------------------------- 1 | import { belongsTo } from '@ember-data/model'; 2 | import ClassModel from './class'; 3 | 4 | export default class Namespace extends ClassModel { 5 | @belongsTo('project-version', { inverse: 'namespaces' }) 6 | projectVersion; 7 | } 8 | -------------------------------------------------------------------------------- /app/templates/application.hbs: -------------------------------------------------------------------------------- 1 | {{page-title "Ember API Documentation"}} 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | {{outlet}} 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/components/events.hbs: -------------------------------------------------------------------------------- 1 | 2 | {{#each filteredModel.events as |event|}} 3 | 4 | {{/each}} 5 | 6 | -------------------------------------------------------------------------------- /app/templates/project-version/functions/function.hbs: -------------------------------------------------------------------------------- 1 | {{page-title @model.fn.name}} 2 |
3 |

Function

4 |
5 | 6 |
7 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | plugins: ['prettier-plugin-ember-template-tag'], 5 | overrides: [ 6 | { 7 | files: '*.{js,ts,gjs,gts}', 8 | options: { 9 | singleQuote: true, 10 | }, 11 | }, 12 | ], 13 | }; 14 | -------------------------------------------------------------------------------- /app/components/methods.hbs: -------------------------------------------------------------------------------- 1 | 2 | {{#each filteredModel.methods as |method|}} 3 | 4 | {{/each}} 5 | 6 | -------------------------------------------------------------------------------- /config/targets.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const browsers = [ 4 | 'last 1 Chrome versions', 5 | 'last 1 Firefox versions', 6 | 'last 1 Safari versions', 7 | 'last 1 Edge versions', 8 | ]; 9 | 10 | module.exports = { 11 | browsers, 12 | node: 'current', 13 | }; 14 | -------------------------------------------------------------------------------- /app/components/properties.hbs: -------------------------------------------------------------------------------- 1 | 2 | {{#each filteredModel.properties as |property|}} 3 | 4 | {{/each}} 5 | 6 | -------------------------------------------------------------------------------- /app/models/project.js: -------------------------------------------------------------------------------- 1 | import Model, { hasMany, attr } from '@ember-data/model'; 2 | 3 | export default class Project extends Model { 4 | @attr() 5 | name; 6 | 7 | @attr() 8 | githubUrl; 9 | 10 | @hasMany('project-version', { async: true }) 11 | projectVersions; 12 | } 13 | -------------------------------------------------------------------------------- /app/components/import-example.js: -------------------------------------------------------------------------------- 1 | import Component from '@glimmer/component'; 2 | 3 | export default class ImportExample extends Component { 4 | get markdown() { 5 | let md = `\`\`\`js 6 | import ${this.args.item} from '${this.args.package}'; 7 | \`\`\``; 8 | return md; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/unit/helpers/eq-test.js: -------------------------------------------------------------------------------- 1 | import { eq } from 'ember-api-docs/helpers/eq'; 2 | import { module, test } from 'qunit'; 3 | 4 | module('Unit | Helper | eq', function () { 5 | test('it works', function (assert) { 6 | let result = eq([404, 404]); 7 | assert.ok(result); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /app/components/loading-spinner.hbs: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{yield}} 9 |
-------------------------------------------------------------------------------- /app/helpers/function-heading-id.js: -------------------------------------------------------------------------------- 1 | import { helper } from '@ember/component/helper'; 2 | import { A } from '@ember/array'; 3 | 4 | export function functionHeadingId([heading] /*, hash*/) { 5 | return `functions-${A(heading.split('/')).get('lastObject')}`; 6 | } 7 | 8 | export default helper(functionHeadingId); 9 | -------------------------------------------------------------------------------- /fastboot/initializers/ajax.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: 'ajax-service', 3 | initialize() { 4 | // noop 5 | // This is to override Fastboot's initializer which prevents ember-fetch from working 6 | // https://github.com/ember-fastboot/ember-cli-fastboot/blob/master/fastboot/initializers/ajax.js 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@tsconfig/ember", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "paths": { 6 | "ember-api-docs/*": [ 7 | "app/*" 8 | ] 9 | } 10 | }, 11 | "glint": { 12 | "environment": "ember-loose", 13 | "checkStandaloneTemplates": false 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/registry.d.ts: -------------------------------------------------------------------------------- 1 | import ApiIndex from './components/api-index'; 2 | import ApiIndexFilter from './components/api-index-filter'; 3 | 4 | declare module '@glint/environment-ember-loose/registry' { 5 | export default interface Registry { 6 | ApiIndex: typeof ApiIndex; 7 | ApiIndexFilter: typeof ApiIndexFilter; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /app/helpers/better-get.js: -------------------------------------------------------------------------------- 1 | import { helper } from '@ember/component/helper'; 2 | 3 | /** 4 | * gives a similar functionality to the get helper, but it supports dot separated 5 | * object keys. 6 | */ 7 | export function betterGet(params /*, hash*/) { 8 | return params[0][params[1]]; 9 | } 10 | 11 | export default helper(betterGet); 12 | -------------------------------------------------------------------------------- /tests/helpers/search-selectors.js: -------------------------------------------------------------------------------- 1 | export default { 2 | input: '[data-test-search-input]', 3 | dropdown: '[data-test-search-dropdown]', 4 | searchResult: '[data-test-search-result]', 5 | screenReaderContent: '[data-test-screen-reader]', 6 | noResults: '[data-test-search-no-results]', 7 | searchLabel: '[data-test-search-label]', 8 | }; 9 | -------------------------------------------------------------------------------- /app/initializers/set-global-promise.js: -------------------------------------------------------------------------------- 1 | import RSVP from 'rsvp'; 2 | 3 | export function initialize() { 4 | // async/await is using window.Promise by default and we want async/await to 5 | // use RSVP instead which is properly integrated with Ember's runloop 6 | window.Promise = RSVP.Promise; 7 | } 8 | 9 | export default { initialize }; 10 | -------------------------------------------------------------------------------- /app/helpers/is-latest.js: -------------------------------------------------------------------------------- 1 | import { helper } from '@ember/component/helper'; 2 | import getLastVersion from 'ember-api-docs/utils/get-last-version'; 3 | 4 | export function isLatest(params, { version, allVersions }) { 5 | let latestVersion = getLastVersion(allVersions); 6 | return version === latestVersion; 7 | } 8 | 9 | export default helper(isLatest); 10 | -------------------------------------------------------------------------------- /app/templates/not-found.hbs: -------------------------------------------------------------------------------- 1 | {{page-title "Page Not Found"}} 2 | 3 |
4 | tomster stinky fish 5 |
6 |

Ack! 404 friend, you're in the wrong place

7 | Click here to go home 8 |
9 |
10 | -------------------------------------------------------------------------------- /tests/unit/services/search-test.js: -------------------------------------------------------------------------------- 1 | import { module, test } from 'qunit'; 2 | import { setupTest } from 'ember-qunit'; 3 | 4 | module('Unit | Service | search', function (hooks) { 5 | setupTest(hooks); 6 | 7 | test('it exists', function (assert) { 8 | let service = this.owner.lookup('service:search'); 9 | assert.ok(service); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /app/services/head-data.js: -------------------------------------------------------------------------------- 1 | import Service from '@ember/service'; 2 | import { tracked } from '@glimmer/tracking'; 3 | 4 | export default class HeadDataService extends Service { 5 | @tracked title; 6 | @tracked isRelease; 7 | @tracked compactVersion; 8 | @tracked urlVersion; 9 | @tracked canonicalUrl; 10 | @tracked description; 11 | @tracked cdnDomain; 12 | } 13 | -------------------------------------------------------------------------------- /app/routes/project-version/index.js: -------------------------------------------------------------------------------- 1 | import Route from '@ember/routing/route'; 2 | 3 | export default class IndexRoute extends Route { 4 | async model() { 5 | const projectVersion = this.modelFor('project-version'); 6 | 7 | return { 8 | project: projectVersion.belongsTo('project').id(), 9 | version: projectVersion.version, 10 | }; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /app/templates/head.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{#if this.model.description}} 4 | 5 | 6 | {{/if}} 7 | 8 | {{#unless this.model.isRelease}} 9 | 10 | {{/unless}} -------------------------------------------------------------------------------- /app/utils/get-last-version.js: -------------------------------------------------------------------------------- 1 | import semverCompare from 'semver-compare'; 2 | 3 | export default function getLastVersion(projectVersions) { 4 | const sortedVersions = projectVersions 5 | .map((v) => v.replace(/ember-data-|ember-/g, '')) 6 | .sort((v1, v2) => { 7 | return semverCompare(v1, v2); 8 | }); 9 | return sortedVersions[sortedVersions.length - 1]; 10 | } 11 | -------------------------------------------------------------------------------- /public/assets/images/success.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/api-docs-data/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Funnel = require('broccoli-funnel'); 4 | 5 | module.exports = { 6 | name: require('./package').name, 7 | 8 | isDevelopingAddon() { 9 | return true; 10 | }, 11 | 12 | treeForPublic() { 13 | return new Funnel('ember-api-docs-data', { 14 | include: ['**/json-docs/**', '**/rev-index/**'], 15 | }); 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /tests/test-helper.js: -------------------------------------------------------------------------------- 1 | import Application from 'ember-api-docs/app'; 2 | import config from 'ember-api-docs/config/environment'; 3 | import * as QUnit from 'qunit'; 4 | import { setApplication } from '@ember/test-helpers'; 5 | import { setup } from 'qunit-dom'; 6 | import { start } from 'ember-qunit'; 7 | setApplication(Application.create(config.APP)); 8 | 9 | setup(QUnit.assert); 10 | 11 | start(); 12 | -------------------------------------------------------------------------------- /tests/unit/services/head-data-test.js: -------------------------------------------------------------------------------- 1 | import { module, test } from 'qunit'; 2 | import { setupTest } from 'ember-qunit'; 3 | 4 | module('Unit | Service | head-data', function (hooks) { 5 | setupTest(hooks); 6 | 7 | // TODO: Replace this with your real tests. 8 | test('it exists', function (assert) { 9 | let service = this.owner.lookup('service:head-data'); 10 | assert.ok(service); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /app/components/class-field-description.js: -------------------------------------------------------------------------------- 1 | import { inject as service } from '@ember/service'; 2 | import Component from '@glimmer/component'; 3 | 4 | export default class ClassFieldDescription extends Component { 5 | @service 6 | legacyModuleMappings; 7 | 8 | get hasImportExample() { 9 | return this.legacyModuleMappings.hasFunctionMapping( 10 | this.args.field.name, 11 | this.args.field.class, 12 | ); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/services/filter-data.js: -------------------------------------------------------------------------------- 1 | import Service from '@ember/service'; 2 | 3 | export default class FilterDataService extends Service { 4 | // These attributes are not @tracked because they are used in computed 5 | // properties and not directly in templates. 6 | showInherited = false; 7 | showProtected = false; 8 | showPrivate = false; 9 | showDeprecated = false; 10 | 11 | sideNav = { 12 | showPrivate: false, 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /tests/unit/utils/get-compact-version-test.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable qunit/no-assert-equal */ 2 | import getCompactVersion from 'ember-api-docs/utils/get-compact-version'; 3 | import { module, test } from 'qunit'; 4 | 5 | module('Unit | Utility | get compact version', function () { 6 | test('should trim off patch version', function (assert) { 7 | let result = getCompactVersion('2.17.0'); 8 | assert.equal(result, '2.17'); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /app/services/project.js: -------------------------------------------------------------------------------- 1 | import Service from '@ember/service'; 2 | import { tracked } from '@glimmer/tracking'; 3 | 4 | export default class ProjectService extends Service { 5 | @tracked version = '0.0.0'; 6 | @tracked urlVersion; 7 | 8 | setVersion(version) { 9 | this.version = version; 10 | } 11 | 12 | setUrlVersion(version) { 13 | this.urlVersion = version; 14 | } 15 | 16 | getUrlVersion() { 17 | return this.urlVersion; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/utils/github-map.js: -------------------------------------------------------------------------------- 1 | import semverCompare from 'semver-compare'; 2 | 3 | export const mainDir = function (project, version) { 4 | if (project === 'ember') { 5 | return '/'; 6 | } 7 | if (project === 'ember-data') { 8 | if (semverCompare(version, '3.11') === -1) { 9 | return '/'; 10 | } 11 | return '/packages/-ember-data/'; 12 | } 13 | }; 14 | 15 | export default { 16 | ember: 'emberjs/ember.js', 17 | 'ember-data': 'emberjs/data', 18 | }; 19 | -------------------------------------------------------------------------------- /public/assets/images/fa-pencil.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /public/assets/images/ribbon-html.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /config/ember-cli-update.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": "1.0.0", 3 | "packages": [ 4 | { 5 | "name": "ember-cli", 6 | "version": "4.12.3", 7 | "blueprints": [ 8 | { 9 | "name": "app", 10 | "outputRepo": "https://github.com/ember-cli/ember-new-output", 11 | "codemodsSource": "ember-app-codemods-manifest@1", 12 | "isBaseBlueprint": true, 13 | "options": ["--no-welcome", "--pnpm"] 14 | } 15 | ] 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | # unconventional js 2 | /blueprints/*/files/ 3 | /vendor/ 4 | 5 | # compiled output 6 | /dist/ 7 | /tmp/ 8 | 9 | # dependencies 10 | /bower_components/ 11 | /node_modules/ 12 | 13 | # misc 14 | /coverage/ 15 | !.* 16 | .*/ 17 | .eslintcache 18 | 19 | # data git checkout 20 | /ember-api-docs-data/ 21 | 22 | # ember-try 23 | /.node_modules.ember-try/ 24 | /bower.json.ember-try 25 | /npm-shrinkwrap.json.ember-try 26 | /package.json.ember-try 27 | /package-lock.json.ember-try 28 | /yarn.lock.ember-try 29 | -------------------------------------------------------------------------------- /app/templates/ember-cli.hbs: -------------------------------------------------------------------------------- 1 | {{page-title "Ember CLI - Ember API Documentation"}} 2 | 3 | 13 | -------------------------------------------------------------------------------- /tests/acceptance/warp-drive-test.js: -------------------------------------------------------------------------------- 1 | import { module, test } from 'qunit'; 2 | import { setupApplicationTest } from 'ember-qunit'; 3 | import { visit } from '@ember/test-helpers'; 4 | 5 | module('Acceptance | WarpDrive', function (hooks) { 6 | setupApplicationTest(hooks); 7 | 8 | test('can visit a @warp-drive package', async function (assert) { 9 | await visit('/ember-data/release/modules/@warp-drive%2Fbuild-config'); 10 | 11 | assert.dom('.module-name').includesText('Package @warp-drive/build-config'); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /app/models/module.js: -------------------------------------------------------------------------------- 1 | import { belongsTo, attr } from '@ember-data/model'; 2 | import ClassModel from './class'; 3 | 4 | export default class Module extends ClassModel { 5 | @attr() 6 | submodules; 7 | 8 | @attr() 9 | publicclasses; 10 | 11 | @attr() 12 | privateclasses; 13 | 14 | @attr() 15 | namespaces; 16 | 17 | @attr() 18 | parent; 19 | 20 | @attr() 21 | staticfunctions; 22 | 23 | @attr() 24 | allstaticfunctions; 25 | 26 | @belongsTo('project-version', { inverse: 'modules' }) 27 | projectVersion; 28 | } 29 | -------------------------------------------------------------------------------- /public/assets/images/heroku-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/acceptance/release-url-test.js: -------------------------------------------------------------------------------- 1 | import { visit } from '@ember/test-helpers'; 2 | import { module, test } from 'qunit'; 3 | import { setupApplicationTest } from 'ember-qunit'; 4 | 5 | module('Acceptance | release URL', function (hooks) { 6 | setupApplicationTest(hooks); 7 | 8 | test('specifying release instead of specific version in URL should go to the latest release', async function (assert) { 9 | await visit('ember/release/classes/Application'); 10 | assert.dom('h1.module-name').includesText('Class Application'); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /app/utils/create-excerpt.js: -------------------------------------------------------------------------------- 1 | import sanitizeHtml from 'sanitize-html'; 2 | 3 | export default function createExcerpt(string, maxLength = 300) { 4 | // Stop at first code example 5 | string = string.split(' maxLength) { 15 | excerpt = excerpt.slice(0, maxLength - 1) + '…'; 16 | } 17 | 18 | return excerpt; 19 | } 20 | -------------------------------------------------------------------------------- /tests/acceptance/title-test.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable qunit/no-assert-equal */ 2 | import { visit } from '@ember/test-helpers'; 3 | import { module, test } from 'qunit'; 4 | import { setupApplicationTest } from 'ember-qunit'; 5 | 6 | module('Acceptance | document title', function (hooks) { 7 | setupApplicationTest(hooks); 8 | 9 | test('is of format className - version - Ember API Docs', async function (assert) { 10 | await visit('/ember/1.0/classes/Container'); 11 | assert.equal(document.title, 'Container | 1.0.0 | Ember API Documentation'); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /public/assets/images/pen.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.ember-cli: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | Ember CLI sends analytics information by default. The data is completely 4 | anonymous, but there are times when you might want to disable this behavior. 5 | 6 | Setting `disableAnalytics` to true will prevent any data from being sent. 7 | */ 8 | "disableAnalytics": false, 9 | 10 | /** 11 | Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript 12 | rather than JavaScript by default, when a TypeScript version of a given blueprint is available. 13 | */ 14 | "isTypeScriptProject": false 15 | } 16 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ember-api-docs", 3 | "scripts": {}, 4 | "env": { 5 | "FASTLY_API_KEY": { 6 | "required": false 7 | }, 8 | "FASTLY_SERVICE_ID": { 9 | "required": false 10 | }, 11 | "HEROKU_EMBER_CLI_DEPLOY": { 12 | "required": false 13 | }, 14 | "WORKER_COUNT": { 15 | "required": false 16 | } 17 | }, 18 | "formation": {}, 19 | "addons": [], 20 | "buildpacks": [ 21 | { 22 | "url": "https://buildpack-registry.s3.amazonaws.com/buildpacks/aedev/emberjs.tgz" 23 | } 24 | ], 25 | "stack": "heroku-20" 26 | } 27 | -------------------------------------------------------------------------------- /tests/integration/components/table-of-projects-test.js: -------------------------------------------------------------------------------- 1 | import { module, test } from 'qunit'; 2 | import { setupRenderingTest } from 'ember-qunit'; 3 | import { render } from '@ember/test-helpers'; 4 | import { hbs } from 'ember-cli-htmlbars'; 5 | 6 | module('Integration | Component | table-of-projects', function (hooks) { 7 | setupRenderingTest(hooks); 8 | 9 | test('it renders', async function (assert) { 10 | await render(hbs``); 11 | assert.dom(this.element).hasText('Home Projects Ember EmberData Ember CLI'); 12 | // The functional test for this is in acceptance/switch-project-test.js 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /tests/integration/helpers/function-heading-id-test.js: -------------------------------------------------------------------------------- 1 | import { module, test } from 'qunit'; 2 | import { setupRenderingTest } from 'ember-qunit'; 3 | import { render } from '@ember/test-helpers'; 4 | import hbs from 'htmlbars-inline-precompile'; 5 | 6 | module('helper:function-heading-id', function (hooks) { 7 | setupRenderingTest(hooks); 8 | 9 | test('should transform nested package to id', async function (assert) { 10 | this.set('inputValue', '@ember/object/computed'); 11 | 12 | await render(hbs`{{function-heading-id this.inputValue}}`); 13 | 14 | assert.dom(this.element).hasText('functions-computed'); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # unconventional js 2 | /blueprints/*/files/ 3 | /vendor/ 4 | 5 | # compiled output 6 | /dist/ 7 | /tmp/ 8 | 9 | # dependencies 10 | /bower_components/ 11 | /node_modules/ 12 | 13 | # misc 14 | /coverage/ 15 | !.* 16 | .eslintcache 17 | .lint-todo/ 18 | 19 | # ember-try 20 | /.node_modules.ember-try/ 21 | /bower.json.ember-try 22 | /npm-shrinkwrap.json.ember-try 23 | /package.json.ember-try 24 | /package-lock.json.ember-try 25 | /yarn.lock.ember-try 26 | 27 | # Misc files 28 | *.md 29 | pnpm-lock.yaml 30 | jsconfig.json 31 | 32 | # api docs data 33 | /ember-api-docs-data/ 34 | 35 | 36 | # hbs -- no point to prettier before moving to