Skip to content

Commit

Permalink
Merge pull request #186 from muffinista/es6-webpack-cleanup
Browse files Browse the repository at this point in the history
Es6 webpack cleanup
  • Loading branch information
muffinista authored Feb 19, 2024
2 parents 1edadd0 + 944c288 commit 8c0f9d5
Show file tree
Hide file tree
Showing 46 changed files with 2,870 additions and 1,918 deletions.
48 changes: 0 additions & 48 deletions .eslintrc.js

This file was deleted.

23 changes: 23 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true,
"mocha": true,
"es6": true
},
"extends": [
"eslint:recommended",
"plugin:svelte/recommended",
"plugin:mocha/recommended"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
},
"plugins": [
"mocha"
]
}
26 changes: 15 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
# https://stackoverflow.com/questions/77251296/distutils-not-found-when-running-npm-install
PYTHON: 3.11
# PYTHON: 3.11
# "$Env:GYP_MSVS_VERSION": 2022
steps:
- name: Install ubuntu requirements
Expand All @@ -18,16 +18,19 @@ jobs:
sudo apt-get -qq update
sudo apt-get install -y libx11-dev libxss-dev icnsutils graphicsmagick libappindicator1 libxtst-dev
# https://github.com/nodejs/node-gyp/issues/2869
- name: Hack node-gyp
if: ${{ matrix.os != 'windows-latest' }}
run: |
sudo -H python3 -m pip install packaging
- uses: actions/checkout@v3
# - name: Hack node-gyp
# if: ${{ matrix.os != 'windows-latest' }}
# run: |
# sudo -H python3 -m pip install packaging
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Specify MSVS version
if: ${{ matrix.os == 'windows-latest' }}
shell: powershell
Expand All @@ -45,10 +48,11 @@ jobs:
- name: Run integration tests
if: ${{ matrix.os != 'ubuntu-latest' }}
run: npm run test-ui
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: always()
with:
name: logs
#/Users/runner/Library/Logs/mocha/
# ~/.config/Before Dawn/logs/
path: |
# ~/.config/Before Dawn/logs/
/Users/runner/Library/Logs/mocha/
# C:\Users\runneradmin\AppData\Roaming\mocha\logs\
C:\Users\runneradmin\AppData\Roaming\mocha\logs\
3 changes: 3 additions & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Setup code
run: npm i
- name: Run eslint
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@ jobs:
sudo apt-get -qq update
sudo apt-get install -y libx11-dev libxss-dev icnsutils graphicsmagick libappindicator1 libxtst-dev
# https://github.com/nodejs/node-gyp/issues/2869
- name: Hack node-gyp
if: ${{ matrix.os != 'windows-latest' }}
run: |
sudo -H python3 -m pip install packaging
- uses: actions/checkout@v3
# - name: Hack node-gyp
# if: ${{ matrix.os != 'windows-latest' }}
# run: |
# sudo -H python3 -m pip install packaging
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Specify MSVS version
if: ${{ matrix.os == 'windows-latest' }}
shell: powershell
Expand Down
23 changes: 10 additions & 13 deletions bin/build-icon.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
#!/usr/bin/env node

/* eslint-disable no-console */

require("dotenv").config();

const tmp = require("tmp");
const path = require("path");
const fs = require("fs");
const pngToIco = require("png-to-ico");
const jimp = require("jimp");

import "dotenv/config";
import * as path from "path";
import * as tmp from "tmp";
import * as fs from "fs";
import pngToIco from "png-to-ico";
import Jimp from "jimp";

const sizes = [256, 128, 48, 32, 16];

async function main() {
let outputs = [];
let pauseOutputs = [];

const image = await jimp.read("assets/icon.png");
const pauseImage = await jimp.read("assets/icon-paused.png");
const image = await Jimp.read("assets/icon.png");
const pauseImage = await Jimp.read("assets/icon-paused.png");

const tmpDir = tmp.dirSync().name;

Expand All @@ -28,13 +25,13 @@ async function main() {

// const images = sizes.map(async (s) => {
const name = path.join(tmpDir, `icon-${size}.png`);
await image.resize(size, jimp.AUTO);
await image.resize(size, Jimp.AUTO);
await image.writeAsync(name);

outputs.push(name);

const pausedName = path.join(tmpDir, `icon-paused-${size}.png`);
await pauseImage.resize(size, jimp.AUTO);
await pauseImage.resize(size, Jimp.AUTO);
await pauseImage.writeAsync(pausedName);

pauseOutputs.push(pausedName);
Expand Down
29 changes: 20 additions & 9 deletions bin/dev-runner.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
"use strict";

const electron = require("electron");
const path = require("path");
const { spawn } = require("child_process");
const webpack = require("webpack");
const WebpackDevServer = require("webpack-dev-server");
import electron from "electron";
import * as path from "path";
import { spawn } from "child_process";
import webpack from "webpack";
import WebpackDevServer from "webpack-dev-server";

const mainConfig = require("../webpack.main.config");
const rendererConfig = require("../webpack.renderer.config");
import { readFile } from 'fs/promises';
import { fileURLToPath } from 'url';

const __dirname = path.dirname(fileURLToPath(import.meta.url));

let devPort;

import mainConfig from "../webpack.main.config.js";
import rendererConfig from "../webpack.renderer.config.js";

try {
let packageJSON = require("../package.json");
const packageJSON = JSON.parse(
await readFile(
new URL('../package.json', import.meta.url)
)
);

devPort = packageJSON.devport;
}
catch(e) {
Expand Down Expand Up @@ -98,7 +108,8 @@ function startRenderer () {
}

function startElectron () {
electronProcess = spawn(electron, ["--inspect=5858", path.join(__dirname, "../src/main/index.dev.js")]);
// @todo set environment here
electronProcess = spawn(electron, ["--inspect=5858", path.join(__dirname, "../src/main/index.js")]);

electronProcess.stdout.on("data", data => {
process.stdout.write(data.toString());
Expand Down
Loading

0 comments on commit 8c0f9d5

Please sign in to comment.