Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
30 changes: 0 additions & 30 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
node-version: 20.x
cache: 'yarn'
- name: Install
run: yarn install --frozen-lockfile
run: yarn install --immutable
- uses: continuousauth/action@4e8a2573eeb706f6d7300d6a9f3ca6322740b72d # v1.0.5
timeout-minutes: 60
with:
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ jobs:
strategy:
matrix:
node-version:
- '20.19'
- '18.18'
- '16.20'
- '14.21'
- 22.12.x
os:
- ubuntu-22.04
- windows-latest
Expand All @@ -43,11 +40,9 @@ jobs:
with:
node-version: "${{ matrix.node-version }}"
cache: 'yarn'
- name: Install (Node.js v16+)
if : ${{ matrix.node-version != '14.21' }}
run: yarn install --frozen-lockfile
- name: Install (Node.js v14)
if : ${{ matrix.node-version == '14.21' }}
run: yarn install --frozen-lockfile --ignore-engines
- name: Install Modules
run: yarn install --immutable
- name: Build
run: yarn build
- name: Test
run: yarn test
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
node_modules/
build/
tasks/
lib/
dist/
.idea/
npm-debug.log
SquirrelSetup.log
Expand All @@ -16,3 +16,4 @@ vendor/7z.dll
vendor/7z.exe
hook.log
docs
.yarn/install-state.gz
942 changes: 942 additions & 0 deletions .yarn/releases/yarn-4.10.3.cjs

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
enableScripts: false

nodeLinker: node-modules

npmMinimalAgeGate: 10080

npmPreapprovedPackages:
- "@electron/*"

yarnPath: .yarn/releases/yarn-4.10.3.cjs
36 changes: 36 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
languageOptions: {
parser: tseslint.parser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
globals: {
// Node.js globals
console: 'readonly',
process: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
module: 'readonly',
require: 'readonly',
exports: 'writable',
global: 'readonly',
},
},
rules: {
'strict': 0,
'indent': [2, 2],
'@typescript-eslint/no-var-requires': 'off',
'semi': [2, 'always'],
'no-console': 0,
'quotes': [2, 'single', 'avoid-escape'],
},
}
);
56 changes: 23 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"name": "electron-winstaller",
"version": "0.0.0-development",
"description": "Module to generate Windows installers for Electron apps",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"license": "MIT",
"repository": {
"type": "git",
Expand All @@ -19,55 +20,44 @@
"!vendor/7z.exe"
],
"scripts": {
"install": "node ./script/select-7z-arch.js",
"build": "tsc",
"docs": "npx typedoc",
"prepublish": "npm run build",
"docs": "yarn typedoc",
"prepack": "yarn build",
"lint": "eslint --ext .ts src spec",
"ava": "ava --timeout=60s",
"test": "npm run lint && npm run ava",
"tdd": "ava --watch"
"test": "yarn lint && vitest run",
"tdd": "vitest"
},
"dependencies": {
"@electron/asar": "^3.2.1",
"@electron/asar": "^4.0.1",
"debug": "^4.1.1",
"fs-extra": "^7.0.1",
"lodash": "^4.17.21",
"semver": "^7.6.3",
"temp": "^0.9.0"
},
"devDependencies": {
"@types/fs-extra": "^5.0.5",
"@types/lodash": "^4.17.0",
"@types/node": "^20.6.0",
"@eslint/js": "^9.37.0",
"@tsconfig/node22": "^22.0.2",
"@types/debug": "^4.1.12",
"@types/lodash": "^4.17.20",
"@types/node": "^20.19.19",
"@types/semver": "^7.7.1",
"@types/temp": "^0.8.34",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"ava": "^5.1.1",
"eslint": "^8.49.0",
"eslint-plugin-ava": "^14.0.0",
"ts-node": "^10.9.1",
"typedoc": "0.25.13",
"typescript": "^4.9.3"
"@typescript-eslint/eslint-plugin": "^8.45.0",
"@typescript-eslint/parser": "^8.45.0",
"eslint": "^9.37.0",
"typedoc": "0.28.13",
"typescript": "^5.9.3",
"typescript-eslint": "^8.45.0",
"vitest": "^3.2.4"
},
"optionalDependencies": {
"@electron/windows-sign": "^1.1.2"
"@electron/windows-sign": "^2.0.2"
},
"engines": {
"node": ">=8.0.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"node": ">=8.0.0"
"node": ">=22.12.0"

We should also mark this as a breaking change.

},
"publishConfig": {
"provenance": true
},
"ava": {
"extensions": [
"ts"
],
"files": [
"spec/*.ts"
],
"require": [
"ts-node/register/transpile-only"
]
}
"packageManager": "[email protected]+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f"
}
23 changes: 0 additions & 23 deletions script/select-7z-arch.js

This file was deleted.

24 changes: 13 additions & 11 deletions spec/convert-version-spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import test from 'ava';
import { describe, it, expect } from 'vitest';
import { convertVersion } from '../src/index';

test('makes semver versions into valid NuGet versions', (t): void => {
t.is(convertVersion('1'), '1');
t.is(convertVersion('1.2'), '1.2');
t.is(convertVersion('1.2.3'), '1.2.3');
t.is(convertVersion('1.2.3-alpha'), '1.2.3-alpha');
t.is(convertVersion('1.2.3-alpha.1'), '1.2.3-alpha1');
t.is(convertVersion('1.2.3-alpha.1.2'), '1.2.3-alpha12');
t.is(convertVersion('1.2.3-alpha-1-2'), '1.2.3-alpha-1-2');
t.is(convertVersion('1.2.3-alpha.1.2+build-meta.1.2'), '1.2.3-alpha12');
t.is(convertVersion('1.2.3-alpha-1-2+build-meta.1.2'), '1.2.3-alpha-1-2');
describe('convertVersion', () => {
it('makes semver versions into valid NuGet versions', (): void => {
expect(convertVersion('1')).toBe('1');
expect(convertVersion('1.2')).toBe('1.2');
expect(convertVersion('1.2.3')).toBe('1.2.3');
expect(convertVersion('1.2.3-alpha')).toBe('1.2.3-alpha');
expect(convertVersion('1.2.3-alpha.1')).toBe('1.2.3-alpha1');
expect(convertVersion('1.2.3-alpha.1.2')).toBe('1.2.3-alpha12');
expect(convertVersion('1.2.3-alpha-1-2')).toBe('1.2.3-alpha-1-2');
expect(convertVersion('1.2.3-alpha.1.2+build-meta.1.2')).toBe('1.2.3-alpha12');
expect(convertVersion('1.2.3-alpha-1-2+build-meta.1.2')).toBe('1.2.3-alpha-1-2');
});
});
6 changes: 3 additions & 3 deletions spec/helpers/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import path from 'path';
import fs from 'fs-extra';
import fs from 'node:fs/promises';
import path from 'node:path';

import { createTempDir } from '../../src/temp-utils';

export const FIXTURE_APP_DIR = path.join(__dirname, '../fixtures/app');

export async function createTempAppDirectory(): Promise<string> {
const appDirectory = await createTempDir('electron-winstaller-ad-');
await fs.copy(FIXTURE_APP_DIR, appDirectory);
await fs.cp(FIXTURE_APP_DIR, appDirectory, { recursive: true });
return appDirectory;
}
4 changes: 2 additions & 2 deletions spec/helpers/windowsSignHook.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require('fs-extra');
const path = require('path');
import fs from 'node:fs';
import path from 'node:path';

module.exports = function(args) {
console.log(...args);
Expand Down
Loading
Loading