mirror of
https://github.com/samuelthomas2774/nxapi.git
synced 2026-04-24 06:56:54 -05:00
Build caxa binary
This commit is contained in:
parent
c0c138ef49
commit
d750ed5a1f
2
bin/caxa
Executable file
2
bin/caxa
Executable file
|
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env sh
|
||||
"$(dirname "$0")/../node_modules/.bin/node" "$(dirname "$0")/nintendo-znc.js" $@
|
||||
1890
package-lock.json
generated
1890
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
|
@ -15,12 +15,16 @@
|
|||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"cli": "node bin/nintendo-znc.js",
|
||||
"build-macos-linux": "caxa --input . --exclude src dist/bin data node_modules --prepare-command \"npm ci --production\" --output dist/bin/nintendo-znc -- \"{{caxa}}/node_modules/.bin/node\" \"{{caxa}}/bin/nintendo-znc.js\"",
|
||||
"build-macosapp": "caxa --input . --exclude src dist/bin data node_modules --prepare-command \"npm ci --production\" --output dist/bin/nintendo-znc.app -- \"{{caxa}}/node_modules/.bin/node\" \"{{caxa}}/bin/nintendo-znc.js\" \"presence\"",
|
||||
"build-windows": "caxa --input . --exclude src dist/bin data node_modules --prepare-command \"npm ci --production\" --output dist/bin/nintendo-znc.exe -- \"{{caxa}}/node_modules/.bin/node\" \"{{caxa}}/bin/nintendo-znc.js\"",
|
||||
"start": "node bin/nintendo-znc.js presence"
|
||||
},
|
||||
"dependencies": {
|
||||
"cli-table": "^0.3.11",
|
||||
"debug": "^4.3.3",
|
||||
"discord-rpc": "^4.0.1",
|
||||
"env-paths": "^3.0.0",
|
||||
"express": "^4.17.3",
|
||||
"node-fetch": "^3.2.2",
|
||||
"node-notifier": "^10.0.1",
|
||||
|
|
@ -40,6 +44,7 @@
|
|||
"@types/read": "^0.0.29",
|
||||
"@types/uuid": "^8.3.4",
|
||||
"@types/yargs": "^17.0.9",
|
||||
"caxa": "^2.1.0",
|
||||
"typescript": "^4.7.0-dev.20220308"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import * as path from 'path';
|
||||
import createDebug from 'debug';
|
||||
import Yargs from 'yargs';
|
||||
import { YargsArguments } from './util.js';
|
||||
import { paths, YargsArguments } from './util.js';
|
||||
import * as commands from './cli/index.js';
|
||||
|
||||
const debug = createDebug('cli');
|
||||
|
|
@ -9,7 +8,7 @@ const debug = createDebug('cli');
|
|||
const yargs = Yargs(process.argv.slice(2)).option('data-path', {
|
||||
describe: 'Data storage path',
|
||||
type: 'string',
|
||||
default: path.join(import.meta.url.substr(7), '..', '..', 'data'),
|
||||
default: paths.data,
|
||||
}).option('znc-proxy-url', {
|
||||
describe: 'URL of Nintendo Switch Online app API proxy server to use',
|
||||
type: 'string',
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import * as yargs from 'yargs';
|
||||
import * as yargstypes from '../node_modules/@types/yargs/index.js';
|
||||
import type * as yargstypes from '../node_modules/@types/yargs/index.js';
|
||||
import createDebug from 'debug';
|
||||
import DiscordRPC from 'discord-rpc';
|
||||
import persist from 'node-persist';
|
||||
import * as path from 'path';
|
||||
import getPaths from 'env-paths';
|
||||
import { FlapgApiResponse } from './api/f.js';
|
||||
import { NintendoAccountToken, NintendoAccountUser } from './api/na.js';
|
||||
import { AccountLogin, CurrentUser, Game } from './api/znc-types.js';
|
||||
|
|
@ -13,6 +13,8 @@ import ZncProxyApi from './api/znc-proxy.js';
|
|||
|
||||
const debug = createDebug('cli');
|
||||
|
||||
export const paths = getPaths('nintendo-znc');
|
||||
|
||||
export type YargsArguments<T extends yargs.Argv> = T extends yargs.Argv<infer R> ? R : any;
|
||||
export type Argv<T = {}> = yargs.Argv<T>;
|
||||
export type ArgumentsCamelCase<T = {}> = yargstypes.ArgumentsCamelCase<T>;
|
||||
|
|
@ -30,7 +32,7 @@ export interface SavedToken {
|
|||
proxy_url?: string;
|
||||
}
|
||||
|
||||
export async function initStorage(dir = path.join(import.meta.url.substr(7), '..', '..', 'data')) {
|
||||
export async function initStorage(dir: string) {
|
||||
const storage = persist.create({
|
||||
dir,
|
||||
stringify: data => JSON.stringify(data, null, 4) + '\n',
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user