Skip to content

Commit 765c988

Browse files
ember-cli-update to 6.11 (#2532)
* ember-cli-update to 6.11 * Update index.d.ts * Fix types * TS progress * Fix remaining type errors - Make oncomplete handlers accept optional InputEvent to match ember-inputmask types - Type nearest-color from() with overloads accepting string or RGB input Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Fix unhandled AbortError from skipped view transitions Rapid successive route transitions cause the View Transitions API to skip the in-flight transition, rejecting its ready/finished promises with 'AbortError: Transition was skipped'. Catch those rejections and skip view transitions entirely in tests, where they only add timing nondeterminism. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Temporary: debug electron binary install in CI Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Override yauzl to v3 to fix Electron binary install on Node 24.16+ extract-zip's yauzl 2.x silently aborts extraction on Node 24.16.0+, leaving node_modules/electron without its binary and path.txt (electron/electron#51619). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Remove temporary CI debug step Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Update electron to 40.10.3 for the upstream Node 24.16+ install fix Electron >= 40.10.3 replaces extract-zip with a fixed extractor in its install script (electron/electron#51886). The yauzl override stays: @electron/packager 18.4.4 (pinned by electron-forge) still extracts the Electron zip with extract-zip + yauzl 2, which is broken on Node 24.16+. Drop the override once forge ships @electron/packager >= 19. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 5b33aba commit 765c988

25 files changed

Lines changed: 1207 additions & 819 deletions

File tree

‎.editorconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# EditorConfig helps developers define and maintain consistent
22
# coding styles between different editors and IDEs
3-
# editorconfig.org
3+
# https://editorconfig.org/
44

55
root = true
66

‎.gitignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
# compiled output
44
/dist/
5-
/declarations/
65
/tmp/
76

87
# dependencies

.stylelintrc.cjs renamed to .stylelintrc.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
'use strict';
2-
3-
module.exports = {
1+
export default {
42
extends: ['stylelint-config-standard'],
53
rules: {
64
'at-rule-no-deprecated': [true, { ignoreAtRules: ['/^view/', 'apply'] }],

‎app/components/alpha-input.gts‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,24 @@ export default class AlphaInputComponent extends Component<AlphaInputSignature>
5555
}
5656

5757
@action
58-
isComplete(buffer: Buffer, opts: { regex: string }): boolean {
58+
isComplete(buffer: Array<string>, opts: { regex?: string }): boolean {
5959
const value = buffer.join('');
6060

61-
return Boolean(value.length) && new RegExp(opts.regex).test(value);
61+
return (
62+
Boolean(value.length) && new RegExp(opts.regex as string).test(value)
63+
);
6264
}
6365

6466
/**
6567
* When the rgb input value passes the regex, set the value, and update the hex values and color.
6668
* @param {Event} event
6769
*/
6870
@action
69-
onComplete(event: InputEvent): void {
71+
onComplete(event?: InputEvent): void {
72+
if (!event) {
73+
return;
74+
}
75+
7076
const { selectedColor } = this.args;
7177
let value = parseFloat((<HTMLInputElement>event.target).value);
7278

‎app/components/hex-input.gts‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,20 @@ export default class HexInputComponent extends Component<HexInputSignature> {
5151
}
5252

5353
@action
54-
isComplete(buffer: Buffer, opts: { regex: string }): boolean {
55-
return new RegExp(opts.regex).test(buffer.join(''));
54+
isComplete(buffer: Array<string>, opts: { regex?: string }): boolean {
55+
return new RegExp(opts.regex as string).test(buffer.join(''));
5656
}
5757

5858
/**
5959
* Executes whenever the hex value matches the regex. We can use this to change the color values only when valid.
6060
* @param {Event} event The event when the hex matches the regex and is valid
6161
*/
6262
@action
63-
onComplete(event: InputEvent): void {
63+
onComplete(event?: InputEvent): void {
64+
if (!event) {
65+
return;
66+
}
67+
6468
const tinyColor = new TinyColor((<HTMLInputElement>event.target).value);
6569
const { r, g, b, a } = tinyColor.toRgb();
6670
const hex = rgbaToHex(r, g, b, a);

‎app/components/rgb-input.gts‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,24 @@ export default class RgbaInputComponent extends Component<RgbaInputSignature> {
7676
}
7777

7878
@action
79-
isComplete(buffer: Buffer, opts: { regex: string }): boolean {
79+
isComplete(buffer: Array<string>, opts: { regex?: string }): boolean {
8080
const value = buffer.join('');
8181

82-
return Boolean(value.length) && new RegExp(opts.regex).test(value);
82+
return (
83+
Boolean(value.length) && new RegExp(opts.regex as string).test(value)
84+
);
8385
}
8486

8587
/**
8688
* When the rgb input value passes the regex, set the value, and update the hex values and color.
8789
* @param {Event} event
8890
*/
8991
@action
90-
onComplete(event: InputEvent): void {
92+
onComplete(event?: InputEvent): void {
93+
if (!event) {
94+
return;
95+
}
96+
9197
const selectedColor: SelectedColorModel = this.args
9298
.selectedColor as SelectedColorModel;
9399
const { type } = this.args;

‎app/services/.gitkeep‎

Whitespace-only changes.

‎app/services/nearest-color.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import Service from '@ember/service';
22

33
import { colornames } from 'color-name-list';
4-
import nearestColor from 'nearest-color';
4+
import nearestColor, { type ColorMatch, type RGB } from 'nearest-color';
55

66
export default class NearestColorService extends Service {
7-
nearest: ({ r, g, b }: { r: number; g: number; b: number }) => {
8-
name: string;
9-
};
7+
nearest: (color: string | RGB) => ColorMatch;
108

119
constructor() {
1210
super(...arguments);

‎app/utils/view-transitions.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
1+
import { isTesting } from '@embroider/macros';
2+
13
export default function viewTransitions() {
2-
if (!document.startViewTransition) {
4+
if (isTesting() || !document.startViewTransition) {
35
return;
46
}
57

68
return new Promise<void>((resolve) => {
79
// eslint-disable-next-line @typescript-eslint/require-await
8-
document.startViewTransition(async () => {
10+
const transition = document.startViewTransition(async () => {
911
resolve();
1012
});
13+
14+
// A transition gets skipped when another starts before it finishes;
15+
// its `ready`/`finished` promises reject with an AbortError that would
16+
// otherwise surface as an unhandled rejection.
17+
transition.ready.catch(() => {});
18+
transition.finished.catch(() => {});
1119
});
1220
}

babel.config.cjs renamed to babel.config.mjs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
const {
1+
import { dirname } from 'node:path';
2+
import { fileURLToPath } from 'node:url';
3+
4+
import {
25
babelCompatSupport,
36
templateCompatSupport,
4-
} = require('@embroider/compat/babel');
7+
} from '@embroider/compat/babel';
58

6-
module.exports = {
9+
export default {
710
plugins: [
811
[
912
'@babel/plugin-transform-typescript',
@@ -16,7 +19,6 @@ module.exports = {
1619
[
1720
'babel-plugin-ember-template-compilation',
1821
{
19-
compilerPath: 'ember-source/dist/ember-template-compiler.js',
2022
enableLegacyModules: [
2123
'ember-cli-htmlbars',
2224
'ember-cli-htmlbars-inline-precompile',
@@ -29,14 +31,14 @@ module.exports = {
2931
'module:decorator-transforms',
3032
{
3133
runtime: {
32-
import: require.resolve('decorator-transforms/runtime-esm'),
34+
import: import.meta.resolve('decorator-transforms/runtime-esm'),
3335
},
3436
},
3537
],
3638
[
3739
'@babel/plugin-transform-runtime',
3840
{
39-
absoluteRuntime: __dirname,
41+
absoluteRuntime: dirname(fileURLToPath(import.meta.url)),
4042
useESModules: true,
4143
regenerator: false,
4244
},

0 commit comments

Comments
 (0)