Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
6322e29
Attempt to setup vite in electron
RobbieTheWagner Aug 15, 2025
5cc57a3
Update configs
RobbieTheWagner Aug 15, 2025
3bbb6e8
Get things booting at least
RobbieTheWagner Aug 16, 2025
25eed03
More tweaks
RobbieTheWagner Aug 16, 2025
8430165
Use ef4 fork of ember-orbit
RobbieTheWagner Aug 16, 2025
00b4e1c
Run prettier
RobbieTheWagner Aug 16, 2025
a3ccb0c
Various tweaks
RobbieTheWagner Aug 16, 2025
3ae1708
Fix some lint and types issues
RobbieTheWagner Aug 16, 2025
3c25341
Sync up vite versions
RobbieTheWagner Aug 16, 2025
26af84d
Fix types
RobbieTheWagner Aug 16, 2025
fc2c13c
Run prettier
RobbieTheWagner Aug 18, 2025
f0ca7cb
Move electron deps to the root
RobbieTheWagner Aug 21, 2025
6a126c5
Use specific ember-orbit commit
RobbieTheWagner Aug 21, 2025
ebe3b02
Update ember-drag-sort
RobbieTheWagner Sep 20, 2025
8c62b7a
Fix some types
RobbieTheWagner Sep 21, 2025
e5457dc
Fix types
RobbieTheWagner Sep 22, 2025
36626d8
Update eslint.config.mjs
RobbieTheWagner Sep 23, 2025
47cc1ce
Update to ember-orbit 0.18
RobbieTheWagner Oct 6, 2025
a2e193e
ember-orbit 0.19.x
RobbieTheWagner Oct 9, 2025
742081c
Tailwind 4 + vite
RobbieTheWagner Oct 10, 2025
3c92d85
Get styles loading
RobbieTheWagner Oct 10, 2025
ff74c20
Tweak postcss
RobbieTheWagner Oct 10, 2025
72794a2
ember-cli-update
RobbieTheWagner Oct 10, 2025
baca8e5
pnpm update
RobbieTheWagner Oct 10, 2025
ae5690f
Get electron booting
RobbieTheWagner Oct 10, 2025
750689b
Get electron running in dev mode
RobbieTheWagner Oct 10, 2025
f8dca7e
Vite hacks
RobbieTheWagner Oct 10, 2025
ebf81e8
Expose ipcRenderer methods
RobbieTheWagner Oct 10, 2025
6bead2c
Update package.json
RobbieTheWagner Oct 10, 2025
2576abb
Get tests kind of running
RobbieTheWagner Oct 10, 2025
e255c94
Fix incorrect blur handlers
RobbieTheWagner Oct 10, 2025
e3c17f4
Update helpers.ts
RobbieTheWagner Oct 10, 2025
9315fa2
Manually get orbitRegistry
RobbieTheWagner Oct 14, 2025
d451498
pnpm update
RobbieTheWagner Oct 17, 2025
1be9fe1
Use MemorySource for backup when testing
RobbieTheWagner Oct 17, 2025
d497833
Fix some tests
RobbieTheWagner Oct 17, 2025
dd26e3e
Get Electron tests running
RobbieTheWagner Oct 18, 2025
8d461e3
Add type checking for electron app
RobbieTheWagner Oct 18, 2025
9511844
Fix type errors
RobbieTheWagner Oct 18, 2025
11b6e7b
Update eslint.config.mjs
RobbieTheWagner Oct 18, 2025
0841913
Fix stylelint
RobbieTheWagner Oct 20, 2025
219a067
Fix some lint issues
RobbieTheWagner Oct 20, 2025
da8ba7b
Fix lint ignore config
RobbieTheWagner Oct 20, 2025
0e32236
Fix some lint
RobbieTheWagner Oct 20, 2025
c63e451
Finish fixing lint
RobbieTheWagner Oct 20, 2025
8ee8806
Add back three-dots
RobbieTheWagner Oct 21, 2025
6e9b210
Get electron only tests working
RobbieTheWagner Oct 21, 2025
88184ea
Working electron testem setup
RobbieTheWagner Oct 21, 2025
71c09fd
Switch to vite-plugin-testem-electron
RobbieTheWagner Oct 21, 2025
6290b10
Fix lint
RobbieTheWagner Oct 21, 2025
8e90f0c
Add back tests
RobbieTheWagner Oct 21, 2025
a37252c
Update contrast-test.js
RobbieTheWagner Oct 21, 2025
c4408c8
Update contrast-test.js
RobbieTheWagner Oct 21, 2025
9161d2b
Use blur and waits
RobbieTheWagner Oct 21, 2025
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
14 changes: 13 additions & 1 deletion .ember-cli
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,17 @@
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
*/
"isTypeScriptProject": true
"isTypeScriptProject": true,

/**
Setting `componentAuthoringFormat` to "strict" will force the blueprint generators to generate GJS
or GTS files for the component and the component rendering test. "loose" is the default.
*/
"componentAuthoringFormat": "strict",

/**
Setting `routeAuthoringFormat` to "strict" will force the blueprint generators to generate GJS
or GTS templates for routes. "loose" is the default
*/
"routeAuthoringFormat": "strict"
}
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
# compiled output
/dist/
/declarations/
/tmp/

# dependencies
/node_modules/

# misc
/.env*
*.local
/.pnp*
/.sass-cache
/.eslintcache
Expand All @@ -19,8 +21,24 @@
/testem.log
/yarn-error.log

# ember-try
/.node_modules.ember-try/
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try

# broccoli-debug
/DEBUG/

electron-out/
.idea/

# Vite
.vite/

# Electron-Forge
out/

# TypeScript
*.tsbuildinfo
2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ ember-cli-update.json
# ember-electron
/electron-app/node_modules/
/electron-app/out/
/electron-app/ember-dist/
/electron-app/ember-test/

# Sentry
/electron-app/sentry-symbols.js
Expand Down
37 changes: 31 additions & 6 deletions .prettierrc.js → .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const testing = [
'^ember-cli-htmlbars($|\\/)',
'^qunit',
Expand Down Expand Up @@ -34,18 +32,45 @@ const importOrder = [
];
const importOrderParserPlugins = ['typescript', 'decorators-legacy'];

module.exports = {
export default {
plugins: [
'prettier-plugin-ember-template-tag',
'@ianvs/prettier-plugin-sort-imports',
],
importOrder,
importOrderParserPlugins,
singleQuote: true,
overrides: [
{
files: '*.{js,gjs,ts,gts,mjs,mts,cjs,cts}',
options: { singleQuote: true, templateSingleQuote: false },
files: ['*.js', '*.ts', '*.cjs', '.mjs', '.cts', '.mts', '.cts'],
options: {
trailingComma: 'es5',
},
},
{
files: ['*.html'],
options: {
singleQuote: false,
},
},
{
files: ['*.json'],
options: {
singleQuote: false,
},
},
{
files: ['*.hbs'],
options: {
singleQuote: false,
},
},
{
files: ['*.gjs', '*.gts'],
options: {
templateSingleQuote: false,
trailingComma: 'es5',
},
},
{ files: '*.{yaml,yml}', options: { singleQuote: true } },
],
};
16 changes: 16 additions & 0 deletions .stylelintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';

module.exports = {
extends: ['stylelint-config-standard'],
rules: {
'at-rule-no-deprecated': [true, { ignoreAtRules: ['/^view/', 'apply'] }],
'at-rule-no-unknown': [
true,
{ ignoreAtRules: ['plugin', 'reference', 'theme'] },
],
'custom-property-empty-line-before': null,
'custom-property-pattern': null,
'declaration-empty-line-before': null,
'import-notation': null,
},
};
8 changes: 0 additions & 8 deletions .stylelintrc.js

This file was deleted.

6 changes: 2 additions & 4 deletions .template-lintrc.js → .template-lintrc.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict';

module.exports = {
extends: ['recommended'],
export default {
extends: 'recommended',
rules: {
'no-at-ember-render-modifiers': false,
'no-builtin-form-components': false,
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
nodejs 20.19.0
pnpm 10.11.0
pnpm 10.18.2
4 changes: 0 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
{
"eslint.validate": [
"glimmer-ts",
"glimmer-js"
]
}
6 changes: 4 additions & 2 deletions app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { InitSentryForEmber } from '@sentry/ember';
import loadInitializers from 'ember-load-initializers';
import Resolver from 'ember-resolver';
import { importSync, isDevelopingApp, macroCondition } from '@embroider/macros';
import compatModules from '@embroider/virtual/compat-modules';
import config from 'swach/config/environment';
import './styles/all.css';

if (macroCondition(isDevelopingApp())) {
importSync('./deprecation-workflow');
Expand All @@ -14,7 +16,7 @@ InitSentryForEmber();
export default class App extends Application {
modulePrefix = config.modulePrefix;
podModulePrefix = config.podModulePrefix;
Resolver = Resolver;
Resolver = Resolver.withModules(compatModules);
}

loadInitializers(App, config.modulePrefix);
loadInitializers(App, config.modulePrefix, compatModules);
9 changes: 4 additions & 5 deletions app/components/about.gts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { action } from '@ember/object';
import type Owner from '@ember/owner';
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import type { IpcRenderer } from 'electron';

interface AboutSignature {
Element: HTMLDivElement;
Expand Down Expand Up @@ -38,16 +37,16 @@ export default class AboutComponent extends Component<AboutSignature> {
</p>
</div>
</template>
declare ipcRenderer: IpcRenderer;
declare ipcRenderer: Window['electronAPI']['ipcRenderer'];

copyrightYear = new Date().getFullYear();
@tracked version = 'Version not available';

constructor(owner: Owner, args: Record<string, unknown>) {
super(owner, args);

if (typeof requireNode !== 'undefined') {
const { ipcRenderer } = requireNode('electron');
if (typeof window !== 'undefined' && window.electronAPI) {
const { ipcRenderer } = window.electronAPI;

this.ipcRenderer = ipcRenderer;

Expand All @@ -61,7 +60,7 @@ export default class AboutComponent extends Component<AboutSignature> {
visitWebsite(event: Event): void {
event.preventDefault();

if (typeof requireNode !== 'undefined') {
if (typeof window !== 'undefined' && window.electronAPI) {
void this.ipcRenderer.invoke('open-external', 'https://swach.io/');
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/components/alpha-input.gts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { action, set } from '@ember/object';
import Component from '@glimmer/component';
// @ts-expect-error TODO: fix this
import OneWayInputMask from 'ember-inputmask/_app_/components/one-way-input-mask.js';
import type { SelectedColorModel } from 'swach/components/rgb-input';
import type { SelectedColorModel } from './rgb-input';
import { rgbaToHex } from 'swach/data-models/color';

interface AlphaInputSignature {
Expand Down
10 changes: 6 additions & 4 deletions app/components/animated-drag-sort-list.gts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import AnimatedEach from 'ember-animated/components/animated-each';
import { easeOut } from 'ember-animated/easings/cosine';
import move from 'ember-animated/motions/move';
import { fadeOut } from 'ember-animated/motions/opacity';
// @ts-expect-error TODO: fix this
import DragSortItem from 'ember-drag-sort/components/drag-sort-item';
import DragSortList from 'ember-drag-sort/components/drag-sort-list';

export default class AnimatedDragSortList extends DragSortList {
export default class AnimatedDragSortList<
Item extends object,
> extends DragSortList<Item> {
<template>
{{!@glint-nocheck}}
<AnimatedContainer ...attributes>
Expand Down Expand Up @@ -37,13 +38,14 @@ export default class AnimatedDragSortList extends DragSortList {
</template>
didDrag = false;

dragEnter(event: Event): void {
@action
dragEnter(event: DragEvent) {
set(this, 'didDrag', true);
super.dragEnter(event);
}

@action
rules(): unknown {
rules() {
if (!this.didDrag) {
// eslint-disable-next-line @typescript-eslint/unbound-method
return this.transition;
Expand Down
36 changes: 19 additions & 17 deletions app/components/color-picker.gts
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ import type Router from '@ember/routing/router-service';
import { service } from '@ember/service';
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import type { Store } from 'ember-orbit';
import { orbit, type Store } from 'ember-orbit';
import { TinyColor } from '@ctrl/tinycolor';
import iro from '@jaames/iro';
import { rgbaToHex } from '../data-models/color.ts';
import type ColorModel from '../data-models/color.ts';
import type NearestColor from '../services/nearest-color.ts';
import type UndoManager from '../services/undo-manager.ts';
import AlphaInput from './alpha-input.ts';
import ColorRow from './color-row.ts';
import HexInput from './hex-input.ts';
import RgbInput from './rgb-input.ts';
import AlphaInput from './alpha-input.gts';
import ColorRow from './color-row.gts';
import HexInput from './hex-input.gts';
import type {
PrivateRGBAHex,
PublicRGBAHex,
SelectedColorModel,
} from './rgb-input.ts';
} from './rgb-input';
import RgbInput from './rgb-input.gts';

interface ColorPickerSignature {
Element: HTMLDivElement;
Expand All @@ -38,7 +38,7 @@ export default class ColorPickerComponent extends Component<ColorPickerSignature
<template>
{{#if @isShown}}
<div
class="color-picker-popover bg-main border-menu fixed left-0 !top-[49px] h-full m-0 pb-4 px-2 pt-4 text-alt w-screen"
class="color-picker-popover bg-main border-menu fixed left-0 top-[49px]! h-full m-0 pb-4 px-2 pt-4 text-alt w-screen"
>
<div
class="h-full relative w-full"
Expand All @@ -47,7 +47,7 @@ export default class ColorPickerComponent extends Component<ColorPickerSignature
>
<ColorRow @color={{this._selectedColor}} @showActions={{false}} />

<div class="bg-menu flex p-4 relative rounded">
<div class="bg-menu flex p-4 relative rounded-sm">
<div
class="flex-1 w-auto"
id="color-picker-container"
Expand All @@ -58,7 +58,7 @@ export default class ColorPickerComponent extends Component<ColorPickerSignature
<div class="absolute grow mt-4 mr-4 right-0 top-0">
<HexInput
data-test-color-picker-hex
class="input rounded mb-4 w-24"
class="input rounded-sm mb-4 w-24"
@selectedColor={{this._selectedColor}}
@update={{fn this.updateColorInputs "hex"}}
@updateColor={{this.updateColor}}
Expand Down Expand Up @@ -123,7 +123,7 @@ export default class ColorPickerComponent extends Component<ColorPickerSignature
</div>

<div class="flex w-full">
<div class="bg-menu flex-1 mt-3 mr-3 px-2 py-4 relative rounded">
<div class="bg-menu flex-1 mt-3 mr-3 px-2 py-4 relative rounded-sm">
<div class="flex flex-col h-full w-full">
<div
class="font-medium text-xxs text-main-text w-full whitespace-nowrap"
Expand All @@ -137,7 +137,7 @@ export default class ColorPickerComponent extends Component<ColorPickerSignature
</div>
</div>

<div class="bg-menu flex-1 mt-3 px-2 py-4 relative rounded">
<div class="bg-menu flex-1 mt-3 px-2 py-4 relative rounded-sm">
<div class="flex flex-col h-full w-full">
<div
class="font-medium text-xxs text-main-text w-full whitespace-nowrap"
Expand All @@ -153,7 +153,7 @@ export default class ColorPickerComponent extends Component<ColorPickerSignature
</div>

<div class="flex w-full">
<div class="bg-menu flex-1 mt-3 mr-3 px-2 py-4 relative rounded">
<div class="bg-menu flex-1 mt-3 mr-3 px-2 py-4 relative rounded-sm">
<div class="flex flex-col h-full w-full">
<div
class="font-medium text-xxs text-main-text w-full whitespace-nowrap"
Expand All @@ -167,7 +167,7 @@ export default class ColorPickerComponent extends Component<ColorPickerSignature
</div>
</div>

<div class="bg-menu flex-1 mt-3 px-2 py-4 relative rounded">
<div class="bg-menu flex-1 mt-3 px-2 py-4 relative rounded-sm">
<div class="flex flex-col h-full w-full">
<div
class="font-medium text-xxs text-main-text w-full whitespace-nowrap"
Expand Down Expand Up @@ -206,9 +206,11 @@ export default class ColorPickerComponent extends Component<ColorPickerSignature
</div>
{{/if}}
</template>

@orbit declare store: Store;

@service declare nearestColor: NearestColor;
@service declare router: Router;
@service declare store: Store;
@service declare undoManager: UndoManager;

colorPicker?: iro.ColorPicker;
Expand Down Expand Up @@ -260,9 +262,9 @@ export default class ColorPickerComponent extends Component<ColorPickerSignature
{ type: 'color', id: colorToEdit.id },
attr,
//@ts-expect-error TODO fix this error later
this._selectedColor[attr],
),
),
this._selectedColor[attr]
)
)
);

this.undoManager.setupUndoRedo();
Expand Down
Loading