Skip to content

Commit dc6af63

Browse files
committed
chore(deps): update dependencies
1 parent faca344 commit dc6af63

File tree

10 files changed

+1480
-1456
lines changed

10 files changed

+1480
-1456
lines changed

.eslintrc.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

.npmignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
/.ember-cli
88
/.env*
99
/.eslintcache
10-
/.eslintignore
11-
/.eslintrc.js
1210
/.git/
1311
/.github/
1412
/.gitignore
@@ -21,6 +19,7 @@
2119
/.watchmanconfig
2220
/CONTRIBUTING.md
2321
/ember-cli-build.js
22+
/eslint.config.mjs
2423
/testem.js
2524
/tests/
2625
/tsconfig.declarations.json

.prettierrc.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
"use strict";
22

33
module.exports = {
4+
plugins: ["prettier-plugin-ember-template-tag"],
45
overrides: [
56
{
6-
files: "*.{js,ts}",
7+
files: "*.{js,gjs,ts,gts,mjs,mts,cjs,cts}",
78
options: {
89
singleQuote: false,
910
},
1011
},
12+
{
13+
files: "*.{gjs,gts}",
14+
options: {
15+
singleQuote: false,
16+
templateSingleQuote: false,
17+
},
18+
},
1119
],
1220
};

addon/authenticators/oidc.js

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
import { later } from "@ember/runloop";
22
import { inject as service } from "@ember/service";
3-
import {
4-
isServerErrorResponse,
5-
isAbortError,
6-
isBadRequestResponse,
7-
} from "ember-fetch/errors";
3+
import { waitForPromise } from "@ember/test-waiters";
84
import BaseAuthenticator from "ember-simple-auth/authenticators/base";
9-
import fetch from "fetch";
105
import { resolve } from "rsvp";
116
import { TrackedObject } from "tracked-built-ins";
127

138
import config from "ember-simple-auth-oidc/config";
149
import getAbsoluteUrl from "ember-simple-auth-oidc/utils/absolute-url";
1510

11+
function isServerErrorResponse(response) {
12+
return response.status >= 500 && response.status < 600;
13+
}
14+
15+
function isAbortError(error) {
16+
return error.name === "AbortError";
17+
}
18+
19+
function isBadRequestResponse(response) {
20+
return response.status === 400;
21+
}
22+
1623
export default class OidcAuthenticator extends BaseAuthenticator {
1724
@service router;
1825
@service session;
@@ -57,16 +64,15 @@ export default class OidcAuthenticator extends BaseAuthenticator {
5764
.map((k) => `${k}=${encodeURIComponent(bodyObject[k])}`)
5865
.join("&");
5966

60-
const response = await fetch(
61-
getAbsoluteUrl(this.config.tokenEndpoint, this.config.host),
62-
{
67+
const response = await waitForPromise(
68+
fetch(getAbsoluteUrl(this.config.tokenEndpoint, this.config.host), {
6369
method: "POST",
6470
headers: {
6571
Accept: "application/json",
6672
"Content-Type": "application/x-www-form-urlencoded",
6773
},
6874
body,
69-
},
75+
}),
7076
);
7177

7278
const isServerError = isServerErrorResponse(response);
@@ -176,16 +182,15 @@ export default class OidcAuthenticator extends BaseAuthenticator {
176182
.map((k) => `${k}=${encodeURIComponent(bodyObject[k])}`)
177183
.join("&");
178184

179-
const response = await fetch(
180-
getAbsoluteUrl(this.config.tokenEndpoint, this.config.host),
181-
{
185+
const response = await waitForPromise(
186+
fetch(getAbsoluteUrl(this.config.tokenEndpoint, this.config.host), {
182187
method: "POST",
183188
headers: {
184189
Accept: "application/json",
185190
"Content-Type": "application/x-www-form-urlencoded",
186191
},
187192
body,
188-
},
193+
}),
189194
);
190195
isServerError = isServerErrorResponse(response);
191196
if (isServerError) throw new Error(response.message);
@@ -227,14 +232,13 @@ export default class OidcAuthenticator extends BaseAuthenticator {
227232
* @returns {Object} Object containing the user information
228233
*/
229234
async _getUserinfo(accessToken) {
230-
const response = await fetch(
231-
getAbsoluteUrl(this.config.userinfoEndpoint, this.config.host),
232-
{
235+
const response = await waitForPromise(
236+
fetch(getAbsoluteUrl(this.config.userinfoEndpoint, this.config.host), {
233237
headers: {
234238
Authorization: `${this.config.authPrefix} ${accessToken}`,
235239
Accept: "application/json",
236240
},
237-
},
241+
}),
238242
);
239243

240244
const userinfo = await response.json();

ember-cli-build.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ const EmberAddon = require("ember-cli/lib/broccoli/ember-addon");
55
module.exports = function (defaults) {
66
const app = new EmberAddon(defaults, {
77
// Add options here
8-
"ember-fetch": {
9-
nativePromise: true,
10-
},
118
});
129

1310
/*

eslint.config.mjs

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,13 @@
1-
import path from "node:path";
2-
import { fileURLToPath } from "node:url";
3-
4-
import { FlatCompat } from "@eslint/eslintrc";
5-
import js from "@eslint/js";
6-
7-
const __filename = fileURLToPath(import.meta.url);
8-
const __dirname = path.dirname(__filename);
9-
const compat = new FlatCompat({
10-
baseDirectory: __dirname,
11-
recommendedConfig: js.configs.recommended,
12-
allConfig: js.configs.all,
13-
});
1+
import adfinisEmberAddonConfig from "@adfinis/eslint-config/ember-addon";
2+
import ember from "eslint-plugin-ember";
143

154
export default [
5+
...adfinisEmberAddonConfig,
166
{
17-
ignores: [
18-
"blueprints/*/files/",
19-
"declarations/",
20-
"dist/",
21-
"coverage/",
22-
"!**/.*",
23-
"**/.*/",
24-
".node_modules.ember-try/",
25-
],
26-
},
27-
...compat.extends("@adfinis/eslint-config/ember-addon"),
28-
{
7+
plugins: { ember },
298
settings: {
309
"import/internal-regex": "^ember-simple-auth-oidc/",
3110
},
32-
3311
rules: {
3412
"ember/no-runloop": "warn",
3513
},

package.json

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414
"repository": "https://github.com/adfinis/ember-simple-auth-oidc",
1515
"scripts": {
1616
"build": "ember build --environment=production",
17-
"lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"",
17+
"lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\" --prefixColors auto",
1818
"lint:css": "stylelint \"**/*.css\"",
1919
"lint:css:fix": "concurrently \"pnpm:lint:css -- --fix\"",
20-
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\"",
20+
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" --prefixColors auto",
2121
"lint:hbs": "ember-template-lint .",
2222
"lint:hbs:fix": "ember-template-lint . --fix",
2323
"lint:js": "eslint . --cache",
2424
"lint:js:fix": "eslint . --fix",
2525
"start": "ember serve",
26-
"test": "concurrently \"pnpm:lint\" \"pnpm:test:*\" --names \"lint,test:\"",
26+
"test": "concurrently \"pnpm:lint\" \"pnpm:test:*\" --names \"lint,test:\" --prefixColors auto",
2727
"test:ember": "ember test",
2828
"test:ember-compatibility": "ember try:each",
2929
"prepare": "husky"
@@ -36,28 +36,29 @@
3636
"ember-auto-import": "^2.10.0",
3737
"ember-cli-babel": "^8.2.0",
3838
"ember-concurrency": "^4.0.2",
39-
"ember-fetch": "^8.1.2",
4039
"ember-simple-auth": "^6.0.0",
40+
"ember-template-imports": "^4.2.0",
4141
"js-sha256": "^0.11.0",
4242
"tracked-built-ins": "^3.3.0",
4343
"uuid": "^11.0.3"
4444
},
4545
"devDependencies": {
46-
"@adfinis/eslint-config": "2.1.1",
46+
"@adfinis/eslint-config": "3.0.1",
4747
"@adfinis/semantic-release-config": "5.0.0",
4848
"@babel/eslint-parser": "7.25.9",
4949
"@babel/plugin-proposal-decorators": "7.25.9",
50-
"@commitlint/cli": "19.6.0",
50+
"@commitlint/cli": "19.6.1",
5151
"@commitlint/config-conventional": "19.6.0",
5252
"@ember/optional-features": "2.2.0",
5353
"@ember/string": "4.0.0",
5454
"@ember/test-helpers": "4.0.4",
5555
"@embroider/test-setup": "4.0.0",
56+
"@eslint/js": "9.17.0",
5657
"@glimmer/tracking": "1.1.2",
5758
"broccoli-asset-rev": "3.0.0",
58-
"concurrently": "9.1.0",
59+
"concurrently": "9.1.2",
5960
"ember-apollo-client": "4.1.1",
60-
"ember-cli": "6.0.1",
61+
"ember-cli": "6.1.0",
6162
"ember-cli-clean-css": "3.0.0",
6263
"ember-cli-dependency-checker": "3.3.3",
6364
"ember-cli-htmlbars": "6.3.0",
@@ -66,41 +67,44 @@
6667
"ember-cli-sri": "2.1.1",
6768
"ember-cli-terser": "4.0.2",
6869
"ember-data": "5.3.9",
70+
"ember-fetch": "8.1.2",
6971
"ember-load-initializers": "3.0.1",
70-
"ember-qunit": "8.1.1",
72+
"ember-qunit": "9.0.1",
7173
"ember-resolver": "13.1.0",
72-
"ember-source": "6.0.1",
74+
"ember-source": "6.1.0",
7375
"ember-source-channel-url": "3.0.0",
7476
"ember-template-lint": "6.0.0",
7577
"ember-try": "3.0.0",
76-
"eslint": "9.15.0",
78+
"eslint": "9.17.0",
7779
"eslint-config-prettier": "9.1.0",
7880
"eslint-plugin-ember": "12.3.3",
7981
"eslint-plugin-import": "2.31.0",
80-
"eslint-plugin-n": "17.14.0",
82+
"eslint-plugin-n": "17.15.1",
8183
"eslint-plugin-prettier": "5.2.1",
8284
"eslint-plugin-qunit": "8.1.2",
83-
"graphql": "16.9.0",
85+
"globals": "15.14.0",
86+
"graphql": "16.10.0",
8487
"graphql-tag": "2.12.6",
8588
"husky": "9.1.7",
86-
"lint-staged": "15.2.10",
89+
"lint-staged": "15.3.0",
8790
"loader.js": "4.7.0",
8891
"miragejs": "0.1.48",
89-
"prettier": "3.3.3",
90-
"qunit": "2.22.0",
91-
"qunit-dom": "3.3.0",
92-
"semantic-release": "24.2.0",
93-
"stylelint": "16.10.0",
92+
"prettier": "3.4.2",
93+
"prettier-plugin-ember-template-tag": "2.0.4",
94+
"qunit": "2.23.1",
95+
"qunit-dom": "3.4.0",
96+
"semantic-release": "24.2.1",
97+
"stylelint": "16.12.0",
9498
"stylelint-config-standard": "36.0.1",
9599
"stylelint-prettier": "5.0.2",
96-
"webpack": "5.96.1"
100+
"webpack": "5.97.1"
97101
},
98102
"peerDependencies": {
99103
"@ember-data/adapter": "~4.12.0 || >= 5.0.0",
100104
"ember-data": "~4.12.0 || >= 5.0.0",
101105
"ember-source": ">= 4.0.0"
102106
},
103-
"packageManager": "pnpm@9.14.2",
107+
"packageManager": "pnpm@9.15.3",
104108
"engines": {
105109
"node": ">= 18"
106110
},

0 commit comments

Comments
 (0)