Skip to content

Commit 24afca5

Browse files
Combine electron and ember apps and convert to vite (#2332)
* Attempt to setup vite in electron * Update configs * Get things booting at least * More tweaks * Use ef4 fork of ember-orbit * Run prettier * Various tweaks * Fix some lint and types issues * Sync up vite versions * Fix types * Run prettier * Move electron deps to the root * Use specific ember-orbit commit * Update ember-drag-sort * Fix some types * Fix types * Update eslint.config.mjs * Update to ember-orbit 0.18 * ember-orbit 0.19.x * Tailwind 4 + vite * Get styles loading * Tweak postcss * ember-cli-update * pnpm update * Get electron booting * Get electron running in dev mode * Vite hacks * Expose ipcRenderer methods * Update package.json * Get tests kind of running * Fix incorrect blur handlers * Update helpers.ts * Manually get orbitRegistry * pnpm update * Use MemorySource for backup when testing * Fix some tests * Get Electron tests running * Add type checking for electron app * Fix type errors * Update eslint.config.mjs * Fix stylelint * Fix some lint issues * Fix lint ignore config * Fix some lint * Finish fixing lint * Add back three-dots * Get electron only tests working * Working electron testem setup * Switch to vite-plugin-testem-electron * Fix lint * Add back tests * Update contrast-test.js * Update contrast-test.js * Use blur and waits
1 parent e04e765 commit 24afca5

138 files changed

Lines changed: 5799 additions & 4683 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ember-cli

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,17 @@
33
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
44
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
55
*/
6-
"isTypeScriptProject": true
6+
"isTypeScriptProject": true,
7+
8+
/**
9+
Setting `componentAuthoringFormat` to "strict" will force the blueprint generators to generate GJS
10+
or GTS files for the component and the component rendering test. "loose" is the default.
11+
*/
12+
"componentAuthoringFormat": "strict",
13+
14+
/**
15+
Setting `routeAuthoringFormat` to "strict" will force the blueprint generators to generate GJS
16+
or GTS templates for routes. "loose" is the default
17+
*/
18+
"routeAuthoringFormat": "strict"
719
}

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
# compiled output
44
/dist/
55
/declarations/
6+
/tmp/
67

78
# dependencies
89
/node_modules/
910

1011
# misc
1112
/.env*
13+
*.local
1214
/.pnp*
1315
/.sass-cache
1416
/.eslintcache
@@ -19,8 +21,24 @@
1921
/testem.log
2022
/yarn-error.log
2123

24+
# ember-try
25+
/.node_modules.ember-try/
26+
/npm-shrinkwrap.json.ember-try
27+
/package.json.ember-try
28+
/package-lock.json.ember-try
29+
/yarn.lock.ember-try
30+
2231
# broccoli-debug
2332
/DEBUG/
2433

2534
electron-out/
2635
.idea/
36+
37+
# Vite
38+
.vite/
39+
40+
# Electron-Forge
41+
out/
42+
43+
# TypeScript
44+
*.tsbuildinfo

.prettierignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ ember-cli-update.json
1818
# ember-electron
1919
/electron-app/node_modules/
2020
/electron-app/out/
21-
/electron-app/ember-dist/
22-
/electron-app/ember-test/
2321

2422
# Sentry
2523
/electron-app/sentry-symbols.js

.prettierrc.js renamed to .prettierrc.mjs

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const testing = [
42
'^ember-cli-htmlbars($|\\/)',
53
'^qunit',
@@ -34,18 +32,45 @@ const importOrder = [
3432
];
3533
const importOrderParserPlugins = ['typescript', 'decorators-legacy'];
3634

37-
module.exports = {
35+
export default {
3836
plugins: [
3937
'prettier-plugin-ember-template-tag',
4038
'@ianvs/prettier-plugin-sort-imports',
4139
],
4240
importOrder,
4341
importOrderParserPlugins,
42+
singleQuote: true,
4443
overrides: [
4544
{
46-
files: '*.{js,gjs,ts,gts,mjs,mts,cjs,cts}',
47-
options: { singleQuote: true, templateSingleQuote: false },
45+
files: ['*.js', '*.ts', '*.cjs', '.mjs', '.cts', '.mts', '.cts'],
46+
options: {
47+
trailingComma: 'es5',
48+
},
49+
},
50+
{
51+
files: ['*.html'],
52+
options: {
53+
singleQuote: false,
54+
},
55+
},
56+
{
57+
files: ['*.json'],
58+
options: {
59+
singleQuote: false,
60+
},
61+
},
62+
{
63+
files: ['*.hbs'],
64+
options: {
65+
singleQuote: false,
66+
},
67+
},
68+
{
69+
files: ['*.gjs', '*.gts'],
70+
options: {
71+
templateSingleQuote: false,
72+
trailingComma: 'es5',
73+
},
4874
},
49-
{ files: '*.{yaml,yml}', options: { singleQuote: true } },
5075
],
5176
};

.stylelintrc.cjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
'use strict';
2+
3+
module.exports = {
4+
extends: ['stylelint-config-standard'],
5+
rules: {
6+
'at-rule-no-deprecated': [true, { ignoreAtRules: ['/^view/', 'apply'] }],
7+
'at-rule-no-unknown': [
8+
true,
9+
{ ignoreAtRules: ['plugin', 'reference', 'theme'] },
10+
],
11+
'custom-property-empty-line-before': null,
12+
'custom-property-pattern': null,
13+
'declaration-empty-line-before': null,
14+
'import-notation': null,
15+
},
16+
};

.stylelintrc.js

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
'use strict';
2-
3-
module.exports = {
4-
extends: ['recommended'],
1+
export default {
2+
extends: 'recommended',
53
rules: {
64
'no-at-ember-render-modifiers': false,
75
'no-builtin-form-components': false,

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
nodejs 20.19.0
2-
pnpm 10.11.0
2+
pnpm 10.18.2

.vscode/settings.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
{
2-
"eslint.validate": [
3-
"glimmer-ts",
4-
"glimmer-js"
5-
]
62
}

app/app.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import { InitSentryForEmber } from '@sentry/ember';
33
import loadInitializers from 'ember-load-initializers';
44
import Resolver from 'ember-resolver';
55
import { importSync, isDevelopingApp, macroCondition } from '@embroider/macros';
6+
import compatModules from '@embroider/virtual/compat-modules';
67
import config from 'swach/config/environment';
8+
import './styles/all.css';
79

810
if (macroCondition(isDevelopingApp())) {
911
importSync('./deprecation-workflow');
@@ -14,7 +16,7 @@ InitSentryForEmber();
1416
export default class App extends Application {
1517
modulePrefix = config.modulePrefix;
1618
podModulePrefix = config.podModulePrefix;
17-
Resolver = Resolver;
19+
Resolver = Resolver.withModules(compatModules);
1820
}
1921

20-
loadInitializers(App, config.modulePrefix);
22+
loadInitializers(App, config.modulePrefix, compatModules);

0 commit comments

Comments
 (0)