[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [pluggable-transports/snowflake-webext] 01/08: refactor: use a separate directory for webext dist files



This is an automated email from the git hooks/post-receive script.

shelikhoo pushed a commit to branch main
in repository pluggable-transports/snowflake-webext.

commit 604eee1fb9a0114e27bb40bd8a341e4198a62c94
Author: WofWca <wofwca@xxxxxxxxxxxxxx>
AuthorDate: Fri Jun 17 21:09:34 2022 +0300

    refactor: use a separate directory for webext dist files
---
 .eslintignore |  2 +-
 .gitignore    |  7 +------
 LICENSE       |  1 +
 README.md     |  4 ++--
 make.js       | 11 ++++++-----
 5 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/.eslintignore b/.eslintignore
index c249199..7875026 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,6 +1,6 @@
 build/
+build-webext/
 test/
-webext/snowflake.js
 snowflake-library.js
 
 # FIXME: Whittle these away
diff --git a/.gitignore b/.gitignore
index cbd3202..95c2b84 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,14 +5,9 @@
 .DS_Store
 test
 build
+/build-webext
 node_modules
 snowflake-library.js
 spec/support
-webext/snowflake.js
-webext/popup.js
-webext/embed.html
-webext/embed.css
-webext/assets/
-webext/_locales/
 ignore/
 npm-debug.log
diff --git a/LICENSE b/LICENSE
index 42f6296..096d6e3 100644
--- a/LICENSE
+++ b/LICENSE
@@ -4,6 +4,7 @@
 ================================================================================
 Copyright (c) 2016, Serene Han, Arlo Breault
 Copyright (c) 2019-2020, The Tor Project, Inc
+Copyright (c) 2022, WofWca <wofwca@xxxxxxxxxxxxxx>
 
 Redistribution and use in source and binary forms, with or without modification,
 are permitted provided that the following conditions are met:
diff --git a/README.md b/README.md
index 90ce21b..d6a508a 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ npm install
 npm run webext
 ```
 
-and then load the `webext/` directory as an unpacked extension.
+and then load the `build-webext/` directory as an unpacked extension.
  * https://developer.mozilla.org/en-US/docs/Tools/about:debugging#Loading_a_temporary_extension
  * https://developer.chrome.com/extensions/getstarted#manifest
 
@@ -122,7 +122,7 @@ npm run pack-webext x.y.z
 git push origin master
 git push origin --tags
 
-# Upload the generated webext.zip (and source.zip) to the webextension stores,
+# Upload the generated build-webext.zip (and source.zip) to the webextension stores,
 # 1. https://addons.mozilla.org/en-US/developers/addon/torproject-snowflake/versions/submit/
 # 2. https://chrome.google.com/webstore/devconsole/
 
diff --git a/make.js b/make.js
index 46857db..d3a4af1 100755
--- a/make.js
+++ b/make.js
@@ -164,8 +164,9 @@ task('build', 'build the snowflake proxy', function() {
 });
 
 task('webext', 'build the webextension', function() {
-  const outDir = 'webext';
-  execSync(`git clean -f -x -d ${outDir}/`);
+  const outDir = 'build-webext';
+  execSync(`rm -rf ${outDir} && mkdir ${outDir}`);
+  execSync(`cp -r webext/. ${outDir}/`);
   execSync(`cp -r ${STATIC}/{${SHARED_FILES.join(',')}} ${outDir}/`, { shell: '/bin/bash' });
   copyTranslations(outDir);
   concatJS(outDir, 'webext', 'snowflake.js', '');
@@ -187,7 +188,7 @@ var updateVersion = function(file, version) {
 task('pack-webext', 'pack the webextension for deployment', function() {
   try {
     execSync(`rm -f source.zip`);
-    execSync(`rm -f webext/webext.zip`);
+    execSync(`rm -f build-webext.zip`);
   } catch (error) {
     //Usually this happens because the zip files were removed previously
     console.log('Error removing zip files');
@@ -210,11 +211,11 @@ task('pack-webext', 'pack the webextension for deployment', function() {
   }
   execSync(`git archive -o source.zip HEAD .`);
   execSync(`npm run webext`);
-  execSync(`cd webext && zip -Xr webext.zip ./*`);
+  execSync(`cd build-webext && zip -Xr ../build-webext.zip ./*`);
 });
 
 task('clean', 'remove all built files', function() {
-  execSync('rm -rf build test spec/support');
+  execSync('rm -rf build build-webext test spec/support');
 });
 
 task('library', 'build the library', function() {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits