diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..7e3649ac --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +# http://editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false + +[Makefile] +indent_style = tab diff --git a/.eslintrc.json b/.eslintrc.json index b99546e3..730d1bb1 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,12 +1,36 @@ { - "parserOptions": { - "ecmaVersion": 6, - "sourceType": "module", - "ecmaFeatures": { - "jsx": true - } - }, - "rules": { - "semi": 2 + "parser": "babel-eslint", + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module", + "ecmaFeatures": { + "jsx": false } + }, + "rules": { + "semi": 2 + }, + "extends": ["eslint:recommended", "plugin:prettier/recommended"], + "ignorePatterns": ["static/", "vendor/", "dist/", "node_modules/", "test/"], + "env": { + "es6": true, + "browser": true, + "node": true + }, + "globals": { + "angular": "readonly", + "moment": "readonly", + "CodeMirror": "readonly", + "Global": "readonly", + "openExternal": "readonly", + "$": "writable", + "Clipboard": "readonly", + "fs": "readonly", + "path": "readonly", + "os": "readonly", + "request": "readonly", + "custom": "writable", + "OSS": "readonly", + "ALY": "readonly" + } } diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..444e8b96 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/.gitignore b/.gitignore index f064fddf..c1d5c9c7 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,13 @@ build .DS_Store releases _up.sh +_up0.sh +ossutil* +*-app.asar +.ossutil_checkpoint +ossutil_output +app.asar + + +#tool +.vscode/ diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..1fa63681 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,5 @@ +static/ +vendor/ +dist/ +node_modules/ +.github/ diff --git a/Makefile b/Makefile index 51b39ff9..ba8b7b55 100644 --- a/Makefile +++ b/Makefile @@ -1,54 +1,77 @@ -ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/ -ELECTRON_VERSION=1.7.5 -BUILD=ELECTRON_MIRROR=$(ELECTRON_MIRROR) electron-packager ./dist --asar --overwrite --out=build --version $(ELECTRON_VERSION) -VERSION=1.2.5 + +VERSION=1.11.0 NAME=oss-browser +CUSTOM=./custom + +GULP=node ./node_modules/gulp/bin/gulp.js +PKGER=node node_modules/electron-packager/cli.js +ZIP=node ../zip.js + +ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/ +ELECTRON_VERSION=1.8.4 +BUILD=ELECTRON_MIRROR=$(ELECTRON_MIRROR) $(PKGER) ./dist $(NAME) --asar --overwrite --out=build --version $(ELECTRON_VERSION) --app-version $(VERSION) +ELECTON=./node_modules/.bin/electron i: cnpm i clean: - npm run clean - find . -name .DS_Store | xargs rm -rf - + rm -rf dist node_modules build releases node/crc64/cpp-addon/node_modules node/crc64/electron-crc64-prebuild/node_modules node/ossstore/node_modules dev: - NODE_ENV=development electron . + NODE_ENV=development ${ELECTON} . --inspect=5858 +debug: + NODE_ENV=development ${ELECTON} . --inspect-brk=5858 run: - npm run dev + custom=$(CUSTOM) npm run dev prod: npm run prod watch: - npm run watch + $(GULP) watch --custom=$(CUSTOM) build: - npm run build + $(GULP) build --custom=$(CUSTOM) + node gen.js win64: - $(BUILD) --platform=win32 --arch=x64 + $(BUILD) --platform=win32 --arch=x64 --icon=$(CUSTOM)/icon.ico + cp -rf $(CUSTOM) build/$(NAME)-win32-x64/resources rm -rf releases/$(VERSION)/$(NAME)-win32-x64.zip && mkdir -p releases/$(VERSION) - cd build && zip ../releases/$(VERSION)/$(NAME)-win32-x64.zip -r $(NAME)-win32-x64 + cd build && $(ZIP) ../releases/$(VERSION)/$(NAME)-win32-x64.zip $(NAME)-win32-x64/ win32: - $(BUILD) --platform=win32 --arch=ia32 + $(BUILD) --platform=win32 --arch=ia32 --icon=$(CUSTOM)/icon.ico + cp -rf $(CUSTOM) build/$(NAME)-win32-ia32/resources rm -rf releases/$(VERSION)/$(NAME)-win32-ia32.zip && mkdir -p releases/$(VERSION) - cd build && zip ../releases/$(VERSION)/$(NAME)-win32-ia32.zip -r $(NAME)-win32-ia32 + cd build && $(ZIP) ../releases/$(VERSION)/$(NAME)-win32-ia32.zip $(NAME)-win32-ia32/ linux64: $(BUILD) --platform=linux --arch=x64 + cp -rf $(CUSTOM) build/$(NAME)-linux-x64/resources rm -rf releases/$(VERSION)/$(NAME)-linux-x64.zip && mkdir -p releases/$(VERSION) - cd build && zip ../releases/$(VERSION)/$(NAME)-linux-x64.zip -r $(NAME)-linux-x64 -mac_build: - $(BUILD) --platform=darwin --arch=x64 --icon=./app/icons/icon.icns + cd build && $(ZIP) ../releases/$(VERSION)/$(NAME)-linux-x64.zip $(NAME)-linux-x64/ +linux32: + $(BUILD) --platform=linux --arch=ia32 + cp -rf $(CUSTOM) build/$(NAME)-linux-ia32/resources + rm -rf releases/$(VERSION)/$(NAME)-linux-ia32.zip && mkdir -p releases/$(VERSION) + cd build && $(ZIP) ../releases/$(VERSION)/$(NAME)-linux-ia32.zip $(NAME)-linux-ia32/ +mac: + $(BUILD) --platform=darwin --arch=x64 --icon=$(CUSTOM)/icon.icns + cp -rf $(CUSTOM) build/$(NAME)-darwin-x64/$(NAME).app/Contents/Resources rm -rf releases/$(VERSION)/$(NAME)-darwin-x64.zip && mkdir -p releases/$(VERSION) - #cd build && zip ../releases/$(VERSION)/$(NAME)-darwin-x64.zip -r $(NAME)-darwin-x64 -mac:mac_build - rm build/$(NAME)-darwin-x64/LICENSE* build/$(NAME)-darwin-x64/version - ln -s /Applications/ build/$(NAME)-darwin-x64/Applications + cd build && $(ZIP) ../releases/$(VERSION)/$(NAME)-darwin-x64.zip $(NAME)-darwin-x64/ +dmg: + rm build/$(NAME)-darwin-x64/LICENSE* build/$(NAME)-darwin-x64/version || continue + ln -s /Applications/ build/$(NAME)-darwin-x64/Applications || continue #cp dist/icons/icon.icns build/$(NAME)-darwin-x64/.VolumeIcon.icns #mkdir -p build/$(NAME)-darwin-x64/.background #cp dist/icons/background.tiff build/$(NAME)-darwin-x64/.background - rm -f releases/$(VERSION)/$(NAME).dmg - hdiutil create -size 250M -format UDZO -srcfolder build/$(NAME)-darwin-x64 releases/$(VERSION)/$(NAME).dmg - -all:win32 win64 linux64 mac - + rm -f releases/$(VERSION)/$(NAME).dmg || continue + hdiutil create -size 250M -format UDZO -srcfolder build/$(NAME)-darwin-x64 -o releases/$(VERSION)/$(NAME).dmg +all:win32 win64 linux32 linux64 mac asar + @echo 'Done' +asar: + mkdir -p releases/$(VERSION)/darwin-x64 && cp build/$(NAME)-darwin-x64/$(NAME).app/Contents/Resources/app.asar releases/$(VERSION)/darwin-x64 + mkdir -p releases/$(VERSION)/win32-x64 && cp build/$(NAME)-win32-x64/resources/app.asar releases/$(VERSION)/win32-x64 + mkdir -p releases/$(VERSION)/win32-ia32 && cp build/$(NAME)-win32-ia32/resources/app.asar releases/$(VERSION)/win32-ia32 + mkdir -p releases/$(VERSION)/linux-x64 && cp build/$(NAME)-linux-x64/resources/app.asar releases/$(VERSION)/linux-x64 + mkdir -p releases/$(VERSION)/linux-ia32 && cp build/$(NAME)-linux-ia32/resources/app.asar releases/$(VERSION)/linux-ia32 .PHONY:build diff --git a/README-CN.md b/README-CN.md new file mode 100644 index 00000000..4bb3d40f --- /dev/null +++ b/README-CN.md @@ -0,0 +1,187 @@ +# OSS Browser + +OSS Browser 鎻愪緵绫讳技 windows 璧勬簮绠$悊鍣ㄥ姛鑳姐傜敤鎴峰彲浠ュ緢鏂逛究鐨勬祻瑙堟枃浠讹紝涓婁紶涓嬭浇鏂囦欢锛屾敮鎸佹柇鐐圭画浼犵瓑銆 + +鏈伐鍏蜂娇鐢ㄥ紑婧愭鏋 Angular 1.x + [Electron](http://electron.atom.io/)鍒朵綔銆 + +> Electron 妗嗘灦鍙互璁╀綘浣跨敤 JavaScript锛孒TML 鍜 CSS 鏋勫缓璺ㄥ钩鍙扮殑妗岄潰搴旂敤绋嬪簭銆傚畠鏄熀浜 node.js 鍜 Chromium 寮婧愰」鐩侲lectron 鍙互鎵撳寘鍑鸿法骞冲彴鐨勭▼搴忥紝杩愯鍦 Mac锛學indows 鍜 Linux 涓娿 + +## 1. 鏀寔骞冲彴 + +Windows7 above, Linux and Mac,涓嶅缓璁娇鐢 windows XP 骞冲彴鍜 windows Server 骞冲彴 + +## 2. 瀹㈡埛绔笅杞斤細 + +鏈鏂扮増鏈琡1.9.5`锛屼笅杞藉湴鍧濡備笅锛岃В鍘嬪嵆鍙娇鐢ㄣ + +> [
+2. Group number:21985509
+
+## Links
+
+[ossbrowser](https://www.alibabacloud.com/help/doc-detail/61872.htm)
+
+## LICENSE
+
+[Apache License 2.0](LICENSE)
diff --git a/Readme.md b/Readme.md
deleted file mode 100644
index 8827e187..00000000
--- a/Readme.md
+++ /dev/null
@@ -1,164 +0,0 @@
-
-# OSS Browser
-
-OSS Browser 鎻愪緵绫讳技windows璧勬簮绠$悊鍣ㄥ姛鑳姐傜敤鎴峰彲浠ュ緢鏂逛究鐨勬祻瑙堟枃浠讹紝涓婁紶涓嬭浇鏂囦欢锛屾敮鎸佹柇鐐圭画浼犵瓑銆
-
-鏈伐鍏蜂娇鐢ㄥ紑婧愭鏋 Angular 1.x + [Electron](http://electron.atom.io/)鍒朵綔銆
-
-> Electron 妗嗘灦鍙互璁╀綘浣跨敤 JavaScript锛孒TML 鍜 CSS 鏋勫缓璺ㄥ钩鍙扮殑妗岄潰搴旂敤绋嬪簭銆傚畠鏄熀浜巒ode.js 鍜 Chromium 寮婧愰」鐩侲lectron 鍙互鎵撳寘鍑鸿法骞冲彴鐨勭▼搴忥紝杩愯鍦 Mac锛學indows 鍜 Linux 涓娿
-
-
-## 1. 瀹㈡埛绔笅杞斤細
-
-鏈鏂扮増鏈琡1.2.5`锛屼笅杞藉湴鍧濡備笅锛岃В鍘嬪嵆鍙娇鐢ㄣ
-
-> [