Open Stebalien opened 7 years ago
Strange this has been working, was there a change that broke it I wonder? We did not need to follow the steps you just said to publish any of the other versions and I've been using this same exact code (at least the code I wrote originally) for two other chrome extensions as well.
Also to add to this issue, we should drop the chrome-
prefix and try and clean up the code to remove any trace of the previous branching.
How exactly did you publish it then? Did you upload the zip or did Google accept pre-packaged crx
files in the past.
Good question, it's been over a year since I last published an extension, it's possible they changed something on their end. I vaguely remember uploading both a key and the zip separately. I think the idea was that Google signs the .crx
for you.
Actually, given that the current system drops the key in the zip file (as key.pem
) as required by google, I don't think anything has changed. Have you tried building from a clean source?
By the way, here's a diff showing how I think this should work:
diff --git a/Gruntfile.coffee b/Gruntfile.coffee
index 9c991bb..9f3d03d 100644
--- a/Gruntfile.coffee
+++ b/Gruntfile.coffee
@@ -23,10 +23,10 @@ module.exports = ->
@registerTask 'chrome-extension', [
'clean:chrome-extension'
- 'compress:chrome-extension'
'copy:chrome-extension'
'stylus:chrome-extension'
'es6:chrome-extension'
+ 'compress:chrome-extension'
'shell:chrome-extension'
]
diff --git a/build/tasks/compress.coffee b/build/tasks/compress.coffee
index a02c5d2..4aee196 100644
--- a/build/tasks/compress.coffee
+++ b/build/tasks/compress.coffee
@@ -8,14 +8,6 @@ module.exports = ->
mode: 'zip'
files: [
- { src: ['node_modules/purecss/*'], dest: '.' }
- { src: ['**/*'], expand: true, cwd: 'shared' }
- {
- src: [
- 'key.pem'
- '_locales/**'
- ]
- expand: true
- cwd: 'chrome-extension'
- }
+ { src: ['key.pem'], cwd: 'chrome-extension/dist' }
+ { src: ['**/*'], expand: true, cwd: 'chrome-extension/dist/tipsy' }
]
However, I don't really know grunt so I don't know if this is how one is supposed to do it. The basic idea is that the crx
and zip
should look identical modulo key.pem
(only in the zip
).
This makes sense to me. I dunno how it could work with compress running before building.
So, the chrome build system is a bit weird.
npm build chrome
runs the tasks in the following order:Now, the chrome store expects a zip with a
key.pem
so I tried uploading the file produced bycompress:chrome-extension
(which meets both of these requirements). However, that zip file is missing the manifest‽ Worse, it appears to have a slightly different directory structure than the.crx
. At the end of the day, I just extracted the compiled extension (.crx
), put thekey.pem
in place, re-zipped, and uploaded that.As far as I can tell, the correct way to do this is to move the
compress:chrome-extension
task afteres6:chrome-extension
and make sure to build the.crx
and.zip
from the same source.