Skip to content

Commit

Permalink
feat: upgrade electron
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasbach committed Mar 23, 2023
1 parent 847ff17 commit f4fbccc
Show file tree
Hide file tree
Showing 8 changed files with 781 additions and 290 deletions.
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"unzipper": "^0.10.11"
},
"devDependencies": {
"@lukasbach/campaigns-react": "^0.1.0",
"@atlaskit/button": "^15.1.5",
"@atlaskit/editor-common": "^55.4.3",
"@atlaskit/editor-core": "^140.0.0",
Expand All @@ -57,6 +56,7 @@
"@blueprintjs/select": "^3.13.7",
"@emotion/core": "^10.0.35",
"@emotion/css": "^10.0.27",
"@lukasbach/campaigns-react": "^0.1.0",
"@types/archiver": "^3.1.1",
"@types/chalk": "^2.2.0",
"@types/classnames": "^2.2.10",
Expand Down Expand Up @@ -118,7 +118,7 @@
"styled-components": "3.4.6",
"ts-loader": "^8.0.3",
"ts-node": "^9.0.0",
"typescript": "^4.0.2",
"typescript": "^5.0.2",
"uuid": "^8.3.1",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.12",
Expand All @@ -139,5 +139,9 @@
"repository": {
"type": "git",
"url": "https://github.com/lukasbach/yana.git"
},
"volta": {
"node": "16.19.1",
"yarn": "1.22.19"
}
}
2 changes: 1 addition & 1 deletion src/appdata/AppDataExportService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class AppDataExportService {

archive.directory(folder + '/', false);

return new Promise(res => {
return new Promise<void>(res => {
output.on('close', function () {
onUpdate('Clearing temporary folder');
rimraf(folder, () => {});
Expand Down
2 changes: 1 addition & 1 deletion src/appdata/AppDataProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export const AppDataProvider: React.FC = props => {
}

if (deleteData) {
await new Promise((res, rev) => {
await new Promise<void>((res, rev) => {
rimraf(workspace.dataSourceOptions.sourcePath, error => {
if (error) {
Alerter.Instance.alert({ content: 'Error: ' + error.message });
Expand Down
4 changes: 2 additions & 2 deletions src/appdata/runImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const runImport = async (
const folder = path.resolve(getElectronPath('temp'), 'yana-import');

onUpdate('Clearing temporary folder');
await new Promise(r => rimraf(folder, r));
await new Promise<void>((r: any) => rimraf(folder, r));
await fs.promises.mkdir(folder, { recursive: true });

onUpdate('Creating new workspace');
Expand All @@ -43,7 +43,7 @@ export const runImport = async (
await di.load();

onUpdate('Unzipping exported zip');
await new Promise(res =>
await new Promise<void>(res =>
fs
.createReadStream(sourcePath)
.pipe(unzipper.Extract({ path: folder }))
Expand Down
4 changes: 2 additions & 2 deletions src/common/runWithoutClose.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { closeEventEmitter } from './closeEventEmitter';

export const runWithoutClose = async (handler: () => Promise<any>) => {
let resolve: () => void = () => {};
const completePromise = new Promise(res => {
let resolve: any;
const completePromise = new Promise<void>(res => {
resolve = res;
});

Expand Down
2 changes: 1 addition & 1 deletion src/datasource/LocalSqliteDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class LocalSqliteDataSource implements AbstractDataSource {
}

// Create and wait for database just so its created on file. We do not need a reference to it here.
await new Promise(res => {
await new Promise<void>(res => {
new sqlite3.Database(path.join(sourcePath, DB_FILE), sqlite3.OPEN_CREATE, () => res());
});

Expand Down
7 changes: 5 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"strict": false,
"strictNullChecks": false,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": false,
"jsx": "react",
"outDir": "app",
"downlevelIteration": true
"downlevelIteration": true,
"experimentalDecorators": true,
"useUnknownInCatchVariables": false
},
"include": ["src"]
}
Loading

0 comments on commit f4fbccc

Please sign in to comment.