Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into merge-main
Browse files Browse the repository at this point in the history
# Conflicts:
#	package.json
#	pnpm-lock.yaml
  • Loading branch information
mansona committed Jul 24, 2024
2 parents 2acdbee + f50f4fe commit f4d0252
Show file tree
Hide file tree
Showing 15 changed files with 11,012 additions and 8,943 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ jobs:
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
Expand All @@ -47,9 +44,6 @@ jobs:
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ locally yourself.
```
git clone https://github.com/ember-learn/ember-api-docs.git
cd ember-api-docs
npm install
npm run clone
npm run start
pnpm install
pnpm run clone
pnpm run start
```

View at http://localhost:4200

### Run locally with a sym-link
Expand All @@ -64,8 +65,8 @@ git clone https://github.com/ember-learn/ember-api-docs-data
git clone https://github.com/ember-learn/ember-api-docs
cd ember-api-docs
ln -s ../ember-api-docs-data
npm install
npm start
pnpm install
pnpm start
```

Visit the app in your browser at [http://localhost:4200](http://localhost:4200)
Expand All @@ -76,9 +77,9 @@ To run a11y tests, run `test_a11y=yes ember serve`

## Linting

* `npm run lint:hbs`
* `npm run lint:js`
* `npm run lint:js -- --fix`
* `pnpm run lint:hbs`
* `pnpm run lint:js`
* `pnpm run lint:js -- --fix`

## Staging and Deployment

Expand Down
9 changes: 2 additions & 7 deletions app/adapters/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,8 @@ export default class Application extends JSONAPIAdapter {
return false;
}

shouldBackgroundReloadRecord(store, { modelName, id }) {
let key = `${modelName}-${id}`;
let hasId = this.ids[key];
if (!hasId) {
this.ids[key] = true;
}
return !hasId;
shouldBackgroundReloadRecord() {
return false;
}

constructor() {
Expand Down
2 changes: 2 additions & 0 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from 'ember-api-docs/config/environment';

import './deprecation-workflow';

export default class App extends Application {
modulePrefix = config.modulePrefix;
podModulePrefix = config.podModulePrefix;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
self.deprecationWorkflow = self.deprecationWorkflow || {};
self.deprecationWorkflow.config = {
import setupDeprecationWorkflow from 'ember-cli-deprecation-workflow';

setupDeprecationWorkflow({
workflow: [
{ handler: 'silence', matchId: 'ember-global' },
{ handler: 'silence', matchId: 'ember.component.reopen' },
{ handler: 'silence', matchId: 'implicit-injections' },
{ handler: 'silence', matchId: 'manager-capabilities.modifiers-3-13' },
{ handler: 'silence', matchId: 'this-property-fallback' },
{ handler: 'silence', matchId: 'ember-component.is-visible' },
{
handler: 'silence',
matchId: 'deprecated-run-loop-and-computed-dot-access',
},
],
};
});
20 changes: 7 additions & 13 deletions app/routes/class.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,13 @@ export default class ClassRoute extends Route {
legacyModuleMappings;

model(params) {
return this.legacyModuleMappings
.fetch()
.then((response) => response.json())
.then((mappings) => {
let ret = {
mappings: this.legacyModuleMappings.buildMappings(mappings),
className: params['class'].substr(
0,
params['class'].lastIndexOf('.')
),
};
return ret;
});
let ret = {
mappings: this.legacyModuleMappings.buildMappings(
this.legacyModuleMappings.legacyMappings
),
className: params['class'].substr(0, params['class'].lastIndexOf('.')),
};
return ret;
}

redirect(model) {
Expand Down
18 changes: 6 additions & 12 deletions app/routes/data-class.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,12 @@ export default class DataClassRoute extends Route {
legacyModuleMappings;

model(params) {
return this.legacyModuleMappings
.fetch()
.then((response) => response.json())
.then((mappings) => {
return {
mappings: this.legacyModuleMappings.buildMappings(mappings),
className: params['class'].substr(
0,
params['class'].lastIndexOf('.')
),
};
});
return {
mappings: this.legacyModuleMappings.buildMappings(
this.legacyModuleMappings.legacyMappings
),
className: params['class'].substr(0, params['class'].lastIndexOf('.')),
};
}

redirect(model) {
Expand Down
15 changes: 6 additions & 9 deletions app/routes/data-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@ export default class DataModuleRoute extends Route {
legacyModuleMappings;

model(params) {
return this.legacyModuleMappings
.fetch()
.then((response) => response.json())
.then((mappings) => {
return {
moduleName: params.module.substr(0, params.module.lastIndexOf('.')),
mappings: this.legacyModuleMappings.buildMappings(mappings),
};
});
return {
moduleName: params.module.substr(0, params.module.lastIndexOf('.')),
mappings: this.legacyModuleMappings.buildMappings(
this.legacyModuleMappings.legacyMappings
),
};
}

redirect(model) {
Expand Down
15 changes: 6 additions & 9 deletions app/routes/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@ export default class ModuleRoute extends Route {
legacyModuleMappings;

model(params) {
return this.legacyModuleMappings
.fetch()
.then((response) => response.json())
.then((mappings) => {
return {
moduleName: params.module.substr(0, params.module.lastIndexOf('.')),
mappings: this.legacyModuleMappings.buildMappings(mappings),
};
});
return {
moduleName: params.module.substr(0, params.module.lastIndexOf('.')),
mappings: this.legacyModuleMappings.buildMappings(
this.legacyModuleMappings.legacyMappings
),
};
}

redirect(model) {
Expand Down
5 changes: 4 additions & 1 deletion app/routes/project-version/classes/class.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export default class ClassRoute extends Route.extend(ScrollTracker) {
this.metaStore
);
const klass = params['class'];
return this.find('class', `${project}-${projectVersion}-${klass}`);
return this.find(
'class',
`${project}-${projectVersion}-${klass}`.toLowerCase()
);
}

find(typeName, param) {
Expand Down
12 changes: 4 additions & 8 deletions app/services/legacy-module-mappings.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import fetch from 'fetch';
import Service from '@ember/service';
import { tracked } from '@glimmer/tracking';

import legacyMappings from 'ember-rfc176-data/mappings.json';

const LOCALNAME_CONVERSIONS = {
Object: 'EmberObject',
Array: 'EmberArray',
Expand All @@ -10,12 +11,11 @@ const LOCALNAME_CONVERSIONS = {

export default class LegacyModuleMappingsService extends Service {
@tracked mappings;
legacyMappings = legacyMappings;

async initMappings() {
try {
let response = await this.fetch();
let mappings = await response.json();
let newMappings = this.buildMappings(mappings);
let newMappings = this.buildMappings(legacyMappings);
this.mappings = newMappings;
} catch (e) {
this.mappings = [];
Expand All @@ -32,10 +32,6 @@ export default class LegacyModuleMappingsService extends Service {
});
}

fetch() {
return fetch('/assets/mappings.json');
}

getModule(name, documentedModule) {
if (!this.mappings) {
return '';
Expand Down
10 changes: 1 addition & 9 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const Funnel = require('broccoli-funnel');
const mergeTrees = require('broccoli-merge-trees');
const envIsProduction = process.env.EMBER_ENV === 'production';
const premberUrls = require('./prember-urls');

Expand Down Expand Up @@ -38,12 +36,6 @@ module.exports = function (defaults) {
},
});

let mappingsTree = new Funnel('node_modules/ember-rfc176-data/', {
srcDir: '/',
include: ['mappings.json'],
destDir: '/assets/',
});

const { Webpack } = require('@embroider/webpack');
const appTree = require('@embroider/compat').compatBuild(app, Webpack, {
staticAddonTrees: true,
Expand All @@ -53,5 +45,5 @@ module.exports = function (defaults) {
staticComponents: true,
});

return mergeTrees([require('prember').prerender(app, appTree), mappingsTree]);
return require('prember').prerender(app, appTree);
};
22 changes: 14 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,20 @@
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"broccoli-funnel": "^2.0.1",
"broccoli-merge-trees": "^2.0.0",
"ember-a11y-testing": "^0.5.4",
"ember-a11y-testing": "^5.2.1",
"ember-anchor": "^1.0.3",
"ember-auto-import": "^2.7.2",
"ember-cli": "~3.28.6",
"ember-cli-app-version": "^5.0.0",
"ember-cli-autoprefixer": "^1.0.0",
"ember-cli-babel": "^7.26.10",
"ember-cli-browserstack": "^1.0.1",
"ember-cli-clipboard": "^0.8.1",
"ember-cli-clipboard": "^1.1.0",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-deploy": "^1.0.1",
"ember-cli-deploy-build": "^1.1.0",
"ember-cli-deploy-gzip": "^1.0.0",
"ember-cli-deprecation-workflow": "^2.1.0",
"ember-cli-deprecation-workflow": "^3.0.1",
"ember-cli-document-title-northm": "^1.0.3",
"ember-cli-fastboot": "^4.1.5",
"ember-cli-htmlbars": "^6.1.1",
Expand All @@ -87,16 +86,16 @@
"ember-decorators": "^6.1.1",
"ember-export-application-global": "^2.0.1",
"ember-fetch": "^8.1.1",
"ember-inflector": "^3.0.0",
"ember-inflector": "^4.0.3",
"ember-load-initializers": "^2.1.2",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-metrics": "^1.5.2",
"ember-page-title": "^6.2.2",
"ember-power-select": "^6.0.1",
"ember-power-select": "^7.2.0",
"ember-qunit": "^5.1.5",
"ember-resolver": "^8.0.3",
"ember-rfc176-data": "^0.3.17",
"ember-route-action-helper": "^2.0.5",
"ember-route-action-helper": "^2.0.8",
"ember-showdown-shiki": "^1.2.1",
"ember-sinon": "^4.1.1",
"ember-source": "~3.28.8",
Expand Down Expand Up @@ -161,5 +160,12 @@
"paths": [
"lib/api-docs-data"
]
}
},
"pnpm": {
"overrides": {
"node-sass": "^9.0.0",
"ember-truth-helpers": "^4.0.0"
}
},
"packageManager": "[email protected]"
}
Loading

0 comments on commit f4d0252

Please sign in to comment.