Skip to content

Commit

Permalink
Merge pull request #15 from el3um4s/update-sveltekit
Browse files Browse the repository at this point in the history
Update sveltekit
  • Loading branch information
el3um4s authored Sep 16, 2022
2 parents 17f6486 + e917f38 commit 09595d8
Show file tree
Hide file tree
Showing 43 changed files with 6,106 additions and 4,308 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ node_modules
package
dist
out
.dist-rollup
.svelte-rollup
32 changes: 0 additions & 32 deletions electron/IPC/General/IPC.ts

This file was deleted.

9 changes: 0 additions & 9 deletions electron/IPC/General/channelsInterface.ts

This file was deleted.

54 changes: 0 additions & 54 deletions electron/IPC/General/contextBridge.ts

This file was deleted.

2 changes: 0 additions & 2 deletions electron/IPC/fileSystem.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// import { SendChannels } from "./General/channelsInterface";
// import IPC from "./General/IPC";
import { IPC, SendChannels } from "@el3um4s/ipc-for-electron";

import { app, BrowserWindow } from "electron";
Expand Down
2 changes: 0 additions & 2 deletions electron/IPC/systemInfo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// import { SendChannels } from "./General/channelsInterface";
// import IPC from "./General/IPC";
import { IPC, SendChannels } from "@el3um4s/ipc-for-electron";
import { BrowserWindow } from "electron";

Expand Down
2 changes: 0 additions & 2 deletions electron/IPC/updaterInfo.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { BrowserWindow, app } from "electron";
import { AppUpdater, autoUpdater } from "electron-updater";
// import { SendChannels } from "./General/channelsInterface";
// import IPC from "./General/IPC";
import { IPC, SendChannels } from "@el3um4s/ipc-for-electron";

const nameAPI = "updaterInfo";
Expand Down
14 changes: 2 additions & 12 deletions electron/mainWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ import EventEmitter from "events";
import ConfigureDev from "./configureDev";
import { DeveloperOptions } from "./configureDev";

import { ipcMain } from "electron";
import { autoUpdater } from "electron-updater";
import systemInfo from "./IPC/systemInfo";
import updaterInfo from "./IPC/updaterInfo";
import fileSystem from "./IPC/fileSystem";

import globals from "./globals";

const appName = "MEMENTO - SvelteKit, Electron, TypeScript";

const defaultSettings = {
Expand Down Expand Up @@ -74,22 +66,20 @@ class Main {
async createWindow() {
let settings = { ...this.settings };
app.name = appName;
const preload = globals.get.preloadjs();
let window = new BrowserWindow({
...settings,
show: false, // false
show: false,
webPreferences: {
nodeIntegration: false,
contextIsolation: true,
// enableRemoteModule: true,
sandbox: false,
preload: path.join(__dirname, "preload.js"),
},
});

if (this.configDev.isLocalHost()) {
try {
await window.loadURL("http://localhost:3000/");
await window.loadURL("http://localhost:5173/");
} catch (error) {
console.log(`ERROR: window.loadURL("http://localhost:3000/");`);
console.log(error);
Expand Down
1 change: 0 additions & 1 deletion electron/preload.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// import { generateContextBridge } from "./IPC/General/contextBridge";
import { generateContextBridge } from "@el3um4s/ipc-for-electron";

import systemInfo from "./IPC/systemInfo";
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Memento: how to use Svelte with Electron and TypeScript",
"author": "Samuele de Tomasi <[email protected]>",
"license": "MIT",
"version": "0.1.0",
"version": "0.2.0",
"main": "dist/index.js",
"scripts": {
"nodemon": "nodemon",
Expand All @@ -13,7 +13,10 @@
"svelte:build": "cd svelte && npm run build",
"compile": "tsc",
"out:win": "npm run svelte:build && npm run compile && electron-builder build --win --publish never",
"publish:win": "npm run svelte:build && npm run compile && electron-builder build --win --publish always"
"publish:win": "npm run svelte:build && npm run compile && electron-builder build --win --publish always",
"check-updates": "npx npm-check-updates",
"check-updates:minor": "npx npm-check-updates --target minor",
"check-updates:patch": "npx npm-check-updates --target patch"
},
"devDependencies": {
"@types/node": "^18.7.18",
Expand Down
13 changes: 13 additions & 0 deletions svelte/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
2 changes: 1 addition & 1 deletion svelte/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2019
ecmaVersion: 2020
},
env: {
browser: true,
Expand Down
6 changes: 6 additions & 0 deletions svelte/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
.vercel
.output
17 changes: 13 additions & 4 deletions svelte/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
.svelte-kit/**
static/**
build/**
node_modules/**
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
4 changes: 3 additions & 1 deletion svelte/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100
"printWidth": 100,
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
14 changes: 7 additions & 7 deletions svelte/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# create-svelte

Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte);
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).

## Creating a project

If you're seeing this, you've probably already done this step. Congrats!

```bash
# create a new project in the current directory
npm init svelte@next
npm create svelte@latest

# create a new project in my-app
npm init svelte@next my-app
npm create svelte@latest my-app
```

> Note: the `@next` is temporary
## Developing

Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
Expand All @@ -29,10 +27,12 @@ npm run dev -- --open

## Building

Before creating a production version of your app, install an [adapter](https://kit.svelte.dev/docs#adapters) for your target environment. Then:
To create a production version of your app:

```bash
npm run build
```

> You can preview the built app with `npm run preview`, regardless of whether you installed an adapter. This should _not_ be used to serve your app in production.
You can preview the production build with `npm run preview`.

> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
Loading

0 comments on commit 09595d8

Please sign in to comment.