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 0000000..3b10ed8 Binary files /dev/null and b/icon.png differ 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`