From 0f3ee6f827280cd7be767b914b2413e1599e326f Mon Sep 17 00:00:00 2001 From: shawjia Date: Tue, 18 Dec 2018 19:27:09 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++ icon.png | Bin 0 -> 664 bytes pack.js | 28 ++++++++++++++++++ package.json | 11 +++++++ readme.md | 6 ++++ 5 files changed, 125 insertions(+) create mode 100644 .gitignore create mode 100644 icon.png create mode 100644 pack.js create mode 100644 package.json create mode 100644 readme.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..82778ab --- /dev/null +++ b/.gitignore @@ -0,0 +1,80 @@ +# Logs +dist +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# next.js build output +.next + +# nuxt.js build output +.nuxt + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ diff --git a/icon.png b/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3b10ed83badb3f1e029f20de912c01ba573d4f53 GIT binary patch literal 664 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K5893O0R7}x|G$6&~>Eakt!T3h1?h=p_2;#jx zcrf>g0|T=`?}Vh-NxQ#>ZuqIo*XIG!L<)#|(GqW4KJNhg^HV3gO%JSLn{kz4vs6MD z^O>xMNM3{0jA=v)zJBs_p0)qJ7crKN_N$22MXdSujrvvZY* literal 0 HcmV?d00001 diff --git a/pack.js b/pack.js new file mode 100644 index 0000000..2634870 --- /dev/null +++ b/pack.js @@ -0,0 +1,28 @@ +const nativefier = require('nativefier').default; +const { version: appVersion } = require('./package.json'); + +const options = { + name: 'GeekTime', + targetUrl: 'https://account.geekbang.org/dashboard/buy', + arch: 'x64', + platform: 'darwin', + appVersion, + icon: './icon.png', + out: './dist', + overwrite: true, + width: 720, + height: 960, + singleInstance: true, + fileDownloadOptions: { + saveAs: true + } +}; + +nativefier(options, (err, appPath) => { + if (err) { + console.error(err); + return; + } + + console.log(`saved to ${appPath}`); +}); diff --git a/package.json b/package.json new file mode 100644 index 0000000..5cd0c89 --- /dev/null +++ b/package.json @@ -0,0 +1,11 @@ +{ + "name": "geektime-macos", + "version": "0.0.1", + "private": true, + "scripts": { + "package": "node ./pack.js" + }, + "dependencies": { + "nativefier": "^7.6.9" + } +} \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..fc69dd2 --- /dev/null +++ b/readme.md @@ -0,0 +1,6 @@ +# geektime-macos + +> 使用 nativefier 创建的极客时间客户端,入口为[订阅列表](https://account.geekbang.org/dashboard/buy),下载地址:[releases](./releases)。 + +## 打包 +`npm run package` or `yarn run package`