pake-cli 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js ADDED
@@ -0,0 +1 @@
1
+ import*as e from"commander";import{program as a}from"commander";import i,{fileURLToPath as t}from"url";import o from"is-url";import r from"prompts";import n from"crypto";import s from"axios";import{fileTypeFromBuffer as l}from"file-type";import{dir as c}from"tmp-promise";import u from"path";import d from"fs/promises";import m from"loglevel";import p from"ora";import g from"shelljs";function h(e,a,i,t){return new(i||(i=Promise))((function(o,r){function n(e){try{l(t.next(e))}catch(e){r(e)}}function s(e){try{l(t.throw(e))}catch(e){r(e)}}function l(e){var a;e.done?o(e.value):(a=e.value,a instanceof i?a:new i((function(e){e(a)}))).then(n,s)}l((t=t.apply(e,a||[])).next())}))}const b="",f=800,y=1280,v=!1,w=!0,k=!1,x=["aaa","aarp","abarth","abb","abbott","abbvie","abc","able","abogado","abudhabi","ac","academy","accenture","accountant","accountants","aco","actor","ad","adac","ads","adult","ae","aeg","aero","aetna","af","afl","africa","ag","agakhan","agency","ai","aig","airbus","airforce","airtel","akdn","al","alfaromeo","alibaba","alipay","allfinanz","allstate","ally","alsace","alstom","am","amazon","americanexpress","americanfamily","amex","amfam","amica","amsterdam","analytics","android","anquan","anz","ao","aol","apartments","app","apple","aq","aquarelle","ar","arab","aramco","archi","army","arpa","art","arte","as","asda","asia","associates","at","athleta","attorney","au","auction","audi","audible","audio","auspost","author","auto","autos","avianca","aw","aws","ax","axa","az","azure","ba","baby","baidu","banamex","bananarepublic","band","bank","bar","barcelona","barclaycard","barclays","barefoot","bargains","baseball","basketball","bauhaus","bayern","bb","bbc","bbt","bbva","bcg","bcn","bd","be","beats","beauty","beer","bentley","berlin","best","bestbuy","bet","bf","bg","bh","bharti","bi","bible","bid","bike","bing","bingo","bio","biz","bj","black","blackfriday","blockbuster","blog","bloomberg","blue","bm","bms","bmw","bn","bnpparibas","bo","boats","boehringer","bofa","bom","bond","boo","book","booking","bosch","bostik","boston","bot","boutique","box","br","bradesco","bridgestone","broadway","broker","brother","brussels","bs","bt","build","builders","business","buy","buzz","bv","bw","by","bz","bzh","ca","cab","cafe","cal","call","calvinklein","cam","camera","camp","canon","capetown","capital","capitalone","car","caravan","cards","care","career","careers","cars","casa","case","cash","casino","cat","catering","catholic","cba","cbn","cbre","cbs","cc","cd","center","ceo","cern","cf","cfa","cfd","cg","ch","chanel","channel","charity","chase","chat","cheap","chintai","christmas","chrome","church","ci","cipriani","circle","cisco","citadel","citi","citic","city","cityeats","ck","cl","claims","cleaning","click","clinic","clinique","clothing","cloud","club","clubmed","cm","cn","co","coach","codes","coffee","college","cologne","com","comcast","commbank","community","company","compare","computer","comsec","condos","construction","consulting","contact","contractors","cooking","cookingchannel","cool","coop","corsica","country","coupon","coupons","courses","cpa","cr","credit","creditcard","creditunion","cricket","crown","crs","cruise","cruises","cu","cuisinella","cv","cw","cx","cy","cymru","cyou","cz","dabur","dad","dance","data","date","dating","datsun","day","dclk","dds","de","deal","dealer","deals","degree","delivery","dell","deloitte","delta","democrat","dental","dentist","desi","design","dev","dhl","diamonds","diet","digital","direct","directory","discount","discover","dish","diy","dj","dk","dm","dnp","do","docs","doctor","dog","domains","dot","download","drive","dtv","dubai","dunlop","dupont","durban","dvag","dvr","dz","earth","eat","ec","eco","edeka","edu","education","ee","eg","email","emerck","energy","engineer","engineering","enterprises","epson","equipment","er","ericsson","erni","es","esq","estate","et","etisalat","eu","eurovision","eus","events","exchange","expert","exposed","express","extraspace","fage","fail","fairwinds","faith","family","fan","fans","farm","farmers","fashion","fast","fedex","feedback","ferrari","ferrero","fi","fiat","fidelity","fido","film","final","finance","financial","fire","firestone","firmdale","fish","fishing","fit","fitness","fj","fk","flickr","flights","flir","florist","flowers","fly","fm","fo","foo","food","foodnetwork","football","ford","forex","forsale","forum","foundation","fox","fr","free","fresenius","frl","frogans","frontdoor","frontier","ftr","fujitsu","fun","fund","furniture","futbol","fyi","ga","gal","gallery","gallo","gallup","game","games","gap","garden","gay","gb","gbiz","gd","gdn","ge","gea","gent","genting","george","gf","gg","ggee","gh","gi","gift","gifts","gives","giving","gl","glass","gle","global","globo","gm","gmail","gmbh","gmo","gmx","gn","godaddy","gold","goldpoint","golf","goo","goodyear","goog","google","gop","got","gov","gp","gq","gr","grainger","graphics","gratis","green","gripe","grocery","group","gs","gt","gu","guardian","gucci","guge","guide","guitars","guru","gw","gy","hair","hamburg","hangout","haus","hbo","hdfc","hdfcbank","health","healthcare","help","helsinki","here","hermes","hgtv","hiphop","hisamitsu","hitachi","hiv","hk","hkt","hm","hn","hockey","holdings","holiday","homedepot","homegoods","homes","homesense","honda","horse","hospital","host","hosting","hot","hoteles","hotels","hotmail","house","how","hr","hsbc","ht","hu","hughes","hyatt","hyundai","ibm","icbc","ice","icu","id","ie","ieee","ifm","ikano","il","im","imamat","imdb","immo","immobilien","in","inc","industries","infiniti","info","ing","ink","institute","insurance","insure","int","international","intuit","investments","io","ipiranga","iq","ir","irish","is","ismaili","ist","istanbul","it","itau","itv","jaguar","java","jcb","je","jeep","jetzt","jewelry","jio","jll","jm","jmp","jnj","jo","jobs","joburg","jot","joy","jp","jpmorgan","jprs","juegos","juniper","kaufen","kddi","ke","kerryhotels","kerrylogistics","kerryproperties","kfh","kg","kh","ki","kia","kids","kim","kinder","kindle","kitchen","kiwi","km","kn","koeln","komatsu","kosher","kp","kpmg","kpn","kr","krd","kred","kuokgroup","kw","ky","kyoto","kz","la","lacaixa","lamborghini","lamer","lancaster","lancia","land","landrover","lanxess","lasalle","lat","latino","latrobe","law","lawyer","lb","lc","lds","lease","leclerc","lefrak","legal","lego","lexus","lgbt","li","lidl","life","lifeinsurance","lifestyle","lighting","like","lilly","limited","limo","lincoln","linde","link","lipsy","live","living","lk","llc","llp","loan","loans","locker","locus","loft","lol","london","lotte","lotto","love","lpl","lplfinancial","lr","ls","lt","ltd","ltda","lu","lundbeck","luxe","luxury","lv","ly","ma","macys","madrid","maif","maison","makeup","man","management","mango","map","market","marketing","markets","marriott","marshalls","maserati","mattel","mba","mc","mckinsey","md","me","med","media","meet","melbourne","meme","memorial","men","menu","merckmsd","mg","mh","miami","microsoft","mil","mini","mint","mit","mitsubishi","mk","ml","mlb","mls","mm","mma","mn","mo","mobi","mobile","moda","moe","moi","mom","monash","money","monster","mormon","mortgage","moscow","moto","motorcycles","mov","movie","mp","mq","mr","ms","msd","mt","mtn","mtr","mu","museum","music","mutual","mv","mw","mx","my","mz","na","nab","nagoya","name","natura","navy","nba","nc","ne","nec","net","netbank","netflix","network","neustar","new","news","next","nextdirect","nexus","nf","nfl","ng","ngo","nhk","ni","nico","nike","nikon","ninja","nissan","nissay","nl","no","nokia","northwesternmutual","norton","now","nowruz","nowtv","np","nr","nra","nrw","ntt","nu","nyc","nz","obi","observer","office","okinawa","olayan","olayangroup","oldnavy","ollo","om","omega","one","ong","onl","online","ooo","open","oracle","orange","org","organic","origins","osaka","otsuka","ott","ovh","pa","page","panasonic","paris","pars","partners","parts","party","passagens","pay","pccw","pe","pet","pf","pfizer","pg","ph","pharmacy","phd","philips","phone","photo","photography","photos","physio","pics","pictet","pictures","pid","pin","ping","pink","pioneer","pizza","pk","pl","place","play","playstation","plumbing","plus","pm","pn","pnc","pohl","poker","politie","porn","post","pr","pramerica","praxi","press","prime","pro","prod","productions","prof","progressive","promo","properties","property","protection","pru","prudential","ps","pt","pub","pw","pwc","py","qa","qpon","quebec","quest","racing","radio","re","read","realestate","realtor","realty","recipes","red","redstone","redumbrella","rehab","reise","reisen","reit","reliance","ren","rent","rentals","repair","report","republican","rest","restaurant","review","reviews","rexroth","rich","richardli","ricoh","ril","rio","rip","ro","rocher","rocks","rodeo","rogers","room","rs","rsvp","ru","rugby","ruhr","run","rw","rwe","ryukyu","sa","saarland","safe","safety","sakura","sale","salon","samsclub","samsung","sandvik","sandvikcoromant","sanofi","sap","sarl","sas","save","saxo","sb","sbi","sbs","sc","sca","scb","schaeffler","schmidt","scholarships","school","schule","schwarz","science","scot","sd","se","search","seat","secure","security","seek","select","sener","services","ses","seven","sew","sex","sexy","sfr","sg","sh","shangrila","sharp","shaw","shell","shia","shiksha","shoes","shop","shopping","shouji","show","showtime","si","silk","sina","singles","site","sj","sk","ski","skin","sky","skype","sl","sling","sm","smart","smile","sn","sncf","so","soccer","social","softbank","software","sohu","solar","solutions","song","sony","soy","spa","space","sport","spot","sr","srl","ss","st","stada","staples","star","statebank","statefarm","stc","stcgroup","stockholm","storage","store","stream","studio","study","style","su","sucks","supplies","supply","support","surf","surgery","suzuki","sv","swatch","swiss","sx","sy","sydney","systems","sz","tab","taipei","talk","taobao","target","tatamotors","tatar","tattoo","tax","taxi","tc","tci","td","tdk","team","tech","technology","tel","temasek","tennis","teva","tf","tg","th","thd","theater","theatre","tiaa","tickets","tienda","tiffany","tips","tires","tirol","tj","tjmaxx","tjx","tk","tkmaxx","tl","tm","tmall","tn","to","today","tokyo","tools","top","toray","toshiba","total","tours","town","toyota","toys","tr","trade","trading","training","travel","travelchannel","travelers","travelersinsurance","trust","trv","tt","tube","tui","tunes","tushu","tv","tvs","tw","tz","ua","ubank","ubs","ug","uk","unicom","university","uno","uol","ups","us","uy","uz","va","vacations","vana","vanguard","vc","ve","vegas","ventures","verisign","vermögensberater","vermögensberatung","versicherung","vet","vg","vi","viajes","video","vig","viking","villas","vin","vip","virgin","visa","vision","viva","vivo","vlaanderen","vn","vodka","volkswagen","volvo","vote","voting","voto","voyage","vu","vuelos","wales","walmart","walter","wang","wanggou","watch","watches","weather","weatherchannel","webcam","weber","website","wed","wedding","weibo","weir","wf","whoswho","wien","wiki","williamhill","win","windows","wine","winners","wme","wolterskluwer","woodside","work","works","world","wow","ws","wtc","wtf","xbox","xerox","xfinity","xihuan","xin","xxx","xyz","yachts","yahoo","yamaxun","yandex","ye","yodobashi","yoga","yokohama","you","youtube","yt","yun","za","zappos","zara","zero","zip","zm","zone","zuerich","zw","ελ","ευ","бг","бел","дети","ею","католик","ком","мкд","мон","москва","онлайн","орг","рус","рф","сайт","срб","укр","қаз","հայ","ישראל","קום","ابوظبي","اتصالات","ارامكو","الاردن","البحرين","الجزائر","السعودية","العليان","المغرب","امارات","ایران","بارت","بازار","بيتك","بھارت","تونس","سودان","سورية","شبكة","عراق","عرب","عمان","فلسطين","قطر","كاثوليك","كوم","مصر","مليسيا","موريتانيا","موقع","همراه","پاکستان","ڀارت","कॉम","नेट","भारत","भारतम्","भारोत","संगठन","বাংলা","ভারত","ভাৰত","ਭਾਰਤ","ભારત","ଭାରତ","இந்தியா","இலங்கை","சிங்கப்பூர்","భారత్","ಭಾರತ","ഭാരതം","ලංකා","คอม","ไทย","ລາວ","გე","みんな","アマゾン","クラウド","グーグル","コム","ストア","セール","ファッション","ポイント","世界","中信","中国","中國","中文网","亚马逊","企业","佛山","信息","健康","八卦","公司","公益","台湾","台灣","商城","商店","商标","嘉里","嘉里大酒店","在线","大拿","天主教","娱乐","家電","广东","微博","慈善","我爱你","手机","招聘","政务","政府","新加坡","新闻","时尚","書籍","机构","淡马锡","游戏","澳門","点看","移动","组织机构","网址","网店","网站","网络","联通","诺基亚","谷歌","购物","通販","集团","電訊盈科","飞利浦","食品","餐厅","香格里拉","香港","닷넷","닷컴","삼성","한국"];function j(e){var a=i.parse(e).host.split(".");"www"===a[0]&&"com"!==a[1]&&a.shift();for(var t,o=a.length,r=o,n=a[a.length-1].length;t=a[--r];)if(0===r||r<o-2||t.length<n||x.indexOf(t)<0)return t}function z(e){const a=function(e){if(!i.parse(e).protocol)return`https://${e}`;return e}(e);if(o(a))return a;throw new Error(`Your url "${a}" is invalid`)}function q(a){const i=Number(a);if(isNaN(i))throw new e.InvalidArgumentError("Not a number.");return i}function N(e,a){return h(this,void 0,void 0,(function*(){return e.icon?e.icon.startsWith("http")?function(e){return h(this,void 0,void 0,(function*(){let a;try{a=yield s.get(e,{responseType:"arraybuffer"})}catch(e){if(e.response&&404===e.response.status)return null;throw e}const i=yield a.data;if(!i)return null;const t=yield l(i);if(!t)return null;const{path:o}=yield c(),r=`${o}/icon.${t.ext}`;return yield d.writeFile(r,i),r}))}(e.icon):u.resolve(e.icon):e.icon?void 0:function(e,a){return h(this,void 0,void 0,(function*(){m.info("You have not provided an app icon, use the default icon(can use --icon option to assign an icon)");const e=u.join(u.dirname(t(import.meta.url)),"..");return u.join(e,"pake-default.icns")}))}(e.name)}))}function $(e,a){return h(this,void 0,void 0,(function*(){const i=Object.assign(Object.assign({},e),{identifier:""});return i.name||(i.name=yield function(e,a){return h(this,void 0,void 0,(function*(){return(yield r({type:"text",name:"content",message:e,initial:a})).content}))}("please input your application name",j(a))),i.identifier=function(e,a){const i=n.createHash("md5");return i.update(a),`pake-${i.digest("hex").substring(0,6)}`}(i.name,a),i.icon=yield N(i),i}))}const A="darwin"===process.platform;function D(e){return new Promise(((a,i)=>{g.exec(e,{async:!0,silent:!1},(e=>{0===e?a(0):i(new Error(`${e}`))}))}))}process.platform,process.platform;var O={package:{productName:"weread",version:"0.2.0"},tauri:{windows:[{url:"https://weread.qq.com/",transparent:!0,fullscreen:!1,width:1200,height:728,resizable:!0}],allowlist:{all:!0},bundle:{icon:["icons/weread.icns","png/weread_256.ico","png/weread_32.ico","png/weread_512.png"],identifier:"com.tw93.weread",active:!0,category:"DeveloperTool",copyright:"",deb:{depends:["libwebkit2gtk-4.0-dev","build-essential","curl","wget","libssl-dev","libgtk-3-dev","libayatana-appindicator3-dev","librsvg2-dev"],files:{"/usr/share/applications/com-tw93-weread.desktop":"assets/com-tw93-weread.desktop"}},externalBin:[],longDescription:"",macOS:{entitlements:null,exceptionDomain:"",frameworks:[],providerShortName:null,signingIdentity:null},resources:["png/weread_32.ico"],shortDescription:"",targets:["deb","msi","dmg"],windows:{certificateThumbprint:null,digestAlgorithm:"sha256",timestampUrl:"",wix:{language:["en-US","zh-CN"]}}},security:{csp:null},updater:{active:!1}},build:{devPath:"../dist",distDir:"../dist",beforeBuildCommand:"",beforeDevCommand:""}};class E{prepare(){return h(this,void 0,void 0,(function*(){if(0===g.exec("rustc --version",{silent:!0}).code)return;(yield r({type:"confirm",message:"We detected that you have not installed Rust. Install it now?",name:"value"})).value?yield function(){return h(this,void 0,void 0,(function*(){const e=p("Downloading Rust").start();try{yield D("curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y"),e.succeed()}catch(a){console.error("install rust return code",a.message),e.fail(),process.exit(1)}}))}():(m.error("Error: Pake need Rust to package your webapp!!!"),process.exit(2))}))}build(e,a){return h(this,void 0,void 0,(function*(){m.debug("PakeAppOptions",a);const{width:i,height:o,fullscreen:r,transparent:n,resizable:s,identifier:l,name:c}=a,p={width:i,height:o,fullscreen:r,transparent:n,resizable:s};Object.assign(O.tauri.windows[0],Object.assign({url:e},p)),O.package.productName=c,O.tauri.bundle.identifier=l,O.tauri.bundle.icon=[a.icon];const g=u.join(u.dirname(t(import.meta.url)),".."),h=u.join(g,"src-tauri/tauri.conf.json");yield d.writeFile(h,Buffer.from(JSON.stringify(O),"utf-8")),yield D(`cd ${g} && npm run build`);const b=`${c}_0.2.0_universal.dmg`,f=this.getBuildedAppPath(g,b);yield d.copyFile(f,u.resolve(`${c}_universal.dmg`))}))}getBuildedAppPath(e,a){return u.join(e,"src-tauri/target/universal-apple-darwin/release/bundle/dmg",a)}}class P{static create(){if(A)return new E;throw new Error("The current system does not support")}}a.version("0.0.1").description("A cli application can package a web page to desktop application"),a.showHelpAfterError().argument("<url>","the web url you want to package",(function(a){try{return z(a)}catch(a){throw new e.InvalidArgumentError(a.message)}})).option("--name <string>","application name").option("--icon <string>","application icon",b).option("--height <number>","window height",q,f).option("--width <number>","window width",q,y).option("--no-resizable","whether the window can be resizable",w).option("--fullscreen","makes the packaged app start in full screen",v).option("--transparent","transparent title bar",k).option("--debug","debug",k).action(((e,a)=>h(void 0,void 0,void 0,(function*(){m.setDefaultLevel("info"),a.debug&&m.setLevel("debug");const i=P.create();yield i.prepare();const t=yield $(a,e);i.build(e,t)})))),a.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pake-cli",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "用 Rust 来打包你的 App,底层使用 Tauri,当前支持微信读书、Flomo、Vercel",
5
5
  "bin": {
6
6
  "pake": "./cli.js"
@@ -13,6 +13,12 @@
13
13
  "name": "Tw93",
14
14
  "email": "tw93@qq.com"
15
15
  },
16
+ "files": [
17
+ "dist",
18
+ "src-tauri",
19
+ "cli.js",
20
+ "pake-default.icns"
21
+ ],
16
22
  "scripts": {
17
23
  "start": "npm run dev",
18
24
  "dev": "npm run tauri dev",
@@ -22,7 +28,7 @@
22
28
  "build:linux": "npm run tauri build --release",
23
29
  "tauri": "tauri",
24
30
  "cli": "rollup -c rollup.config.js --watch",
25
- "cli:build": "rollup -c rollup.config.js",
31
+ "cli:build": "cross-env NODE_ENV=production rollup -c rollup.config.js",
26
32
  "cli:publish": "npm run cli:build && npm publish"
27
33
  },
28
34
  "type": "module",
@@ -45,6 +51,7 @@
45
51
  "@rollup/plugin-alias": "^4.0.2",
46
52
  "@rollup/plugin-commonjs": "^23.0.2",
47
53
  "@rollup/plugin-json": "^5.0.1",
54
+ "@rollup/plugin-terser": "^0.1.0",
48
55
  "@rollup/plugin-typescript": "^9.0.2",
49
56
  "@types/is-url": "^1.2.30",
50
57
  "@types/page-icon": "^0.3.4",
@@ -53,9 +60,8 @@
53
60
  "@types/tmp": "^0.2.3",
54
61
  "app-root-path": "^3.1.0",
55
62
  "concurrently": "^7.5.0",
63
+ "cross-env": "^7.0.3",
56
64
  "rollup": "^3.3.0",
57
- "rollup-plugin-typescript2": "^0.34.1",
58
- "tsc-alias": "^1.7.1",
59
65
  "tslib": "^2.4.1",
60
66
  "typescript": "^4.8.4"
61
67
  }
package/.ecrc.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "Exclude": ["Cargo\\.lock$", "dist"]
3
- }
package/.editorconfig DELETED
@@ -1,24 +0,0 @@
1
- # http://editorconfig.org
2
- root = true
3
-
4
- [*]
5
- indent_style = space
6
- indent_size = 2
7
- end_of_line = lf
8
- charset = utf-8
9
- trim_trailing_whitespace = true
10
- insert_final_newline = true
11
-
12
- # Use 4 spaces for Python, Rust and Bash files
13
- [*.{py,rs,sh,md}]
14
- indent_size = 4
15
-
16
- # Makefiles always use tabs for indentation
17
- [Makefile]
18
- indent_style = tab
19
-
20
- [*.bat]
21
- indent_size = 2
22
-
23
- [*.md]
24
- trim_trailing_whitespace = false
@@ -1,2 +0,0 @@
1
- github: ["tw93"]
2
- custom: ["https://miaoyan.app/cats.html?name=Pake"]
@@ -1,13 +0,0 @@
1
- ---
2
- name: Bug
3
- about: 讨论建议咨询请去讨论区 / Please go to discussion for suggestions.
4
- title: ""
5
- labels: ""
6
- assignees: ""
7
- ---
8
-
9
- <!--
10
- 🙊 辛苦提 bug 前,去找一下 [历史](https://github.com/tw93/Pake/issues?q=) 是否有提。辛苦提供系统版本、录屏或者截图、复现路径,期待解决的点——这几个说明能帮助我更好的解决问题,此外假如是讨论,建议辛苦去 [Discussions](https://github.com/tw93/Pake/discussions) 看看。
11
-
12
- 🙊 Check out [Issues](https://github.com/tw93/Pake/issues?q=) before reporting. Please provide your system version, screencasts, screenshots, way to reproduce, and the expected result – helpful for me to understand and fix up this issue! Besides, for suggestions or something else, head to [Pake's Discussions Platform](https://github.com/tw93/Pake/discussions).
13
- -->
@@ -1,23 +0,0 @@
1
- name: Check if the codebase matches the EditorConfig rules
2
-
3
- on:
4
- push:
5
- pull_request:
6
- workflow_dispatch:
7
-
8
- permissions:
9
- actions: write
10
- contents: read
11
-
12
- concurrency:
13
- group: ${{ github.workflow }}-${{ github.ref }}
14
- cancel-in-progress: true
15
-
16
- jobs:
17
- editorconfig-check:
18
- name: Run EditorConfig Check
19
- runs-on: ubuntu-latest
20
- steps:
21
- - uses: actions/checkout@v3
22
- - uses: editorconfig-checker/action-editorconfig-checker@main
23
- - run: editorconfig-checker -config .ecrc.json
@@ -1,17 +0,0 @@
1
- on:
2
- push:
3
- branches:
4
- - master
5
-
6
- jobs:
7
- contrib-readme-job:
8
- runs-on: ubuntu-latest
9
- name: A job to automate contrib in readme
10
- steps:
11
- - name: Contribute List
12
- uses: akhilmhdh/contributors-readme-action@v2.3.6
13
- with:
14
- image_size: 90
15
- columns_per_row: 7
16
- env:
17
- GITHUB_TOKEN: ${{ secrets.TOKEN }}
@@ -1,89 +0,0 @@
1
- name: Check, test and format the Rust part of codebase
2
-
3
- on:
4
- push:
5
- pull_request:
6
- workflow_dispatch:
7
-
8
- permissions:
9
- actions: write
10
- contents: read
11
-
12
- concurrency:
13
- group: ${{ github.workflow }}-${{ github.ref }}
14
- cancel-in-progress: true
15
-
16
- defaults:
17
- run:
18
- shell: bash
19
- working-directory: src-tauri
20
-
21
- jobs:
22
- cargo-test:
23
- name: Test codebase on ${{ matrix.os }} (cargo test)
24
- runs-on: ${{ matrix.os }}
25
- strategy:
26
- matrix:
27
- os:
28
- - windows-latest
29
- - ubuntu-latest
30
- - macos-latest
31
- fail-fast: false
32
- steps:
33
- - uses: actions/checkout@v3
34
- - uses: actions-rust-lang/setup-rust-toolchain@v1
35
- - uses: rui314/setup-mold@v1
36
- - uses: taiki-e/install-action@v1
37
- with:
38
- tool: cargo-hack,nextest
39
- - name: Install dependencies for Ubuntu
40
- if: matrix.os == 'ubuntu-latest'
41
- uses: awalsh128/cache-apt-pkgs-action@latest
42
- with:
43
- packages: >
44
- libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev
45
- libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
46
- version: 1.0
47
- - name: Run unit & integration tests with nextest
48
- run: cargo hack --feature-powerset nextest run
49
- # - name: Run documentation tests with cargo test
50
- # run: cargo hack --feature-powerset test --doc
51
-
52
- cargo-clippy:
53
- name: Check codebase quality (cargo clippy)
54
- runs-on: ${{ matrix.os }}
55
- strategy:
56
- matrix:
57
- os:
58
- - windows-latest
59
- - ubuntu-latest
60
- - macos-latest
61
- fail-fast: false
62
- steps:
63
- - uses: actions/checkout@v3
64
- - uses: actions-rust-lang/setup-rust-toolchain@v1
65
- with:
66
- components: clippy
67
- - uses: taiki-e/install-action@cargo-hack
68
- - name: Install dependencies for Ubuntu
69
- if: matrix.os == 'ubuntu-latest'
70
- uses: awalsh128/cache-apt-pkgs-action@latest
71
- with:
72
- packages: >
73
- libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev
74
- libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
75
- version: 1.0
76
- - name: Run all-features code quality checks
77
- run: cargo hack --feature-powerset --no-dev-deps clippy
78
- - name: Run normal code quality check
79
- run: cargo clippy
80
-
81
- cargo-fmt:
82
- name: Enforce codebase style (cargo fmt)
83
- runs-on: ubuntu-latest
84
- steps:
85
- - uses: actions/checkout@v3
86
- - uses: actions-rust-lang/setup-rust-toolchain@v1
87
- with:
88
- components: rustfmt
89
- - run: cargo fmt --all -- --color=always --check
package/.prettierignore DELETED
@@ -1,4 +0,0 @@
1
- target
2
- node_modules
3
- dist/**/*
4
- !dist/twitter.css
@@ -1,4 +0,0 @@
1
- {
2
- "cSpell.words": ["loglevel", "Pake", "tauri"],
3
- "typescript.preferences.importModuleSpecifierEnding": "js"
4
- }
@@ -1,128 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our
6
- community a harassment-free experience for everyone, regardless of age, body
7
- size, visible or invisible disability, ethnicity, sex characteristics, gender
8
- identity and expression, level of experience, education, socio-economic status,
9
- nationality, personal appearance, race, religion, or sexual identity
10
- and orientation.
11
-
12
- We pledge to act and interact in ways that contribute to an open, welcoming,
13
- diverse, inclusive, and healthy community.
14
-
15
- ## Our Standards
16
-
17
- Examples of behavior that contributes to a positive environment for our
18
- community include:
19
-
20
- - Demonstrating empathy and kindness toward other people
21
- - Being respectful of differing opinions, viewpoints, and experiences
22
- - Giving and gracefully accepting constructive feedback
23
- - Accepting responsibility and apologizing to those affected by our mistakes,
24
- and learning from the experience
25
- - Focusing on what is best not just for us as individuals, but for the
26
- overall community
27
-
28
- Examples of unacceptable behavior include:
29
-
30
- - The use of sexualized language or imagery, and sexual attention or
31
- advances of any kind
32
- - Trolling, insulting or derogatory comments, and personal or political attacks
33
- - Public or private harassment
34
- - Publishing others' private information, such as a physical or email
35
- address, without their explicit permission
36
- - Other conduct which could reasonably be considered inappropriate in a
37
- professional setting
38
-
39
- ## Enforcement Responsibilities
40
-
41
- Community leaders are responsible for clarifying and enforcing our standards of
42
- acceptable behavior and will take appropriate and fair corrective action in
43
- response to any behavior that they deem inappropriate, threatening, offensive,
44
- or harmful.
45
-
46
- Community leaders have the right and responsibility to remove, edit, or reject
47
- comments, commits, code, wiki edits, issues, and other contributions that are
48
- not aligned to this Code of Conduct, and will communicate reasons for moderation
49
- decisions when appropriate.
50
-
51
- ## Scope
52
-
53
- This Code of Conduct applies within all community spaces, and also applies when
54
- an individual is officially representing the community in public spaces.
55
- Examples of representing our community include using an official e-mail address,
56
- posting via an official social media account, or acting as an appointed
57
- representative at an online or offline event.
58
-
59
- ## Enforcement
60
-
61
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
- reported to the community leaders responsible for enforcement at
63
- tw93@qq.com.
64
- All complaints will be reviewed and investigated promptly and fairly.
65
-
66
- All community leaders are obligated to respect the privacy and security of the
67
- reporter of any incident.
68
-
69
- ## Enforcement Guidelines
70
-
71
- Community leaders will follow these Community Impact Guidelines in determining
72
- the consequences for any action they deem in violation of this Code of Conduct:
73
-
74
- ### 1. Correction
75
-
76
- **Community Impact**: Use of inappropriate language or other behavior deemed
77
- unprofessional or unwelcome in the community.
78
-
79
- **Consequence**: A private, written warning from community leaders, providing
80
- clarity around the nature of the violation and an explanation of why the
81
- behavior was inappropriate. A public apology may be requested.
82
-
83
- ### 2. Warning
84
-
85
- **Community Impact**: A violation through a single incident or series
86
- of actions.
87
-
88
- **Consequence**: A warning with consequences for continued behavior. No
89
- interaction with the people involved, including unsolicited interaction with
90
- those enforcing the Code of Conduct, for a specified period of time. This
91
- includes avoiding interactions in community spaces as well as external channels
92
- like social media. Violating these terms may lead to a temporary or
93
- permanent ban.
94
-
95
- ### 3. Temporary Ban
96
-
97
- **Community Impact**: A serious violation of community standards, including
98
- sustained inappropriate behavior.
99
-
100
- **Consequence**: A temporary ban from any sort of interaction or public
101
- communication with the community for a specified period of time. No public or
102
- private interaction with the people involved, including unsolicited interaction
103
- with those enforcing the Code of Conduct, is allowed during this period.
104
- Violating these terms may lead to a permanent ban.
105
-
106
- ### 4. Permanent Ban
107
-
108
- **Community Impact**: Demonstrating a pattern of violation of community
109
- standards, including sustained inappropriate behavior, harassment of an
110
- individual, or aggression toward or disparagement of classes of individuals.
111
-
112
- **Consequence**: A permanent ban from any sort of public interaction within
113
- the community.
114
-
115
- ## Attribution
116
-
117
- This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
- version 2.0, available at
119
- https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120
-
121
- Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
- enforcement ladder](https://github.com/mozilla/diversity).
123
-
124
- [homepage]: https://www.contributor-covenant.org
125
-
126
- For answers to common questions about this code of conduct, see the FAQ at
127
- https://www.contributor-covenant.org/faq. Translations are available at
128
- https://www.contributor-covenant.org/translations.
package/CONTRIBUTING.md DELETED
@@ -1,26 +0,0 @@
1
- ## How to contribute to Pake
2
-
3
- **Welcome to create [pull requests](https://github.com/tw93/Pake/compare/) for bugfix, new component, doc, example, suggestion and anything.**
4
-
5
- ## Branch Management
6
-
7
- ```mermaid
8
- graph LR
9
- b_dev(dev) --> b_master(master);
10
- contributions([Develop / Pull requests]) -.-> b_dev;
11
- ```
12
-
13
- - `dev` branch
14
- - `dev` is the developing branch.
15
- - It's **RECOMMENDED** to commit feature PR to `dev`.
16
- - `master` branch
17
- - `master` is the release branch, we will make tag and publish version on this branch.
18
- - If it is a document modification, it can be submitted to this branch.
19
-
20
- ## Commit Log
21
-
22
- please use <https://github.com/tw93/cz-emoji-chinese>
23
-
24
- ## More
25
-
26
- It is a good habit to create a feature request issue to discuss whether the feature is necessary before you implement it. However, it's unnecessary to create an issue to claim that you found a typo or improved the readability of documentation, just create a pull request.
package/README_EN.md DELETED
@@ -1,148 +0,0 @@
1
- <p align="left"><a href="https://github.com/tw93/Pake">中文</a> | <strong>English</strong></p>
2
- <p align="center">
3
- <img src=https://gw.alipayobjects.com/zos/k/fa/logo-modified.png width=138/>
4
- <h1 align="center">Pake</h1>
5
- <div align="center">
6
- <a href="https://twitter.com/HiTw93" target="_blank">
7
- <img alt="twitter" src="https://img.shields.io/twitter/follow/Hitw93?color=%231D9BF0&label=Pake%20%F0%9F%93%A2%20&logo=Twitter&style=flat-square"></a>
8
- <a href="https://t.me/miaoyan" target="_blank">
9
- <img alt="telegram" src="https://img.shields.io/badge/chat-telegram-blueviolet?style=flat-square&logo=Telegram"></a>
10
- <a href="https://github.com/tw93/Pake/releases" target="_blank">
11
- <img alt="GitHub downloads" src="https://img.shields.io/github/downloads/tw93/Pake/total.svg?style=flat-square"></a>
12
- <a href="https://github.com/tw93/Pake/commits" target="_blank">
13
- <img alt="GitHub commit" src="https://img.shields.io/github/commit-activity/m/tw93/Pake?style=flat-square"></a>
14
- <a href="https://github.com/tw93/Pake/issues?q=is%3Aissue+is%3Aclosed" target="_blank">
15
- <img alt="GitHub closed issues" src="https://img.shields.io/github/issues-closed/tw93/Pake.svg?style=flat-square"></a>
16
- </div>
17
- <div align="left">A simple way to package a web page to desktop application, supporting Mac/Windows/Linux, now has packaging WeRead、Twitter、Youtube、Reference、Flomo、YuQue、Google Translate、Witeboard、RunCode、Vercel、V2EX、DevTools, welcome to <a href=https://github.com/tw93/Pake/discussions>Discussions</a> to see if there have anything you interesting.</div>
18
- </p>
19
-
20
- ## Features
21
-
22
- 🏂 **Small**:Nearly 40 times smaller than Electron package, less than 3M.
23
- 😂 **Fast**:Using the Rust Tauri, the performance experience is much lighter and faster than JS, memory is much smaller.
24
- 🩴 **Special**:Not just packaged, with shortcut pass-through, immersive windows, minimalist customization of products.
25
- 🐶 **Toy**:Just a very simple little toy, a way to play with Rust instead of the old idea of shelling the web.
26
-
27
- ## Download
28
-
29
- <table>
30
- <tr>
31
- <td>WeRead <a href="https://github.com/tw93/Pake/releases/latest/download/WeRead.dmg">Download</a></td>
32
- <td>Twitter <a href="https://github.com/tw93/Pake/releases/latest/download/Twitter.dmg">Download</a></td>
33
- </tr>
34
- <tr>
35
- <td><img src=https://cdn.fliggy.com/upic/17dC9I.jpg width=600/></td>
36
- <td><img src=https://cdn.fliggy.com/upic/mc41xq.jpg width=600/></td>
37
- </tr>
38
- <tr>
39
- <td>YouTube <a href="https://github.com/tw93/Pake/releases/latest/download/YouTube.dmg">Download</a></td>
40
- <td>Reference <a href="https://github.com/tw93/Pake/releases/latest/download/Reference.dmg">Download</a></td>
41
- </tr>
42
- <tr>
43
- <td><img src=https://cdn.fliggy.com/upic/Ea5ZRw.png width=600/></td>
44
- <td><img src=https://cdn.fliggy.com/upic/KFsZIY.png width=600/></td>
45
- </tr>
46
- <tr>
47
- <td>RunCode <a href="https://github.com/tw93/Pake/releases/latest/download/RunCode.dmg">Download</a></td>
48
- <td>Google Translate <a href="https://github.com/tw93/Pake/releases/latest/download/GoogleTranslate.dmg">Download</a></td>
49
- </tr>
50
- <tr>
51
- <td><img src=https://cdn.fliggy.com/upic/EB1OYP.jpg width=600/></td>
52
- <td><img src=https://cdn.fliggy.com/upic/EmjUGy.png width=600/></td>
53
- </tr>
54
- <tr>
55
- <td>Flomo <a href="https://github.com/tw93/Pake/releases/latest/download/Flomo.dmg">Download</a></td>
56
- <td>YuQue <a href="https://github.com/tw93/Pake/releases/latest/download/YuQue.dmg">Download</a></td>
57
- </tr>
58
- <tr>
59
- <td><img src=https://cdn.fliggy.com/upic/jg9Eeu.jpg width=600/></td>
60
- <td><img src=https://cdn.fliggy.com/upic/02SZQl.png width=600/></td>
61
- </tr>
62
- </table>
63
-
64
- More common apps can be downloaded from [Releases](https://github.com/tw93/Pake/releases).
65
-
66
- ## Shortcuts
67
-
68
- | Mac | Windows/Linux | Function |
69
- | --------------------------- | ------------------------------ | ----------------------------- |
70
- | <kbd>⌘</kbd> + <kbd>[</kbd> | <kbd>Ctrl</kbd> + <kbd>←</kbd> | Return to the previous page |
71
- | <kbd>⌘</kbd> + <kbd>]</kbd> | <kbd>Ctrl</kbd> + <kbd>→</kbd> | Go to the next page |
72
- | <kbd>⌘</kbd> + <kbd>↑</kbd> | <kbd>Ctrl</kbd> + <kbd>↑</kbd> | Auto scroll to top of page |
73
- | <kbd>⌘</kbd> + <kbd>↓</kbd> | <kbd>Ctrl</kbd> + <kbd>↓</kbd> | Auto scroll to bottom of page |
74
- | <kbd>⌘</kbd> + <kbd>r</kbd> | <kbd>Ctrl</kbd> + <kbd>r</kbd> | Refresh Page |
75
- | <kbd>⌘</kbd> + <kbd>w</kbd> | <kbd>Ctrl</kbd> + <kbd>w</kbd> | Hide window, not quite |
76
- | <kbd>⌘</kbd> + <kbd>-</kbd> | <kbd>Ctrl</kbd> + <kbd>-</kbd> | Zoom out the page |
77
- | <kbd>⌘</kbd> + <kbd>+</kbd> | <kbd>Ctrl</kbd> + <kbd>+</kbd> | Zoom in the page |
78
- | <kbd>⌘</kbd> + <kbd>=</kbd> | <kbd>Ctrl</kbd> + <kbd>=</kbd> | Zoom in the Page |
79
- | <kbd>⌘</kbd> + <kbd>0</kbd> | <kbd>Ctrl</kbd> + <kbd>0</kbd> | Reset the page zoom |
80
-
81
- In addition, it supports double clicking the head to switch to full screen, and dragging the head to move the window
82
-
83
- ## Precautions
84
-
85
- - It cannot be installed to C:\Program File under Windows, and it will crash directly. It is recommended to install to other non-administrator directories, such as D:\Program Files (x86) .
86
- - Under Linux, cookies cannot be stored temporarily, that is, the data will be cleared after the application is closed, and the account will be automatically released.
87
-
88
- ## Development
89
-
90
- Refer to the [Tauri documentation](https://tauri.app/v1/guides/getting-started/prerequisites#setting-up-macos) to quickly configure your environment before you start.
91
-
92
- ```sh
93
- // Install Dependencies
94
- npm i
95
-
96
- // Local development
97
- npm run dev
98
-
99
- // Pack Mac application
100
- npm run build
101
-
102
- // Pack Windows application
103
- npm run build:windows
104
-
105
- // Pack Linux application
106
- npm run build:linux
107
-
108
- // One-click packaging of all Linux/Mac projects
109
- chmod +x build.sh && ./build.sh
110
-
111
- // One-click packaging of all Windows projects
112
- .\build.bat
113
- ```
114
-
115
- // Package all your projects in one click
116
- chmod +x build.sh && ./build.sh
117
-
118
- ## New pack
119
-
120
- 1. Modify the `tauri.conf.json` in the `src-tauri` directory to include 4 fields `url, productName, icon, identifier`, icon can be selected from the `icons` directory or downloaded from [macOSicons](https://macosicons.com/#/) to match the product.
121
- 2. For window property settings, you can modify the `width/height` of the `windows` property in `tauri.conf.json`, whether it is `fullscreen`, whether it is `resizable`, If you want to adapt the immersive header under Mac, you can set `transparent` to `true` and then find header element and add the `padding-top` style.
122
- 3. `npm run dev` for local debugging; `npm run dev:debug` to open the devtools for container debugging.
123
- 4. `npm run build` can be run to package for production.
124
-
125
- ## Advanced
126
-
127
- #### 1. How do I rewrite the style, e.g. to remove ads from the original site, or even redesign it?
128
-
129
- First, open devtools debug mode with `npm run dev:debug`. After that, find the name of the style you want to change and verify the effect in devtools, and find the location of the style in `pake.js` with `style.innerHTML`. Finally, add the style you need to override, there are some examples you can copy.
130
-
131
- #### 2. How to inject js code, e.g. to implement event listeners, e.g. keyboard shortcuts?
132
-
133
- Refer to the event listener in `pake.js` with `document.addEventListener`, and write it directly, it's more of a basic front-end technique here.
134
-
135
- #### 3. How to communicate with Pake about events in containers, such as dragging and dropping, scrolling, special clicks on the Web, etc.?
136
-
137
- Refer to the communication code in `pake.js` with `postMessage`, write the event listener and then use `window.ipc.postMessage` to pass the event and its parameters, then refer to the container to receive events `window.drag_window` and handle them yourself, for more information, refer to tauri and wry's official documentation.
138
-
139
- ## Support
140
-
141
- - I have two cats, one is called TangYuan, and one is called Coke, If you think Pake makes your life better, you can give my cats <a href="https://miaoyan.app/cats.html?name=Pake" target="_blank">feed canned food 🥩🍤</a>.
142
- - If you like Pake, you can star it in Github. We are more welcome to [recommend Pake](https://twitter.com/intent/tweet?url=https://github.com/tw93/Pake&text=Pake%20-%20A%20simple%20Rust%20packaged%20web%20pages%20to%20generate%20Mac%20App%20tool,%20compared%20to%20traditional%20Electron%20package,%20the%20size%20of%20nearly%2040%20times%20smaller,%20generally%20about%202M,%20the%20underlying%20use%20of%20Tauri,%20performance%20experience%20than%20the%20JS%20framework%20is%20much%20lighter~) to your like-minded friends.
143
- - You can follow my [Twitter](https://twitter.com/HiTw93) to get the latest news of Pake, or join [Telegram](https://t.me/miaoyan) chat group.
144
-
145
- ## Finally
146
-
147
- 1. I hope that you will enjoy playing with it and let me know if you have any new ideas.
148
- 2. If you find a page that would be great for a Mac App, please let me know and I'll add it to the list.
package/app.csv DELETED
@@ -1,9 +0,0 @@
1
- name(Linux),name(Mac/Windows),name_zh,url
2
- twitter,Twitter,推特,https://twitter.com/
3
- translate,GoogleTranslate,谷歌翻译,https://translate.google.com/
4
- youtube,YouTube,YouTube,https://youtube.com
5
- reference,Reference,Reference,https://wangchujiang.com/reference/index.html
6
- code,Code,Code,https://riju.codes/
7
- yuque,YuQue,语雀,https://www.yuque.com/
8
- flomo,Flomo,浮墨,https://flomoapp.com/mine
9
- weread,WeRead,微信阅读,https://weread.qq.com/