From 569e59ddc9cd1ee6e523722fa8c3d69788f2b7d9 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 17 Apr 2016 02:51:53 -0700 Subject: [PATCH] Move pushing to Github / AWS / Chrome store to make, now all as one goal. --- .gitignore | 1 + Gruntfile.coffee | 2 +- Makefile | 86 +++++++++---- index.html | 124 ++++++++++++++++++ npm-shrinkwrap.json | 303 ++++++++++++++++++++++++++++++++++++++++++++ package.json | 3 +- tools/webstore.js | 31 +++++ 7 files changed, 522 insertions(+), 28 deletions(-) create mode 100644 index.html create mode 100644 tools/webstore.js diff --git a/.gitignore b/.gitignore index 7f9be6fa2..656f55b44 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ node_modules/ /install.json /.tests_enabled /.events +/.events2 /dist/ diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 3894126c4..b42b41be7 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -26,7 +26,7 @@ module.exports = (grunt) -> command: 'make <%= MAKEFLAGS %>' full: command: """ - make cleanall + make cleanrel make <%= MAKEFLAGS %> all """.split('\n').join('&&') clean: diff --git a/Makefile b/Makefile index 73bc080c4..fe9d0a1e5 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ else ESC_DOLLAR = \$$ endif -npgoals := clean cleanall $(foreach i,1 2 3 4,bump$(i)) beta stable web +npgoals := clean cleanrel cleanweb cleanfull tag $(foreach i,1 2 3 4,bump$(i)) beta stable web ifneq "$(filter $(npgoals),$(MAKECMDGOALS))" "" .NOTPARALLEL : endif @@ -30,6 +30,7 @@ pkg = $(shell node -p "JSON.parse(require('fs').readFileSync('package.json')).$1 name := $(call pkg,name) nameHuman := $(call pkg,meta.name) distBranch := $(call pkg,meta.distBranch) +awsBucket := $(call pkg,meta.awsBucket) version := $(shell node -p "JSON.parse(require('fs').readFileSync('version.json')).version") capitalized = $(filter-out a,$(foreach x,$1,$(subst a $(x),,$(sort a $(x))))) @@ -93,9 +94,9 @@ jshint := $(foreach f,$(subst platform,platform_crx platform_userscript,$(parts) default : script jshint install -all : release jshint install +all : default release -.events tmp testbuilds builds : +.events .events2 tmp testbuilds builds : $(MKDIR) .events/npm : npm-shrinkwrap.json | .events @@ -201,6 +202,9 @@ builds/% : testbuilds/% | builds test.html : README.md template.jst tools/markdown.js node_modules/marked/package.json node_modules/lodash/package.json node tools/markdown.js +index.html : test.html + $(CP) + tmp/.jshintrc : src/meta/jshint.json tmp/declaration.js tmp/globals.js $(template_deps) | tmp $(template) $< $@ @@ -222,9 +226,36 @@ install.json : dist : git worktree add $@ $(distBranch) +$(wildcard dist/* dist/*/*) : dist + + +.events/dist : dist $(wildcard dist/* dist/*/*) + cd dist && git checkout $(distBranch) + cd dist && git pull + echo -> $@ + +.events2/push-git : .events/dist .git/refs/heads .git/refs/tags $(wildcard .git/refs/heads/* .git/refs/tags/*) | .events2 + git push origin --tags -f + git push origin --all + echo -> $@ + +.events2/push-web : .events/dist .git/refs/heads/$(distBranch) | .events2 + aws s3 cp builds/ s3://$(awsBucket)/builds/ --recursive --exclude "*" --include "*.js" --cache-control "max-age=600" --content-type "application/javascript; charset=utf-8" + aws s3 cp builds/ s3://$(awsBucket)/builds/ --recursive --exclude "*" --include "*.crx" --cache-control "max-age=600" --content-type "application/x-chrome-extension" + aws s3 cp builds/ s3://$(awsBucket)/builds/ --recursive --exclude "*" --include "*.xml" --cache-control "max-age=600" --content-type "text/xml; charset=utf-8" + aws s3 cp builds/ s3://$(awsBucket)/builds/ --recursive --exclude "*" --include "*.zip" --cache-control "max-age=600" --content-type "application/zip" + aws s3 cp img/ s3://$(awsBucket)/img/ --recursive --cache-control "max-age=600" + aws s3 cp index.html s3://$(awsBucket) --cache-control "max-age=600" --content-type "text/html; charset=utf-8" + aws s3 cp web.css s3://$(awsBucket) --cache-control "max-age=600" --content-type "text/css; charset=utf-8" + echo -> $@ + +.events2/push-store : .events/dist .git/refs/tags/stable | .events2 + node tools/webstore.js + echo -> $@ + .SECONDARY : -.PHONY: default all script crx release jshint install tag distready $(npgoals) +.PHONY: default all script crx release jshint install push $(npgoals) script : $(script) @@ -236,43 +267,46 @@ jshint : $(jshint) install : .events/install -tag : .events/CHANGELOG $(jshint) $(release) +push : .events2/push-git .events2/push-web .events2/push-store + +clean : + $(RMDIR) tmp testbuilds .events + $(RM) .tests_enabled + +cleanrel : clean + $(RMDIR) builds + +cleanweb : + $(RM) test.html captchas.html + +cleanfull : clean cleanweb + $(RMDIR) .events2 dist node_modules + git worktree prune + +tag : .events/CHANGELOG jshint release git commit -am "Release $(name) v$(version)." git tag -a $(version) -m "$(name) v$(version)." -distready : | dist - cd dist && git checkout $(distBranch) - cd dist && git pull - -dist/index.html : test.html distready - $(CP) - -clean : - $(RMDIR) tmp testbuilds .events dist - $(RM) .tests_enabled - git worktree prune - -cleanall : clean - $(RMDIR) builds - -$(foreach i,1 2 3 4,bump$(i)) : cleanall +$(foreach i,1 2 3 4,bump$(i)) : cleanrel node tools/bump.js $(subst bump,,$@) - $(MAKE) tag install + $(MAKE) all + $(MAKE) tag -beta : distready +beta : .events/dist git tag -af beta -m "$(nameHuman) v$(version)." cd dist && git merge --no-commit -s ours beta cd dist && git checkout beta "builds/*-beta.*" LICENSE CHANGELOG.md img .gitignore .gitattributes cd dist && git commit -am "Move $(nameHuman) v$(version) to beta channel." -stable : distready +stable : .events/dist git push . HEAD:bstable git tag -af stable -m "$(nameHuman) v$(version)." cd dist && git merge --no-commit -s ours stable cd dist && git checkout stable "builds/$(name).*" builds/updates.xml cd dist && git commit -am "Move $(nameHuman) v$(version) to stable channel." -web : dist/index.html +web : index.html .events/dist + -git commit -am "Build web page." cd dist && git merge --no-commit -s ours master - cd dist && git checkout master README.md web.css img + cd dist && git checkout master README.md index.html web.css img cd dist && git commit -am "Update web page." diff --git a/index.html b/index.html new file mode 100644 index 000000000..ad54996df --- /dev/null +++ b/index.html @@ -0,0 +1,124 @@ + + + +4chan X + + + + + +Screenshot + +

Adds various features to 4chan. +Previously developed by aeosynth, Mayhem, ihavenoface, Zixaphir, Seaweed, and Spittie, with contributions from many others.

+

If you're looking for a maintained fork of OneeChan (a style script used in addition to 4chan X), try +https://github.com/Nebukazar/OneeChan.

+

Please note

+

Uninstalling: 4chan X disables the native extension, so if you uninstall 4chan X, you'll need to re-enable it. To do this, click the [Settings] link in the top right corner and uncheck "Disable the native extension" in the panel that appears.

+

Private browsing: 4chan X does not yet support private browsing / incognito mode. Although it may work in this mode, browsing data recorded by 4chan X, such as your last read post in a thread and which posts are yours, will still need to be cleared manually by resetting your settings. To control what browsing data 4chan X records, use the Remember Last Read Post and Mark Quotes of You options in the settings panel.

+

HTTPS: 4chan X currently shares your settings and post history between the HTTP and HTTPS versions of 4chan. If you are concerned about protecting your privacy against a man-in-the-middle attack, you should disable 4chan X on the HTTP version of 4chan and/or install HTTPS Everywhere.

+

Install

+

+

Install Greasemonkey, then click here to install 4chan X.

+ +

+

Userscript: Install Violentmonkey (Opera store / Chrome store) or Tampermonkey, then click here to install 4chan X.

+

Chrome extension: 4chan X is also available as a standalone Chrome extension. The Chrome extension has the additional feature of being able to sync your settings and data with other devices via Chrome Sync. But there is an issue when the script updates: Whenever the Chrome extension is updated, until you hard refresh (F5) the tab, 4chan X is unable to save any data (such as posts marked as yours and settings changes). The userscript version above does not have this problem when 4chan X updates, only when Violentmonkey / Tampermonkey is updated. To install as a Chrome extension:

+ +

Note: This version of 4chan X does not work with Opera 12. If you need Opera 12 support, try loadletter's fork instead.

+

+

Install JS Blocker, then click here to install 4chan X. Tampermonkey for Safari may also work, but I have yet to test it.

+

+

Several WebKitGTK+ based browsers have support for userscripts and can run 4chan X. Due to the lack of the cross-site GM_* API, and lack of support for userscripts in iframes, not all features will work. You may experience crashes when repeatedly solving the default image-based captchas. You can avoid this problem by enabling Use Recaptcha v1 in your settings.

+ +

+

4chan X can be used in some browsers that do not support userscripts, such as Microsoft Edge, using a local proxy. Not all features will work.

+

Beta version

+

New features and non-urgent bugfixes are released on the beta channel for further testing before they are moved the stable version. Please report any issues you find, and be sure to mention which version you're using. You should back up your settings regularly to prevent them from being lost due to bugs.

+

To install the current beta version but get updates from the stable channel (for example, if just you want a particular recent feature):

+ +

To install the beta version and get updates whenever there's a new beta version:

+ +

Troubleshooting

+

If you encounter a bug, try the steps here, then report it to the issue tracker. You can report bugs without a Github account via this form. If the bug seems to be caused by a script update, you can install a old version from the changelog.

+ + + diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index d0ff71054..df4603109 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -43,16 +43,65 @@ "from": "asn1@0.2.3", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz" }, + "assert-plus": { + "version": "0.2.0", + "from": "assert-plus@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz" + }, "async": { "version": "1.5.2", "from": "async@>=1.5.2 <1.6.0", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz" }, + "aws-sign2": { + "version": "0.6.0", + "from": "aws-sign2@>=0.6.0 <0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz" + }, + "aws4": { + "version": "1.3.2", + "from": "aws4@>=1.2.1 <2.0.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.3.2.tgz", + "dependencies": { + "lru-cache": { + "version": "4.0.1", + "from": "lru-cache@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.1.tgz" + } + } + }, "balanced-match": { "version": "0.3.0", "from": "balanced-match@>=0.3.0 <0.4.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz" }, + "bl": { + "version": "1.1.2", + "from": "bl@>=1.1.2 <1.2.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.1.2.tgz", + "dependencies": { + "isarray": { + "version": "1.0.0", + "from": "isarray@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + }, + "readable-stream": { + "version": "2.0.6", + "from": "readable-stream@>=2.0.5 <2.1.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz" + } + } + }, + "bluebird": { + "version": "2.10.2", + "from": "bluebird@>=2.3.0 <3.0.0", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.10.2.tgz" + }, + "boom": { + "version": "2.10.1", + "from": "boom@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz" + }, "brace-expansion": { "version": "1.1.3", "from": "brace-expansion@>=1.0.0 <2.0.0", @@ -78,6 +127,11 @@ "from": "camelcase-keys@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz" }, + "caseless": { + "version": "0.11.0", + "from": "caseless@>=0.11.0 <0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz" + }, "chalk": { "version": "1.1.3", "from": "chalk@>=1.1.1 <1.2.0", @@ -98,6 +152,11 @@ "from": "colors@>=1.1.2 <1.2.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz" }, + "combined-stream": { + "version": "1.0.5", + "from": "combined-stream@>=1.0.5 <1.1.0", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz" + }, "commander": { "version": "2.9.0", "from": "commander@>=2.5.0 <3.0.0", @@ -128,6 +187,23 @@ "from": "crx@>=3.0.3 <4.0.0", "resolved": "https://registry.npmjs.org/crx/-/crx-3.0.3.tgz" }, + "cryptiles": { + "version": "2.0.5", + "from": "cryptiles@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz" + }, + "dashdash": { + "version": "1.13.0", + "from": "dashdash@>=1.10.1 <2.0.0", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.13.0.tgz", + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "from": "assert-plus@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" + } + } + }, "date-now": { "version": "0.1.4", "from": "date-now@>=0.1.4 <0.2.0", @@ -153,6 +229,11 @@ "from": "deflate-crc32-stream@>=0.1.0 <0.2.0", "resolved": "https://registry.npmjs.org/deflate-crc32-stream/-/deflate-crc32-stream-0.1.2.tgz" }, + "delayed-stream": { + "version": "1.0.0", + "from": "delayed-stream@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" + }, "dom-serializer": { "version": "0.1.0", "from": "dom-serializer@>=0.0.0 <1.0.0", @@ -185,6 +266,11 @@ "from": "domutils@>=1.5.0 <1.6.0", "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz" }, + "ecc-jsbn": { + "version": "0.1.1", + "from": "ecc-jsbn@>=0.0.1 <1.0.0", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz" + }, "entities": { "version": "1.0.0", "from": "entities@>=1.0.0 <1.1.0", @@ -220,6 +306,16 @@ "from": "exit@>=0.1.1 <0.2.0", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz" }, + "extend": { + "version": "3.0.0", + "from": "extend@>=3.0.0 <3.1.0", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz" + }, + "extsprintf": { + "version": "1.0.2", + "from": "extsprintf@1.0.2", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz" + }, "file-utils": { "version": "0.1.5", "from": "file-utils@>=0.1.5 <0.2.0", @@ -254,6 +350,26 @@ "from": "font-awesome@4.5.0", "resolved": "https://registry.npmjs.org/font-awesome/-/font-awesome-4.5.0.tgz" }, + "forever-agent": { + "version": "0.6.1", + "from": "forever-agent@>=0.6.1 <0.7.0", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz" + }, + "form-data": { + "version": "1.0.0-rc4", + "from": "form-data@>=1.0.0-rc3 <1.1.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc4.tgz" + }, + "generate-function": { + "version": "2.0.0", + "from": "generate-function@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz" + }, + "generate-object-property": { + "version": "1.2.0", + "from": "generate-object-property@>=1.1.0 <2.0.0", + "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz" + }, "get-stdin": { "version": "4.0.1", "from": "get-stdin@>=4.0.1 <5.0.0", @@ -388,11 +504,26 @@ } } }, + "har-validator": { + "version": "2.0.6", + "from": "har-validator@>=2.0.6 <2.1.0", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz" + }, "has-ansi": { "version": "2.0.0", "from": "has-ansi@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz" }, + "hawk": { + "version": "3.1.3", + "from": "hawk@>=3.1.3 <3.2.0", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz" + }, + "hoek": { + "version": "2.16.3", + "from": "hoek@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz" + }, "hooker": { "version": "0.2.3", "from": "hooker@>=0.2.3 <0.3.0", @@ -415,6 +546,11 @@ } } }, + "http-signature": { + "version": "1.1.1", + "from": "http-signature@>=1.1.0 <1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz" + }, "iconv-lite": { "version": "0.2.11", "from": "iconv-lite@>=0.2.11 <0.3.0", @@ -455,11 +591,26 @@ "from": "is-finite@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.1.tgz" }, + "is-my-json-valid": { + "version": "2.13.1", + "from": "is-my-json-valid@>=2.12.4 <3.0.0", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.13.1.tgz" + }, + "is-property": { + "version": "1.0.2", + "from": "is-property@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz" + }, "is-relative": { "version": "0.1.3", "from": "is-relative@>=0.1.0 <0.2.0", "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.1.3.tgz" }, + "is-typedarray": { + "version": "1.0.0", + "from": "is-typedarray@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz" + }, "is-utf8": { "version": "0.2.1", "from": "is-utf8@>=0.2.0 <0.3.0", @@ -480,11 +631,26 @@ "from": "isexe@>=1.1.1 <2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-1.1.2.tgz" }, + "isstream": { + "version": "0.1.2", + "from": "isstream@>=0.1.2 <0.2.0", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz" + }, + "jodid25519": { + "version": "1.0.2", + "from": "jodid25519@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz" + }, "js-yaml": { "version": "3.5.5", "from": "js-yaml@>=3.5.2 <3.6.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.5.5.tgz" }, + "jsbn": { + "version": "0.1.0", + "from": "jsbn@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz" + }, "jshint": { "version": "2.9.1", "from": "jshint@>=2.9.1 <3.0.0", @@ -502,6 +668,26 @@ } } }, + "json-schema": { + "version": "0.2.2", + "from": "json-schema@0.2.2", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.2.tgz" + }, + "json-stringify-safe": { + "version": "5.0.1", + "from": "json-stringify-safe@>=5.0.1 <5.1.0", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" + }, + "jsonpointer": { + "version": "2.0.0", + "from": "jsonpointer@2.0.0", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz" + }, + "jsprim": { + "version": "1.2.2", + "from": "jsprim@>=1.2.2 <2.0.0", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.2.2.tgz" + }, "jszip": { "version": "2.6.0", "from": "jszip@>=2.6.0 <3.0.0", @@ -547,6 +733,16 @@ "from": "meow@>=3.3.0 <4.0.0", "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz" }, + "mime-db": { + "version": "1.22.0", + "from": "mime-db@>=1.22.0 <1.23.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.22.0.tgz" + }, + "mime-types": { + "version": "2.1.10", + "from": "mime-types@>=2.1.7 <2.2.0", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.10.tgz" + }, "minimatch": { "version": "0.2.14", "from": "minimatch@>=0.2.12 <0.3.0", @@ -574,6 +770,11 @@ } } }, + "node-uuid": { + "version": "1.4.7", + "from": "node-uuid@>=1.4.7 <1.5.0", + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz" + }, "nopt": { "version": "3.0.6", "from": "nopt@>=3.0.6 <3.1.0", @@ -589,6 +790,11 @@ "from": "number-is-nan@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz" }, + "oauth-sign": { + "version": "0.8.1", + "from": "oauth-sign@>=0.8.1 <0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.1.tgz" + }, "object-assign": { "version": "4.0.1", "from": "object-assign@>=4.0.1 <5.0.0", @@ -649,11 +855,26 @@ "from": "pinkie-promise@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" }, + "process-nextick-args": { + "version": "1.0.6", + "from": "process-nextick-args@>=1.0.6 <1.1.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.6.tgz" + }, + "pseudomap": { + "version": "1.0.2", + "from": "pseudomap@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz" + }, "q": { "version": "1.4.1", "from": "q@>=1.0.1 <2.0.0", "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz" }, + "qs": { + "version": "6.1.0", + "from": "qs@>=6.1.0 <6.2.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.1.0.tgz" + }, "read-pkg": { "version": "1.1.0", "from": "read-pkg@>=1.0.0 <2.0.0", @@ -679,6 +900,16 @@ "from": "repeating@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz" }, + "request": { + "version": "2.71.0", + "from": "request@>=2.69.0 <3.0.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.71.0.tgz" + }, + "request-promise": { + "version": "2.0.1", + "from": "request-promise@>=2.0.1 <3.0.0", + "resolved": "https://registry.npmjs.org/request-promise/-/request-promise-2.0.1.tgz" + }, "resolve": { "version": "1.1.7", "from": "resolve@>=1.1.0 <1.2.0", @@ -709,6 +940,11 @@ "from": "signal-exit@>=2.1.2 <3.0.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-2.1.2.tgz" }, + "sntp": { + "version": "1.0.9", + "from": "sntp@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz" + }, "spdx-correct": { "version": "1.0.2", "from": "spdx-correct@>=1.0.0 <1.1.0", @@ -734,11 +970,21 @@ "from": "sprintf-js@>=1.0.2 <1.1.0", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" }, + "sshpk": { + "version": "1.7.4", + "from": "sshpk@>=1.7.0 <2.0.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.7.4.tgz" + }, "string_decoder": { "version": "0.10.31", "from": "string_decoder@>=0.10.0 <0.11.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" }, + "stringstream": { + "version": "0.0.5", + "from": "stringstream@>=0.0.4 <0.1.0", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz" + }, "strip-ansi": { "version": "3.0.1", "from": "strip-ansi@>=3.0.0 <4.0.0", @@ -769,21 +1015,68 @@ "from": "temp@>=0.8.1 <0.9.0", "resolved": "https://registry.npmjs.org/temp/-/temp-0.8.3.tgz" }, + "tough-cookie": { + "version": "2.2.2", + "from": "tough-cookie@>=2.2.0 <2.3.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.2.tgz" + }, "trim-newlines": { "version": "1.0.0", "from": "trim-newlines@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz" }, + "tunnel-agent": { + "version": "0.4.2", + "from": "tunnel-agent@>=0.4.1 <0.5.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.2.tgz" + }, + "tweetnacl": { + "version": "0.14.3", + "from": "tweetnacl@>=0.13.0 <1.0.0", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.3.tgz" + }, "underscore.string": { "version": "3.2.3", "from": "underscore.string@>=3.2.3 <3.3.0", "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.2.3.tgz" }, + "util-deprecate": { + "version": "1.0.2", + "from": "util-deprecate@>=1.0.1 <1.1.0", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + }, "validate-npm-package-license": { "version": "3.0.1", "from": "validate-npm-package-license@>=3.0.1 <4.0.0", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz" }, + "verror": { + "version": "1.3.6", + "from": "verror@1.3.6", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz" + }, + "webstore-upload": { + "version": "0.0.7", + "from": "webstore-upload@latest", + "resolved": "https://registry.npmjs.org/webstore-upload/-/webstore-upload-0.0.7.tgz", + "dependencies": { + "glob": { + "version": "7.0.3", + "from": "glob@>=7.0.0 <8.0.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.3.tgz" + }, + "lodash": { + "version": "2.4.2", + "from": "lodash@>=2.4.1 <3.0.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz" + }, + "minimatch": { + "version": "3.0.0", + "from": "minimatch@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz" + } + } + }, "which": { "version": "1.2.4", "from": "which@>=1.2.1 <1.3.0", @@ -799,6 +1092,16 @@ "from": "wrench@>=1.5.0 <2.0.0", "resolved": "https://registry.npmjs.org/wrench/-/wrench-1.5.9.tgz" }, + "xtend": { + "version": "4.0.1", + "from": "xtend@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + }, + "yallist": { + "version": "2.0.0", + "from": "yallist@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.0.0.tgz" + }, "zip-stream": { "version": "0.3.7", "from": "zip-stream@>=0.3.0 <0.4.0", diff --git a/package.json b/package.json index 9dc9a50b4..1d2c5bf4c 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,8 @@ "jshint": "^2.9.1", "jszip": "^2.6.0", "lodash": "^4.10.0", - "marked": "^0.3.5" + "marked": "^0.3.5", + "webstore-upload": "0.0.7" }, "repository": { "type": "git", diff --git a/tools/webstore.js b/tools/webstore.js new file mode 100644 index 000000000..3d792fc21 --- /dev/null +++ b/tools/webstore.js @@ -0,0 +1,31 @@ +var fs = require('fs'); +var webstore_upload = require('webstore-upload'); + +var pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); +var secrets = JSON.parse(fs.readFileSync(`../${pkg.meta.path}.keys/chrome-store.json`, 'utf8')); + +webstore_upload({ + accounts: { + default: { + publish: true, + client_id: secrets.installed.client_id, + client_secret: secrets.installed.client_secret, + } + }, + extensions: { + extension: { + appID: pkg.meta.chromeStoreID, + zip: `dist/builds/${pkg.name}.zip` + } + } +}, 'default').catch(function(err) { + var code; + try { + code = JSON.parse(err).more.error.itemError[0].error_code; + } catch(err2) { + } + // PKG_INVALID_VERSION_NUMBER occurs when re-uploading an old version + if (code !== 'PKG_INVALID_VERSION_NUMBER') { + process.exit(1); + } +});