Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02119d5a83 | ||
|
|
1948f1caa9 | ||
|
|
52fa9a2a78 | ||
|
|
4e631b7ca2 | ||
|
|
fe1a0e06b0 |
29
.github/workflows/add-to-project.yml
vendored
Normal file
29
.github/workflows/add-to-project.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
name: Add to Ecosystem WG Project
|
||||||
|
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
pull_request_target:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
add-to-project:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Generate GitHub App token
|
||||||
|
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
|
||||||
|
id: generate-token
|
||||||
|
with:
|
||||||
|
creds: ${{ secrets.ECOSYSTEM_ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||||
|
org: electron
|
||||||
|
- name: Add to Project
|
||||||
|
uses: dsanders11/project-actions/add-item@3a81985616963f32fae17d1d1b406c631f3201a1 # v1.1.0
|
||||||
|
with:
|
||||||
|
field: Opened
|
||||||
|
field-value: ${{ github.event.pull_request.created_at || github.event.issue.created_at }}
|
||||||
|
project-number: 89
|
||||||
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,3 +1,5 @@
|
|||||||
node_modules
|
node_modules
|
||||||
dist
|
dist
|
||||||
*.app
|
entry-asar/*.js*
|
||||||
|
entry-asar/*.ts
|
||||||
|
*.app
|
||||||
|
|||||||
19
entry-asar/ambient.d.ts
vendored
Normal file
19
entry-asar/ambient.d.ts
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
declare namespace NodeJS {
|
||||||
|
interface Process extends EventEmitter {
|
||||||
|
// This is an undocumented private API. It exists.
|
||||||
|
_archPath: string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module 'electron' {
|
||||||
|
const app: Electron.App;
|
||||||
|
|
||||||
|
namespace Electron {
|
||||||
|
interface App {
|
||||||
|
getAppPath: () => string;
|
||||||
|
setAppPath: (p: string) => void;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export { app };
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
const path = require('path');
|
import { app } from 'electron';
|
||||||
|
import path from 'path';
|
||||||
|
|
||||||
if (process.arch === 'arm64') {
|
if (process.arch === 'arm64') {
|
||||||
setPaths('arm64');
|
setPaths('arm64');
|
||||||
@@ -6,7 +7,7 @@ if (process.arch === 'arm64') {
|
|||||||
setPaths('x64');
|
setPaths('x64');
|
||||||
}
|
}
|
||||||
|
|
||||||
function setPaths(platform) {
|
function setPaths(platform: string) {
|
||||||
// This should return the full path, ending in something like
|
// This should return the full path, ending in something like
|
||||||
// Notion.app/Contents/Resources/app.asar
|
// Notion.app/Contents/Resources/app.asar
|
||||||
const appPath = app.getAppPath();
|
const appPath = app.getAppPath();
|
||||||
@@ -1,10 +1,13 @@
|
|||||||
|
import { app } from 'electron';
|
||||||
|
import path from 'path';
|
||||||
|
|
||||||
if (process.arch === 'arm64') {
|
if (process.arch === 'arm64') {
|
||||||
setPaths('arm64');
|
setPaths('arm64');
|
||||||
} else {
|
} else {
|
||||||
setPaths('x64');
|
setPaths('x64');
|
||||||
}
|
}
|
||||||
|
|
||||||
function setPaths(platform) {
|
function setPaths(platform: string) {
|
||||||
// This should return the full path, ending in something like
|
// This should return the full path, ending in something like
|
||||||
// Notion.app/Contents/Resources/app
|
// Notion.app/Contents/Resources/app
|
||||||
const appPath = app.getAppPath();
|
const appPath = app.getAppPath();
|
||||||
@@ -20,13 +20,14 @@
|
|||||||
"files": [
|
"files": [
|
||||||
"dist/*",
|
"dist/*",
|
||||||
"entry-asar/*",
|
"entry-asar/*",
|
||||||
|
"!entry-asar/**/*.ts",
|
||||||
"README.md"
|
"README.md"
|
||||||
],
|
],
|
||||||
"author": "Samuel Attard",
|
"author": "Samuel Attard",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc && tsc -p tsconfig.esm.json",
|
"build": "tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json && tsc -p tsconfig.entry-asar.json",
|
||||||
"lint": "prettier --check \"{src,entry-asar}/**/*.{js,ts}\"",
|
"lint": "prettier --check \"{src,entry-asar}/**/*.ts\"",
|
||||||
"prettier:write": "prettier --write \"{src,entry-asar}/**/*.{js,ts}\"",
|
"prettier:write": "prettier --write \"{src,entry-asar}/**/*.ts\"",
|
||||||
"prepublishOnly": "npm run build",
|
"prepublishOnly": "npm run build",
|
||||||
"test": "exit 0",
|
"test": "exit 0",
|
||||||
"prepare": "husky install"
|
"prepare": "husky install"
|
||||||
@@ -57,4 +58,4 @@
|
|||||||
"prettier --write"
|
"prettier --write"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import * as asar from '@electron/asar';
|
import asar from '@electron/asar';
|
||||||
import { execFileSync } from 'child_process';
|
import { execFileSync } from 'child_process';
|
||||||
import * as crypto from 'crypto';
|
import crypto from 'crypto';
|
||||||
import * as fs from 'fs-extra';
|
import fs from 'fs-extra';
|
||||||
import * as path from 'path';
|
import path from 'path';
|
||||||
import * as minimatch from 'minimatch';
|
import minimatch from 'minimatch';
|
||||||
import * as os from 'os';
|
import os from 'os';
|
||||||
import { d } from './debug';
|
import { d } from './debug';
|
||||||
|
|
||||||
const LIPO = 'lipo';
|
const LIPO = 'lipo';
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
import * as debug from 'debug';
|
import debug from 'debug';
|
||||||
|
|
||||||
export const d = debug('electron-universal');
|
export const d = debug('electron-universal');
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { spawn } from '@malept/cross-spawn-promise';
|
|||||||
import * as asar from '@electron/asar';
|
import * as asar from '@electron/asar';
|
||||||
import * as crypto from 'crypto';
|
import * as crypto from 'crypto';
|
||||||
import * as fs from 'fs-extra';
|
import * as fs from 'fs-extra';
|
||||||
import * as minimatch from 'minimatch';
|
import minimatch from 'minimatch';
|
||||||
import * as os from 'os';
|
import * as os from 'os';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as plist from 'plist';
|
import * as plist from 'plist';
|
||||||
|
|||||||
4
tsconfig.cjs.json
Normal file
4
tsconfig.cjs.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"include": ["src"]
|
||||||
|
}
|
||||||
10
tsconfig.entry-asar.json
Normal file
10
tsconfig.entry-asar.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "entry-asar",
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"entry-asar"
|
||||||
|
],
|
||||||
|
"exclude": []
|
||||||
|
}
|
||||||
@@ -3,5 +3,6 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"outDir": "dist/esm"
|
"outDir": "dist/esm"
|
||||||
}
|
},
|
||||||
}
|
"include": ["src"]
|
||||||
|
}
|
||||||
|
|||||||
@@ -13,9 +13,11 @@
|
|||||||
],
|
],
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
|
"esModuleInterop": true,
|
||||||
"declaration": true
|
"declaration": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src"
|
"src",
|
||||||
|
"entry-asar"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
16
yarn.lock
16
yarn.lock
@@ -731,27 +731,13 @@ cssesc@^3.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee"
|
resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee"
|
||||||
integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==
|
integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==
|
||||||
|
|
||||||
debug@4, debug@^4.2.0:
|
debug@4, debug@^4.1.0, debug@^4.2.0, debug@^4.3.1, debug@^4.3.3:
|
||||||
version "4.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/debug/-/debug-4.2.0.tgz#7f150f93920e94c58f5574c2fd01a3110effe7f1"
|
|
||||||
integrity sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==
|
|
||||||
dependencies:
|
|
||||||
ms "2.1.2"
|
|
||||||
|
|
||||||
debug@^4.1.0, debug@^4.3.3:
|
|
||||||
version "4.3.4"
|
version "4.3.4"
|
||||||
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
|
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
|
||||||
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
|
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
ms "2.1.2"
|
ms "2.1.2"
|
||||||
|
|
||||||
debug@^4.3.1:
|
|
||||||
version "4.3.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee"
|
|
||||||
integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==
|
|
||||||
dependencies:
|
|
||||||
ms "2.1.2"
|
|
||||||
|
|
||||||
debuglog@^1.0.1:
|
debuglog@^1.0.1:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492"
|
resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492"
|
||||||
|
|||||||
Reference in New Issue
Block a user