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

Merge master into redesign #910

Merged
merged 20 commits into from
Jun 19, 2024
Merged
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
40 changes: 21 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:

env:
NODE_VERSION: 14
NODE_VERSION: 20
PERCY_PARALLEL_NONCE: ${{ github.run_id }}-${{ github.run_number }}
PERCY_PARALLEL_TOTAL: 1

Expand All @@ -18,24 +18,24 @@ jobs:
timeout-minutes: 5
steps:
- name: Check out a copy of the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Check lockfile version
uses: mansona/npm-lockfile-version@v1
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
cache: 'npm'
cache: 'pnpm'
node-version: ${{ env.NODE_VERSION }}

- run: npm i -g npm@9

- name: Install dependencies
run: npm ci
run: pnpm i --frozen-lockfile

- name: Lint
run: npm run lint
run: pnpm run lint


test-app:
Expand All @@ -44,24 +44,26 @@ jobs:
timeout-minutes: 10
steps:
- name: Check out a copy of the repo
uses: actions/checkout@v3
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@v3
uses: actions/setup-node@v4
with:
cache: 'npm'
cache: 'pnpm'
node-version: ${{ env.NODE_VERSION }}

- run: npm i -g npm@9

- name: Install dependencies
run: npm ci
- run: pnpm install --frozen-lockfile

- run: npm run clone
- run: pnpm run clone

- name: Test
env:
PERCY_PARALLEL_NONCE: ${{ env.PERCY_PARALLEL_NONCE }}
PERCY_PARALLEL_TOTAL: ${{ env.PERCY_PARALLEL_TOTAL }}
PERCY_TOKEN: 5ad6687f6b1ad3dec2b964f94d3d59ff3880baccf1492c0663e85c1ce79c1a52
run: npx percy exec -- npm run test:ember
run: pnpm percy exec -- pnpm run test:ember
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use-node-version=20.14.0
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ Some tips for working with git/GitHub can be found in

Please also see [CONTRIBUTING.md](CONTRIBUTING.md).

## Quickstart to run semi-locally
## Running in your local environment

ember-api-docs expects a folder in its root that links to the `ember-api-docs-data` folder, so you can either use the `npm run clone` script to clone the `ember-api-docs-data` repo into `ember-api-docs`, OR you can create a symbolic link to `ember-api-docs-data` from `ember-api-docs`. You might want to sym-link `ember-api-docs-data` if you are generating new versions of the docs files with `ember-jsonapi-docs`, otherwise you can probably use the clone script.

### Quickstart to run locally

Follow these instructions to run the app using publically available online data.
You do not need to run [ember-jsonapi-docs](https://github.com/ember-learn/ember-jsonapi-docs)
Expand All @@ -43,10 +47,29 @@ locally yourself.
git clone https://github.com/ember-learn/ember-api-docs.git
cd ember-api-docs
npm install
ember serve
npm run clone
npm run start
```
View at http://localhost:4200

### Run locally with a sym-link

Clone all of the following repositories into the same directory so they are "siblings" on the file system:

- This repository, `ember-api-docs`
- [ember-api-docs-data](https://github.com/ember-learn/ember-api-docs-data)

```sh
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
```

Visit the app in your browser at [http://localhost:4200](http://localhost:4200)

## a11y testing

To run a11y tests, run `test_a11y=yes ember serve`
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion app/components/ember-data-landing-page.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<<article class="chapter">
<article class="chapter">
<h1>
Ember Data API Documentation
</h1>
Expand Down
16 changes: 4 additions & 12 deletions app/services/algolia.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
import Service from '@ember/service';
import algoliasearch from 'algoliasearch';
import config from 'ember-api-docs/config/environment';
import { denodeify } from 'rsvp';

export default class AlgoliaService extends Service {
_search(query, params, callback) {
if (!callback) {
callback = params;
params = undefined;
}
async search(query, params) {
if (query) {
if (Array.isArray(query) && !params) {
// if multiple indices
this._client.search(query, callback);
return this._client.search(query);
} else if (!params) {
// if no params
this.accessIndex(query.indexName).search(query.query, callback);
return this.accessIndex(query.indexName).search(query.query);
} else {
// if params and callback
this.accessIndex(query.indexName).search(query.query, params, callback);
return this.accessIndex(query.indexName).search(query.query, params);
}
} else {
callback(new Error(`Could not search algolia for query "${query}"`));
}
}

Expand All @@ -39,6 +32,5 @@ export default class AlgoliaService extends Service {
config.algolia.algoliaKey
);
this._indices = {};
this.search = denodeify(this._search.bind(this));
}
}
3 changes: 2 additions & 1 deletion config/ember-cli-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"codemodsSource": "ember-app-codemods-manifest@1",
"isBaseBlueprint": true,
"options": [
"--no-welcome"
"--no-welcome",
"--pnpm"
]
}
]
Expand Down
7 changes: 0 additions & 7 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ module.exports = function (defaults) {
extensions: ['js', 'css', 'jpg', 'png', 'gif', 'map', 'webmanifest'],
generateAssetMap: true,
},
autoImport: {
webpack: {
node: {
process: 'mock',
},
},
},
autoprefixer: {
enabled: true,
cascade: true,
Expand Down
Loading