-
-
Notifications
You must be signed in to change notification settings - Fork 3
ember-cli-update to 6.11 #2532
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
ember-cli-update to 6.11 #2532
Changes from all commits
a339668
b76e8b7
80f5be1
8c3665b
a98a987
b589495
86c1afc
bb81029
78bec66
6b698c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ | |
|
|
||
| # compiled output | ||
| /dist/ | ||
| /declarations/ | ||
| /tmp/ | ||
|
|
||
| # dependencies | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -51,16 +51,20 @@ export default class HexInputComponent extends Component<HexInputSignature> { | |||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| @action | ||||||||||||||||||||||||||
| isComplete(buffer: Buffer, opts: { regex: string }): boolean { | ||||||||||||||||||||||||||
| return new RegExp(opts.regex).test(buffer.join('')); | ||||||||||||||||||||||||||
| isComplete(buffer: Array<string>, opts: { regex?: string }): boolean { | ||||||||||||||||||||||||||
| return new RegExp(opts.regex as string).test(buffer.join('')); | ||||||||||||||||||||||||||
|
Comment on lines
+54
to
+55
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, let's find and read the hex-input.gts file
find . -name "hex-input.gts" -type fRepository: shipshapecode/swach Length of output: 93 🏁 Script executed: # Also search for any references to ember-inputmask in the codebase
rg "ember-inputmask" --type ts --type js --type gts -A 3 -B 3Repository: shipshapecode/swach Length of output: 90 🏁 Script executed: # Check the package.json to confirm the version of ember-inputmask
cat package.json | grep -A 2 -B 2 "inputmask"Repository: shipshapecode/swach Length of output: 237 🏁 Script executed: # Read the hex-input.gts file to see the isComplete method
cat -n ./app/components/hex-input.gtsRepository: shipshapecode/swach Length of output: 3079 🏁 Script executed: # Search for isComplete usage in the codebase to understand how it's called
rg "isComplete" -g "*.gts" -g "*.ts" -g "*.js" -A 5 -B 5Repository: shipshapecode/swach Length of output: 3806 🌐 Web query:
💡 Result: In Inputmask (the library wrapped by
When you use the
The Inputmask docs/examples show $(selector).inputmask("Regex", {
regex: "[0-9]*",
isComplete: function (buffer, opts) {
return new RegExp(opts.regex).test(buffer.join(""));
}
});
``` [2]
**Sources:** [1] Type definitions for Inputmask options/signatures, including `isComplete(buffer, opts)` and `opts.regex`. [2] Inputmask documentation example showing `isComplete(buffer, opts)` using `opts.regex`.
---
🏁 Script executed:
```shell
# Let's verify the behavior of RegExp with undefined
node << 'EOF'
// Test what happens when RegExp is constructed with undefined
try {
const result = new RegExp(undefined);
console.log("RegExp(undefined):", result);
console.log("Test 'undefined' string:", result.test("undefined"));
console.log("Test other string:", result.test("hello"));
} catch (e) {
console.log("Error:", e.message);
}
EOFRepository: shipshapecode/swach Length of output: 142 Guard optional Line 55 force-casts an optional value ( Additionally, the type annotation declares Suggested fix- isComplete(buffer: Array<string>, opts: { regex?: string }): boolean {
- return new RegExp(opts.regex as string).test(buffer.join(''));
+ isComplete(buffer: Array<string>, opts: { regex?: string | RegExp }): boolean {
+ const pattern =
+ opts.regex instanceof RegExp
+ ? opts.regex
+ : opts.regex
+ ? new RegExp(opts.regex)
+ : this.hexRegex;
+
+ return pattern.test(buffer.join(''));
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||
| * Executes whenever the hex value matches the regex. We can use this to change the color values only when valid. | ||||||||||||||||||||||||||
| * @param {Event} event The event when the hex matches the regex and is valid | ||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||
| @action | ||||||||||||||||||||||||||
| onComplete(event: InputEvent): void { | ||||||||||||||||||||||||||
| onComplete(event?: InputEvent): void { | ||||||||||||||||||||||||||
| if (!event) { | ||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| const tinyColor = new TinyColor((<HTMLInputElement>event.target).value); | ||||||||||||||||||||||||||
| const { r, g, b, a } = tinyColor.toRgb(); | ||||||||||||||||||||||||||
| const hex = rgbaToHex(r, g, b, a); | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,20 @@ | ||
| import { isTesting } from '@embroider/macros'; | ||
|
|
||
| export default function viewTransitions() { | ||
| if (!document.startViewTransition) { | ||
| if (isTesting() || !document.startViewTransition) { | ||
| return; | ||
| } | ||
|
|
||
| return new Promise<void>((resolve) => { | ||
| // eslint-disable-next-line @typescript-eslint/require-await | ||
| document.startViewTransition(async () => { | ||
| const transition = document.startViewTransition(async () => { | ||
| resolve(); | ||
| }); | ||
|
|
||
| // A transition gets skipped when another starts before it finishes; | ||
| // its `ready`/`finished` promises reject with an AbortError that would | ||
| // otherwise surface as an unhandled rejection. | ||
| transition.ready.catch(() => {}); | ||
| transition.finished.catch(() => {}); | ||
| }); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,12 +12,13 @@ | |
| * npx eslint --inspect-config | ||
| * | ||
| */ | ||
| import babelParser from '@babel/eslint-parser'; | ||
| import babelParser from '@babel/eslint-parser/experimental-worker'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Description: Check official Babel documentation for the experimental-worker parser entrypoint
# Check if the experimental-worker export exists in the package
if [ -f "node_modules/@babel/eslint-parser/package.json" ]; then
echo "=== Package exports ==="
cat node_modules/@babel/eslint-parser/package.json | jq -r '.exports'
fi
# Search for any documentation or usage of experimental-worker in the package
echo -e "\n=== Searching for experimental-worker references ==="
rg -n "experimental-worker" node_modules/@babel/eslint-parser/ --type md --type js -C 2 2>/dev/null || echo "No references found in package"Repository: shipshapecode/swach Length of output: 148 🌐 Web query:
💡 Result: The entrypoint Citations:
In
🤖 Prompt for AI Agents |
||
| import js from '@eslint/js'; | ||
| import eslintConfigPrettier from 'eslint-config-prettier'; | ||
| import ember from 'eslint-plugin-ember/recommended'; | ||
| import n from 'eslint-plugin-n'; | ||
| import qunit from 'eslint-plugin-qunit'; | ||
| import { defineConfig, globalIgnores } from 'eslint/config'; | ||
| import globals from 'globals'; | ||
| import ts from 'typescript-eslint'; | ||
|
|
||
|
|
@@ -34,29 +35,20 @@ const parserOptions = { | |
| }, | ||
| }; | ||
|
|
||
| export default ts.config( | ||
| export default defineConfig([ | ||
| globalIgnores([ | ||
| '.vite/**/*', | ||
| 'dist/', | ||
| 'coverage/', | ||
| 'electron-app/dist/**/*', | ||
| 'out/**/*', | ||
| '!**/.*', | ||
| ]), | ||
|
Comment on lines
+39
to
+46
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Description: Check for common Ember build artifacts that might need ESLint ignores
# Check for common Ember directories
echo "=== Checking for Ember build directories ==="
for dir in tmp .ember-cli; do
if [ -d "$dir" ]; then
echo "Found: $dir/"
echo " Files: $(fd . "$dir" --type f | wc -l)"
fi
done
# Check current gitignore for patterns that might inform ESLint ignores
echo -e "\n=== Current .gitignore patterns ==="
if [ -f ".gitignore" ]; then
cat .gitignore | grep -E "^[^#]" | grep -E "(tmp|ember-cli|declarations|\.d\.ts)" || echo "No matching patterns"
fiRepository: shipshapecode/swach Length of output: 151 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== eslint.config.mjs (globalIgnores context) ==="
if [ -f "eslint.config.mjs" ]; then
sed -n '1,120p' eslint.config.mjs | nl -ba | sed -n '1,120p'
else
echo "Missing eslint.config.mjs"
fi
echo
echo "=== Locate common Ember-generated directories ==="
for pat in "tmp" ".ember-cli" "declarations" "build" ".tmp"; do
echo "-- Looking for directories named '$pat' (any depth) --"
find . -type d -name "$pat" 2>/dev/null | sed 's|^\./||' | head -n 50
done
echo
echo "=== Check .gitignore for Ember-ish patterns ==="
if [ -f ".gitignore" ]; then
rg -n --hidden --no-ignore-vcs -S "tmp|ember-cli|declarations" .gitignore || true
else
echo "Missing .gitignore"
fi
echo
echo "=== Search eslint config for other ignore patterns ==="
if [ -f "eslint.config.mjs" ]; then
rg -n "ignore|globalIgnores|ignores" eslint.config.mjs || true
fiRepository: shipshapecode/swach Length of output: 174 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== eslint.config.mjs (globalIgnores context) ==="
if [ -f "eslint.config.mjs" ]; then
sed -n '1,160p' eslint.config.mjs | awk '{printf "%d\t%s\n", NR, $0}' | sed -n '1,160p'
else
echo "Missing eslint.config.mjs"
fi
echo
echo "=== Locate common Ember-generated directories ==="
for pat in "tmp" ".ember-cli" "declarations" "build" ".tmp"; do
echo "-- Searching for directories named '$pat' (any depth) --"
find . -type d -name "$pat" 2>/dev/null | sed 's|^\./||' | head -n 50 || true
done
echo
echo "=== Check .gitignore for Ember-ish patterns ==="
if [ -f ".gitignore" ]; then
sed -n '1,200p' .gitignore
echo
rg -n --hidden --no-ignore-vcs -S "tmp|ember-cli|declarations" .gitignore || true
else
echo "Missing .gitignore"
fi
echo
echo "=== Search eslint config for other ignore patterns ==="
if [ -f "eslint.config.mjs" ]; then
rg -n "ignore|globalIgnores|ignores" eslint.config.mjs || true
else
echo "Missing eslint.config.mjs"
fiRepository: shipshapecode/swach Length of output: 4687 Add missing ESLint ignores for Ember build artifacts
🤖 Prompt for AI Agents |
||
| js.configs.recommended, | ||
| ember.configs.base, | ||
| ember.configs.gjs, | ||
| ember.configs.gts, | ||
| eslintConfigPrettier, | ||
| /** | ||
| * Ignores must be in their own object | ||
| * https://eslint.org/docs/latest/use/configure/ignore | ||
| */ | ||
| { | ||
| ignores: [ | ||
| '.vite/**/*', | ||
| 'coverage/**/*', | ||
| 'declarations/**/*', | ||
| 'dist/**/*', | ||
| 'electron-app/dist/**/*', | ||
| 'node_modules/**/*', | ||
| 'out/**/*', | ||
| 'types/**/*', | ||
| '!**/.*', | ||
| ], | ||
| }, | ||
| /** | ||
| * https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options | ||
| */ | ||
|
|
@@ -85,6 +77,9 @@ export default ts.config( | |
| languageOptions: { | ||
| parser: ember.parser, | ||
| parserOptions: parserOptions.esm.ts, | ||
| globals: { | ||
| ...globals.browser, | ||
| }, | ||
| }, | ||
| extends: [...ts.configs.recommendedTypeChecked, ember.configs.gts], | ||
| rules: { | ||
|
|
@@ -147,4 +142,4 @@ export default ts.config( | |
| }, | ||
| }, | ||
| }, | ||
| ); | ||
| ]); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: shipshapecode/swach
Length of output: 93
🏁 Script executed:
# Read the alpha-input.gts file to see the actual code cat -n app/components/alpha-input.gtsRepository: shipshapecode/swach
Length of output: 3154
🏁 Script executed:
Repository: shipshapecode/swach
Length of output: 90
🏁 Script executed:
Repository: shipshapecode/swach
Length of output: 1711
🏁 Script executed:
Repository: shipshapecode/swach
Length of output: 3231
🏁 Script executed:
Repository: shipshapecode/swach
Length of output: 2796
🏁 Script executed:
Repository: shipshapecode/swach
Length of output: 74
🏁 Script executed:
Repository: shipshapecode/swach
Length of output: 392
Fix type annotation and unsafe regex cast in completion validation.
The
optsparameter is typed as{ regex?: string }but receives aRegExpinstance (line 38). When casting as string withopts.regex as string, if regex were undefined,new RegExp(undefined)would create/(?:)/, matching any input unexpectedly.Update the type signature to accept
RegExp | string | undefined, and handle each case explicitly with a fallback tothis.alphaRegex:Suggested fix
Note: The same issue exists in
rgb-input.gts(line 79) andhex-input.gts(line 54).📝 Committable suggestion
🤖 Prompt for AI Agents