From bf1054770662d22d210b51ab3d3f3fcf353a3772 Mon Sep 17 00:00:00 2001 From: Robby6Strings Date: Tue, 20 Aug 2024 11:55:12 +1200 Subject: [PATCH] improve str template vars --- CODEOWNERS | 2 +- CODE_OF_CONDUCT.md | 2 +- CONTRIBUTING.md | 10 +++++----- FUNDING.yml | 2 +- LICENSE | 2 +- README.md | 6 +++--- SECURITY.md | 2 +- SUPPORT.md | 2 +- packages/lib/LICENSE | 2 +- packages/lib/README.md | 2 +- packages/lib/package.json | 4 ++-- sandbox/node/package.json | 2 +- sandbox/node/src/index.ts | 2 +- setup.js | 12 ++++++------ 14 files changed, 26 insertions(+), 26 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index 98de325..d8bccd9 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -4,7 +4,7 @@ These owners will be the default owners for everything in the repo. Unless a later match takes precedence, they will be requested for review when someone opens a PR. -- @MY-GITHUB +- @!!MY-GITHUB!! Order is important; the last matching pattern takes the most precedence. When someone opens a PR that only modifies diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 38eebf8..3a7af7f 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -55,7 +55,7 @@ further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at **MY-EMAIL**. All +reported by contacting the project team at **!!MY-EMAIL!!**. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dc628bb..a778d38 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,11 +20,11 @@ _Pull requests, bug reports, and all other forms of contribution are welcomed an ## :book: Code of Conduct -Please review our [Code of Conduct](https://github.com/MY-GITHUB/MY-PACKAGE/blob/main/CODE_OF_CONDUCT.md). It is in effect at all times. We expect it to be honored by everyone who contributes to this project. Acting like an asshole will not be tolerated. +Please review our [Code of Conduct](https://github.com/!!MY-GITHUB!!/!!MY-PACKAGE!!/blob/main/CODE_OF_CONDUCT.md). It is in effect at all times. We expect it to be honored by everyone who contributes to this project. Acting like an asshole will not be tolerated. ## :bulb: Asking Questions -See our [Support Guide](https://github.com/MY-GITHUB/MY-PACKAGE/blob/main/SUPPORT.md). In short, GitHub issues are not the appropriate place to debug your specific project, but should be reserved for filing bugs and feature requests. +See our [Support Guide](https://github.com/!!MY-GITHUB!!/!!MY-PACKAGE!!/blob/main/SUPPORT.md). In short, GitHub issues are not the appropriate place to debug your specific project, but should be reserved for filing bugs and feature requests. ## :inbox_tray: Opening an Issue @@ -32,7 +32,7 @@ Before [creating an issue](https://help.github.com/en/github/managing-your-work- ### :lock: Reporting Security Issues -Review our [Security Policy](https://github.com/MY-GITHUB/MY-PACKAGE/blob/main/SECURITY.md). **Do not** file a public issue for security vulnerabilities. +Review our [Security Policy](https://github.com/!!MY-GITHUB!!/!!MY-PACKAGE!!/blob/main/SECURITY.md). **Do not** file a public issue for security vulnerabilities. ### :beetle: Bug Reports and Other Issues @@ -40,7 +40,7 @@ A great way to contribute to the project is to send a detailed issue when you en In short, since you are most likely a developer, **provide a ticket that you would like to receive**. -- **Review the documentation and [Support Guide](https://github.com/MY-GITHUB/MY-PACKAGE/blob/main/SUPPORT.md)** before opening a new issue. +- **Review the documentation and [Support Guide](https://github.com/!!MY-GITHUB!!/!!MY-PACKAGE!!/blob/main/SUPPORT.md)** before opening a new issue. - **Do not open a duplicate issue!** Search through existing issues to see if your issue has previously been reported. If your issue exists, comment with any additional information you have. You may simply note "I have this problem too", which helps prioritize the most common problems and requests. @@ -181,7 +181,7 @@ To confirm that you have read this guide and are following it as best as possibl ## :pray: Credits -Written by [@MY-GITHUB](https://github.com/MY-GITHUB). +Written by [@!!MY-GITHUB!!](https://github.com/!!MY-GITHUB!!). **Please feel free to adopt this guide in your own projects. Fork it wholesale or remix it for your needs.** diff --git a/FUNDING.yml b/FUNDING.yml index c970d48..52ff46a 100644 --- a/FUNDING.yml +++ b/FUNDING.yml @@ -1,5 +1,5 @@ # Funding # https://help.github.com/en/github/administering-a-repository/displaying-a-sponsor-button-in-your-repository -github: MY-GITHUB +github: !!MY-GITHUB!! custom: [] diff --git a/LICENSE b/LICENSE index 660b02d..25b7dfb 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ ISC License -Copyright (c) 2024-present, MY-GITHUB +Copyright (c) 2024-present, !!MY-GITHUB!! Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. diff --git a/README.md b/README.md index a9ddcf4..4381faf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# MY-PACKAGE +# !!MY-PACKAGE!! -Development monorepo template for **MY-PACKAGE**. +Development monorepo template for **!!MY-PACKAGE!!**. Get started by running @@ -16,7 +16,7 @@ node setup --package packagename --github mygithubusername --email me@hotmail.co - Contains workflows used by GitHub Actions. - `packages` - Contains the individual packages managed in the monorepo. - - [MY-PACKAGE](https://github.com/MY-GITHUB/MY-PACKAGE/blob/main/packages/lib) + - [!!MY-PACKAGE!!](https://github.com/!!MY-GITHUB!!/!!MY-PACKAGE!!/blob/main/packages/lib) - `sandbox` - Contains example applications and random tidbits. diff --git a/SECURITY.md b/SECURITY.md index b03e8b2..f5755ff 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,7 +4,7 @@ If you discover a security issue, please bring it to our attention right away! ## Reporting a Vulnerability -Please **DO NOT** file a public issue to report a security vulberability, instead send your report privately to **MY-EMAIL**. This will help ensure that any vulnerabilities that are found can be [disclosed responsibly](https://en.wikipedia.org/wiki/Responsible_disclosure) to any affected parties. +Please **DO NOT** file a public issue to report a security vulberability, instead send your report privately to **!!MY-EMAIL!!**. This will help ensure that any vulnerabilities that are found can be [disclosed responsibly](https://en.wikipedia.org/wiki/Responsible_disclosure) to any affected parties. ## Supported Versions diff --git a/SUPPORT.md b/SUPPORT.md index f65a61d..43b9f30 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -12,7 +12,7 @@ Please seek support in the following ways: 1. :bulb: **Search for answers and ask questions on [Stack Overflow](https://stackoverflow.com).** This is the most appropriate place for debugging issues specific to your use of the project, or figuring out how to use the project in a specific way. -1. :memo: As a **last resort**, you may open an issue on GitHub to ask for help. However, please clearly explain what you are trying to do, and list what you have already attempted to solve the problem. Provide code samples, but **do not** attach your entire project for someone else to debug. Review our [contributing guidelines](https://github.com/MY-GITHUB/MY-PACKAGE/blob/main/CONTRIBUTING.md). +1. :memo: As a **last resort**, you may open an issue on GitHub to ask for help. However, please clearly explain what you are trying to do, and list what you have already attempted to solve the problem. Provide code samples, but **do not** attach your entire project for someone else to debug. Review our [contributing guidelines](https://github.com/!!MY-GITHUB!!/!!MY-PACKAGE!!/blob/main/CONTRIBUTING.md). ## What NOT to do diff --git a/packages/lib/LICENSE b/packages/lib/LICENSE index 660b02d..25b7dfb 100644 --- a/packages/lib/LICENSE +++ b/packages/lib/LICENSE @@ -1,6 +1,6 @@ ISC License -Copyright (c) 2024-present, MY-GITHUB +Copyright (c) 2024-present, !!MY-GITHUB!! Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. diff --git a/packages/lib/README.md b/packages/lib/README.md index 8ceb737..84e7f40 100644 --- a/packages/lib/README.md +++ b/packages/lib/README.md @@ -1,4 +1,4 @@ -# **MY-PACKAGE** +# **!!MY-PACKAGE!!** #### _An awesome new package._ diff --git a/packages/lib/package.json b/packages/lib/package.json index bdb80b5..aa00b76 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -1,5 +1,5 @@ { - "name": "MY-PACKAGE", + "name": "!!MY-PACKAGE!!", "version": "1.0.0", "description": "An awesome new package", "main": "dist/index.js", @@ -13,6 +13,6 @@ "build": "tsc" }, "keywords": [], - "author": "MY-GITHUB", + "author": "!!MY-GITHUB!!", "license": "ISC" } diff --git a/sandbox/node/package.json b/sandbox/node/package.json index a58dbd4..07a0daf 100644 --- a/sandbox/node/package.json +++ b/sandbox/node/package.json @@ -14,6 +14,6 @@ "author": "", "license": "ISC", "dependencies": { - "MY-PACKAGE": "workspace:^" + "!!MY-PACKAGE!!": "workspace:^" } } diff --git a/sandbox/node/src/index.ts b/sandbox/node/src/index.ts index 6c93e64..3d9ddd4 100644 --- a/sandbox/node/src/index.ts +++ b/sandbox/node/src/index.ts @@ -1,4 +1,4 @@ -import { add } from "MY-PACKAGE" +import { add } from "!!MY-PACKAGE!!" function main() { console.log(add(1, 2)) diff --git a/setup.js b/setup.js index 1a79ab8..b9dd07d 100644 --- a/setup.js +++ b/setup.js @@ -16,19 +16,19 @@ function getArgValue(...argsToMatch) { } // prompt user for package name -const packageName = getArgValue("--package", "-p") // MY-PACKAGE +const packageName = getArgValue("--package", "-p") // !!MY-PACKAGE!! if (!packageName) { console.error("Please provide a package name") process.exit(1) } -const myGithub = getArgValue("--github", "-g") // MY-GITHUB +const myGithub = getArgValue("--github", "-g") // !!MY-GITHUB!! if (!myGithub) { console.error("Please provide the github name (eg. LankyMoose)") process.exit(1) } -const email = getArgValue("--email", "-e") // MY-EMAIL +const email = getArgValue("--email", "-e") // !!MY-EMAIL!! if (!email) { console.error("Please provide an email address") process.exit(1) @@ -44,8 +44,8 @@ for (const file of files) { const filePath = path.join(cwd, file.name) const content = fs.readFileSync(filePath, "utf8") const updatedContent = content - .replace(/MY-PACKAGE/g, packageName) - .replace(/MY-GITHUB/g, myGithub) - .replace(/MY-EMAIL/g, email) + .replace(/!!MY-PACKAGE!!/g, packageName) + .replace(/!!MY-GITHUB!!/g, myGithub) + .replace(/!!MY-EMAIL!!/g, email) fs.writeFileSync(filePath, updatedContent) }