From 4ccfad656f3eb07df820aa273ef77e1786a989e9 Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Mon, 25 Oct 2021 16:27:19 -0500 Subject: [PATCH 1/8] Minor string debrand --- src/locales/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locales/en.json b/src/locales/en.json index 23c37ca..3d99ab5 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -4,7 +4,7 @@ "string": "Converts Scratch projects into HTML files, zip archives, or executable programs for Windows, macOS, and Linux." }, "description2": { - "string": "If you just want an easy way to embed a TurboWarp project into your website, you may be interested in {embedding}." + "string": "If you just want an easy way to embed a project into your website, you may be interested in {embedding}." }, "description2-embedding": { "string": "Embedding" From 8505c47e985447da1f2990e6f6a6986ace4f1dae Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Mon, 25 Oct 2021 16:36:22 -0500 Subject: [PATCH 2/8] Update README --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f182b2a..05aeeb9 100644 --- a/README.md +++ b/README.md @@ -42,12 +42,12 @@ Output will be located in the `dist` folder. Some assorted tips for people who want to fork this project (it's really easy): + - Please update `src/packager/brand.js` to use your own name and links. These appears in various places throughout the interface and packaged projects, including generated copyright notices. - The packager is deployed as a simple static website. You can host it anywhere by just copying the `dist` folder. We use GitHub Actions to deploy to GitHub Pages by running the "Deploy" workflow whenever we want to push to production (Actions > Deploy > Run workflow). This should be automatically available in forks after enabling GitHub Actions. - If you want to change the VM/renderer/etc. used, just `npm install` or `npm link` a different scratch-vm/scratch-render/etc and rebuild. You can even install a vanilla scratch-vm and all core functionality will still work (but optional features such as interpolation, high quality pen, stage size, etc. may not work) - - src/packager/brand.js controls names and links that appear in various places - - static/privacy.html is the privacy policy - - Large files such as NW.js or Electron executables are stored on an external server outside of this repository and have no guarantee of existing long-term. It's easy to setup your own, see src/packager/large-assets.js for more information. - - Set the environment variable ENABLE_SERVICE_WORKER=1 to enable service worker for offline support + - `static/privacy.html` is the privacy policy + - Large files such as NW.js or Electron executables are stored on an external server outside of this repository and have no guarantee of existing long-term. It's easy to setup your own, see `src/packager/large-assets.js` for more information. + - Set the environment variable ENABLE_SERVICE_WORKER = 1 to enable service worker for offline support. - Be aware of the license of this project (see below) ## Standalone builds From 1c6c82064a813174a8244d176f2ba29f87c16b4e Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Mon, 25 Oct 2021 16:41:55 -0500 Subject: [PATCH 3/8] Extract copyright notice to brand.js --- README.md | 2 ++ src/packager/brand.js | 19 +++++++++++++++++-- src/packager/packager.js | 16 ++-------------- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 05aeeb9..0594f39 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,8 @@ Output will be located in `dist/standalone.html`. ## License + + Copyright (C) 2021 Thomas Weber This project is licensed under the GNU Lesser General Public License version 3. See COPYING and COPYING.LESSER for more information. We believe that packaging a project using the packager "makes use of an interface provided by the Library, but which is not otherwise based on the Library" diff --git a/src/packager/brand.js b/src/packager/brand.js index 5636a25..f7a3cb1 100644 --- a/src/packager/brand.js +++ b/src/packager/brand.js @@ -1,9 +1,24 @@ -// Use old export to make this easier to import in old node environments +// Intentionally using old-style exports so that this is easier to import from node.js + module.exports = { APP_NAME: 'TurboWarp Packager', LONG_NAME: 'TurboWarp Packager for Scratch', SOURCE_CODE: 'https://github.com/TurboWarp/packager', FEEDBACK_SCRATCH: 'https://scratch.mit.edu/users/GarboMuffin/#comments', FEEDBACK_GITHUB: 'https://github.com/TurboWarp/packager/issues', - WEBSITE: 'https://packager.turbowarp.org/' + WEBSITE: 'https://packager.turbowarp.org/', + // Also update README.md if you change this + COPYRIGHT_NOTICE: `Copyright (C) 2021 Thomas Weber + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License version 3 +as published by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this program. If not, see .` }; diff --git a/src/packager/packager.js b/src/packager/packager.js index 69979b1..5ba0287 100644 --- a/src/packager/packager.js +++ b/src/packager/packager.js @@ -10,7 +10,7 @@ import {buildId, verifyBuildId} from './build-id'; import {encode, decode} from './base85'; import generateAsar from './generate-asar'; import {parsePlist, generatePlist} from './plist'; -import {APP_NAME, SOURCE_CODE, WEBSITE} from './brand'; +import {APP_NAME, SOURCE_CODE, WEBSITE, COPYRIGHT_NOTICE} from './brand'; const PROGRESS_LOADED_SCRIPTS = 0.1; const PROGRESS_LOADED_JSON_BUT_NEED_ASSETS = 0.2; @@ -86,19 +86,7 @@ const getAppIcon = async (file) => { const SELF_LICENSE = { title: APP_NAME, homepage: WEBSITE, - license: `Copyright (C) 2021 Thomas Weber - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License version 3 -as published by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this program. If not, see .` + license: COPYRIGHT_NOTICE }; const SCRATCH_LICENSE = { From 76342aa8b046b59b53ee61d277d4e17614260373 Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Mon, 25 Oct 2021 17:45:11 -0500 Subject: [PATCH 4/8] Use WEBSITE instead of SOURCE_CODE link in packaged projects --- src/packager/packager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/packager/packager.js b/src/packager/packager.js index 5ba0287..674f65b 100644 --- a/src/packager/packager.js +++ b/src/packager/packager.js @@ -10,7 +10,7 @@ import {buildId, verifyBuildId} from './build-id'; import {encode, decode} from './base85'; import generateAsar from './generate-asar'; import {parsePlist, generatePlist} from './plist'; -import {APP_NAME, SOURCE_CODE, WEBSITE, COPYRIGHT_NOTICE} from './brand'; +import {APP_NAME, WEBSITE, COPYRIGHT_NOTICE} from './brand'; const PROGRESS_LOADED_SCRIPTS = 0.1; const PROGRESS_LOADED_JSON_BUT_NEED_ASSETS = 0.2; @@ -133,7 +133,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.` }; const COPYRIGHT_HEADER = `/*! -Parts of this script are from the ${APP_NAME} <${SOURCE_CODE}>, licensed as follows: +Parts of this script are from the ${APP_NAME} <${WEBSITE}>, licensed as follows: ${SELF_LICENSE.license} Parts of this script are from Scratch , licensed as follows: From 6a2cdc9d530d0a0a325054fe166775bd5469761d Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Mon, 25 Oct 2021 17:46:03 -0500 Subject: [PATCH 5/8] Partially debrand privacy policy --- static/privacy.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/privacy.html b/static/privacy.html index 4886210..5ddee85 100644 --- a/static/privacy.html +++ b/static/privacy.html @@ -34,7 +34,7 @@
-

TurboWarp Packager Privacy Policy

+

Privacy Policy

From 8e94c917e63008b8eeefefae6d2366306a58d649 Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Mon, 25 Oct 2021 17:47:12 -0500 Subject: [PATCH 6/8] Update README --- README.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0594f39..6916811 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ https://packager.turbowarp.org/ -Converts Scratch projects into HTML files, zip archives, or executable programs for Windows, macOS, and Linux. Built using TurboWarp, webpack, and Svelte. +Converts Scratch projects into HTML files, zip archives, or executable programs for Windows, macOS, and Linux. ## Development @@ -40,15 +40,19 @@ Output will be located in the `dist` folder. ## Tips for forks -Some assorted tips for people who want to fork this project (it's really easy): +**Branding** - - Please update `src/packager/brand.js` to use your own name and links. These appears in various places throughout the interface and packaged projects, including generated copyright notices. - - The packager is deployed as a simple static website. You can host it anywhere by just copying the `dist` folder. We use GitHub Actions to deploy to GitHub Pages by running the "Deploy" workflow whenever we want to push to production (Actions > Deploy > Run workflow). This should be automatically available in forks after enabling GitHub Actions. - - If you want to change the VM/renderer/etc. used, just `npm install` or `npm link` a different scratch-vm/scratch-render/etc and rebuild. You can even install a vanilla scratch-vm and all core functionality will still work (but optional features such as interpolation, high quality pen, stage size, etc. may not work) - - `static/privacy.html` is the privacy policy - - Large files such as NW.js or Electron executables are stored on an external server outside of this repository and have no guarantee of existing long-term. It's easy to setup your own, see `src/packager/large-assets.js` for more information. - - Set the environment variable ENABLE_SERVICE_WORKER = 1 to enable service worker for offline support. - - Be aware of the license of this project (see below) + - Please update the brand strings (`src/packager/brand.js`) to use your own name and links. + - Update the privacy policy (`static/privacy.html`) to reflect your privacy practices. + - Update this document (`README.md`) too. + +**Deploying**: The packager is deployed as a simple static website. You can host it anywhere by just copying the `dist` folder after a build. We use GitHub Actions to deploy to GitHub Pages by running the "Deploy" workflow whenever we want to push to production (Actions > Deploy > Run workflow). This should be automatically available in forks after enabling GitHub Actions. + +**Changing Scratch internals**: If you want to change the VM/renderer/etc. used, just `npm install` or `npm link` a different scratch-vm/scratch-render/etc and rebuild. You can even install a vanilla scratch-vm and all core functionality will still work (but optional features such as interpolation, high quality pen, stage size, etc. may not work) + +**Large files**: Large files such as NW.js or Electron executables are stored on an external server outside of this repository and have no guarantee of existing long-term. It's easy to setup your own, see `src/packager/large-assets.js` for more information. + +**Service worker**: Set the environment variable `ENABLE_SERVICE_WORKER` to `1` to enable service worker for offline support. Not recommended in development. Automatically used the GitHub Actions deploy script. ## Standalone builds @@ -62,7 +66,7 @@ Output will be located in `dist/standalone.html`. ## License - + Copyright (C) 2021 Thomas Weber From 98d1a9028bb2dc74024e843ef87593877d79ba1e Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Mon, 25 Oct 2021 17:52:06 -0500 Subject: [PATCH 7/8] Update brand.js --- src/packager/brand.js | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/src/packager/brand.js b/src/packager/brand.js index f7a3cb1..7bded4f 100644 --- a/src/packager/brand.js +++ b/src/packager/brand.js @@ -1,13 +1,24 @@ -// Intentionally using old-style exports so that this is easier to import from node.js +/* +These values control branding strings throughout the entire app. If you're forking, please take a few minutes to update them. + +"The website" refers to the website itself that you use to load projects and convert them to another form. + +"Packaged projects" refers to the files generated by the website. They include a line of text something like: +`Parts of this script are from the ${APP_NAME} <${WEBSITE}>, licensed as follows: ${COPYRIGHT_NOTICE}` +*/ module.exports = { + // The name of the app. This text is included in packaged projects. APP_NAME: 'TurboWarp Packager', + + // A longer form of the app's name. Used by the website. LONG_NAME: 'TurboWarp Packager for Scratch', - SOURCE_CODE: 'https://github.com/TurboWarp/packager', - FEEDBACK_SCRATCH: 'https://scratch.mit.edu/users/GarboMuffin/#comments', - FEEDBACK_GITHUB: 'https://github.com/TurboWarp/packager/issues', + + // Your app's website. This link is included in packaged projects. WEBSITE: 'https://packager.turbowarp.org/', - // Also update README.md if you change this + + // A copyright notice regarding the app. This text is included in packaged projects. + // Also make sure to update the "License" section in README.md COPYRIGHT_NOTICE: `Copyright (C) 2021 Thomas Weber This program is free software: you can redistribute it and/or modify @@ -20,5 +31,14 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License -along with this program. If not, see .` +along with this program. If not, see .`, + + // Where users can find the app's source code. This link is included in the website. + // Note that due to the license used by the project (see README.md), you may be required to make the source code available to all visitors. + SOURCE_CODE: 'https://github.com/TurboWarp/packager', + + // Feedback/bug report links shown in various places throughout the website. + // These don't strictly need to be Scratch or GitHub links, but some parts of the interface label them that way. + FEEDBACK_SCRATCH: 'https://scratch.mit.edu/users/GarboMuffin/#comments', + FEEDBACK_GITHUB: 'https://github.com/TurboWarp/packager/issues' }; From 7177277dcd75c7494fd49b462a7fa13511ebfc0c Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Mon, 25 Oct 2021 17:54:57 -0500 Subject: [PATCH 8/8] Update README.md --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6916811..14f5c26 100644 --- a/README.md +++ b/README.md @@ -22,13 +22,13 @@ Then visit http://localhost:8947. Manually refresh to see changes. The general layout of `src` is: - - packager: The project packager - - p4: The Svelte interface for the packager - - scaffolding: A minimal Scratch project player used by the packager. Handles most of the boring details of playing Scratch projects such as handling basic mouse input - - common: Files used by both scaffolding and the packager - - addons: Optional addons such as gamepad support or pointerlock - - build: Unusual webpack customizations - - locales: Translations + - packager: The project packager. + - p4: The Svelte GUI for the packager. "p4" is the name that the packager uses internally to refer to itself. + - scaffolding: A minimal Scratch project player used by the packager. Handles most of the boring details of playing Scratch projects such as handling basic mouse input. + - common: Files used by both scaffolding and the packager. + - addons: Optional addons such as gamepad support or pointerlock. + - build: Various internal build tools including some webpack plugins and loaders. + - locales: Translations. Packaged projects generated while in development mode should not be distributed. Instead, you should run a production build to significantly reduce file size of both the website and the packager.