From e90f38b17f15fdc0e55118a8dc53ff7cff1db041 Mon Sep 17 00:00:00 2001 From: "Felix T. Vogel" Date: Thu, 4 Apr 2024 14:47:49 +0200 Subject: [PATCH] Updated readme to include new pre- and post-release script functionality and clarify sftp configuration and added a guidelines section and a license section; Configs are now also sorted to be uploaded last in the pipeline; Added guidelines and license --- GUIDELINES.md | 25 ++++++++++++++++++++++ LICENSE.txt | 7 ++++++ README.md | 59 +++++++++++++++++++++++++++++++++++++++++++++------ pipeline.js | 12 +++++++++-- 4 files changed, 95 insertions(+), 8 deletions(-) create mode 100644 GUIDELINES.md create mode 100644 LICENSE.txt diff --git a/GUIDELINES.md b/GUIDELINES.md new file mode 100644 index 0000000..bcd7c1e --- /dev/null +++ b/GUIDELINES.md @@ -0,0 +1,25 @@ +# Logo and Name Usage Guidelines + +Thank you for using the Birdhouse Framework. We are pleased that you've chosen our framework for your projects. To maintain the integrity of the Birdhouse Framework brand and to prevent any confusion or misrepresentation, we've established the following guidelines for using the Birdhouse Framework logo and name. + +### Permitted Use + +- **Project Attribution:** You may use the Birdhouse Framework logo and name to indicate that your project or product was built using the Birdhouse Framework. For example, in your project documentation or on your website, you may include statements like "Built with Birdhouse" together with the logo. You can also display the Birdhouse Framework logo with a note indicating your project's use of the framework. +- **Educational and Instructional Material:** You are welcome to use the logo and name in educational or instructional materials that teach or demonstrate how to use the Birdhouse Framework, such as tutorials, courses, or articles. + +### Restrictions + +- **No Implication of Affiliation or Endorsement:** The use of the Birdhouse Framework logo and name should not imply any official affiliation with or endorsement by the Birdhouse Framework team unless such a relationship has been formally established. Please avoid using the logo or name in a way that suggests sponsorship, partnership, or any official status without explicit permission. +- **Inappropriate Use:** You should not use the Birdhouse Framework logo or name in any way that is misleading, defamatory, infringes on intellectual property rights, violates any rights of privacy or publicity, or is otherwise unlawful or in any manner that disparages the Birdhouse Framework or its community. + +### Visual and Verbal Representation + +- **Maintain Original Design:** Do not alter, distort, or reconfigure the logo. It should be used as provided by the Birdhouse Framework, ensuring that its design integrity is preserved. + +- **Color Modification:** You are permitted to modify the color of the logo to better align with your project's design aesthetic, provided there is sufficient contrast to maintain its visibility and recognizability. This flexibility is intended to facilitate the logo's integration into a variety of design contexts while respecting the Birdhouse Framework's brand identity. + +- **Prohibited Uses:** The Birdhouse Framework logo should not be used in any manner that implies endorsement, affiliation, or sponsorship by the Birdhouse Framework unless such a relationship has been officially established. Additionally, the logo must not be used in contexts that could be considered inappropriate, offensive, or in conflict with the values and reputation of the Birdhouse Framework. + +### Request for Permission + +If you wish to use the Birdhouse Framework logo or name in any manner not covered by these guidelines, or if you have any doubts about the correct use of the logo and name, please contact us at [contact@housebird.games](mailto:contact@housebird.games). We're more than happy to discuss your needs and, if possible, grant permission. \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..85287a7 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,7 @@ +Copyright 2024 Felix T. Vogel + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index f66447b..5f6f03e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@

-# **Birdhouse** +# **The Birdhouse Framework** ## Introduction @@ -16,6 +16,19 @@ Access comprehensive Birdhouse documentation at [birdhouse-js.com](https://birdh For private, local access to the documentation, leverage the [official Birdhouse GitHub repository](https://github.com/HousebirdGames/Birdhouse-Website). Simply clone the repository and deploy it locally, for example, with XAMPP. +## Logo and Name Use Guidelines Notice + +When using the Birdhouse Framework in your projects, please adhere to our [Logo and Name Use Guidelines](https://github.com/HousebirdGames/Birdhouse/blob/main/GUIDELINES.md) to ensure respectful and correct usage of our brand assets. + +## License + +The Birdhouse Framework is open source software licensed under the [MIT license](https://opensource.org/licenses/MIT). This license grants you the permission to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, subject to the following conditions: + +- **Acknowledgment:** While not required, we appreciate acknowledgment or attribution when the Birdhouse Framework is used in a project. This can be in the form of a link back to our [GitHub repository](https://github.com/HousebirdGames/Birdhouse) or our official website, [birdhouse-js.com](https://birdhouse-js.com). +- **Logo and Name Use:** The use of the Birdhouse Framework logo and name is governed by our Logo and Name Use Guidelines, which are designed to ensure the respectful and correct usage of our brand assets. Please refer to these guidelines for more details on how to use the Birdhouse Framework logo and name in your projects. + +This license does not require you to make your own project open source if you use the Birdhouse Framework. + ## Quick Start Follow these steps to get the project up and running on your local machine: @@ -100,10 +113,21 @@ Ensure to keep the `pipeline-config.js` updated with any changes in project stru The `pipeline.js` script streamlines the release process. It will automatically compress any images from `uncompressedDir` to the `compressedDir`. -### Steps: +### Setting Up the Pipeline + +To get started with deploying your Birdhouse project, you'll need to configure the deployment pipeline. This involves setting up configuration files for the pipeline itself and for secure file transfer (SFTP). Follow these steps to ensure everything is set up correctly: + +1. **Configure the Pipeline:** + + Edit the `pipeline-config.js` file located in your Birdhouse directory. This file contains settings specific to your project, such as deployment targets and versioning. Fill in the necessary details according to your project's requirements. + +2. **Set Up SFTP:** -**First:** Configure the pipeline in `pipeline-config.js`. -**Second:** Configure the `sftp-config.js`. + Next, adjust the `sftp-config.js` file to match your server's SFTP connection details. This configuration enables the pipeline to upload your project files to the server. + +3. **Configuration:** + + For additional security and to make the SFTP configuration reusable for other Birdhouse projects, move the `sftp-config.js` file to the parent directory of your Birdhouse project. This separation ensures that sensitive information, like server credentials, is not stored within the project directory, reducing the risk of accidental exposure. Make sure your are in the Birdhouse directory: ```bash @@ -121,9 +145,32 @@ cd Birdhouse pipeline.js -p -c -m -v 1.2.3.4 ``` -**Important:** Some files (like `service-worker-js`) are placed within `Birdhouse/root` and will be copied to the root of the project. This will be done automatically on deployment, but can also be triggered with the `-root`-flag. +**Important:** Some files (like `service-worker.js`) are placed within `Birdhouse/root` and will be copied to the root of the project. This will be done automatically on deployment, but can also be triggered with the `-root`-flag. + +### Utilizing Pre- and Post-Release Scripts + +For advanced deployment scenarios, your Birdhouse project might require the execution of additional Node.js scripts either before or after the deployment process. This feature is especially useful for tasks such as database migrations, environment setup, or cleanup operations that need to run in conjunction with your deployment workflow. + +To integrate these tasks into your deployment process, you can specify them in the `pipeline-config.js` file within the Birdhouse directory. Add the relative paths to your scripts to the `preReleaseScripts` array for scripts that need to run before deployment, and to the `postReleaseScripts` array for scripts that should run after deployment. This configuration ensures that your scripts are executed automatically at the appropriate time during the deployment to either production or staging environments. + +#### Example Configuration + +```javascript +// In pipeline-config.js +module.exports = { + // Other configurations... + preReleaseScripts: [ + 'scripts/pre-deploy-script.js' + ], + postReleaseScripts: [ + 'scripts/post-deploy-script.js' + ] +}; +``` + +This setup automatically calls `pre-deploy-script.js` (located in the scripts folder of your projects root directory) before initiating the deployment process and `post-deploy-script.js` after the deployment completes successfully. Make sure your scripts are idempotent (i.e., they can run multiple times without causing issues) and have proper error handling to avoid disrupting the deployment process. -### Command Line Options (most can be combined): +### Command Line Options: - `-help`, `-h` or no flag: Display help message and exit. **(STRONGLY RECOMMENDED to get more detailed and up to date information)** - `-update` or `-u`: Updates or creates the config.js and config-pipeline.js with necessary entries, orders them and exits. diff --git a/pipeline.js b/pipeline.js index 760b908..2bff94c 100644 --- a/pipeline.js +++ b/pipeline.js @@ -876,8 +876,16 @@ async function uploadFilesToServer(filesToCache, applicationPath) { //service worker is uploaded last to not trigger recaching on clients before all files are uploaded filesToUpload.sort((a, b) => { - if (path.basename(a) === 'service-worker.js') return 1; - if (path.basename(b) === 'service-worker.js') return -1; + const filenameA = path.basename(a); + const filenameB = path.basename(b); + + if (filenameA === 'service-worker.js') return 1; + if (filenameB === 'service-worker.js') return -1; + if (filenameA === 'config-sw.js') return 1; + if (filenameB === 'config-sw.js') return -1; + if (filenameA === 'config.js') return 1; + if (filenameB === 'config.js') return -1; + return 0; });