diff --git a/CODEOWNERS b/CODEOWNERS index d8bccd9..58a7ad7 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!! +- @%GITHUB-USERNAME% 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 3a7af7f..0c5df69 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 **%EMAIL-ADDRESS%**. 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 a778d38..87f1965 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/%GITHUB-USERNAME%/%PACKAGE-NAME%/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/%GITHUB-USERNAME%/%PACKAGE-NAME%/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/%GITHUB-USERNAME%/%PACKAGE-NAME%/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/%GITHUB-USERNAME%/%PACKAGE-NAME%/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 [@%GITHUB-USERNAME%](https://github.com/%GITHUB-USERNAME%). **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 52ff46a..8e2391c 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: %GITHUB-USERNAME% custom: [] diff --git a/LICENSE b/LICENSE index 25b7dfb..96dcc16 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ ISC License -Copyright (c) 2024-present, !!MY-GITHUB!! +Copyright (c) 2024-present, %GITHUB-USERNAME% 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 4381faf..21268b4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# !!MY-PACKAGE!! +# %PACKAGE-NAME% -Development monorepo template for **!!MY-PACKAGE!!**. +Development monorepo template for **%PACKAGE-NAME%**. 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) + - [%PACKAGE-NAME%](https://github.com/%GITHUB-USERNAME%/%PACKAGE-NAME%/blob/main/packages/lib) - `sandbox` - Contains example applications and random tidbits. diff --git a/SECURITY.md b/SECURITY.md index f5755ff..04b64a4 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 **%EMAIL-ADDRESS%**. 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 43b9f30..bafb3ac 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/%GITHUB-USERNAME%/%PACKAGE-NAME%/blob/main/CONTRIBUTING.md). ## What NOT to do diff --git a/packages/lib/LICENSE b/packages/lib/LICENSE index 25b7dfb..96dcc16 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, %GITHUB-USERNAME% 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 84e7f40..cfda8ab 100644 --- a/packages/lib/README.md +++ b/packages/lib/README.md @@ -1,4 +1,4 @@ -# **!!MY-PACKAGE!!** +# **%PACKAGE-NAME%** #### _An awesome new package._ diff --git a/packages/lib/package.json b/packages/lib/package.json index aa00b76..d7b4e76 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -1,18 +1,18 @@ { - "name": "!!MY-PACKAGE!!", + "name": "%PACKAGE-NAME%", "version": "1.0.0", "description": "An awesome new package", "main": "dist/index.js", "type": "module", "repository": { "type": "git", - "url": "https://github.com/Robby6Strings/[repo-name]" + "url": "https://github.com/%GITHUB-USERNAME%/%PACKAGE-NAME%" }, "scripts": { "test": "echo \"Error: no test specified\"", "build": "tsc" }, "keywords": [], - "author": "!!MY-GITHUB!!", + "author": "%GITHUB-USERNAME%", "license": "ISC" } diff --git a/sandbox/node/package.json b/sandbox/node/package.json index 07a0daf..65c1c6b 100644 --- a/sandbox/node/package.json +++ b/sandbox/node/package.json @@ -14,6 +14,6 @@ "author": "", "license": "ISC", "dependencies": { - "!!MY-PACKAGE!!": "workspace:^" + "%PACKAGE-NAME%": "workspace:^" } } diff --git a/sandbox/node/src/index.ts b/sandbox/node/src/index.ts index 3d9ddd4..c111c35 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 "%PACKAGE-NAME%" function main() { console.log(add(1, 2)) diff --git a/setup.js b/setup.js index b9dd07d..1543eb4 100644 --- a/setup.js +++ b/setup.js @@ -16,36 +16,41 @@ function getArgValue(...argsToMatch) { } // prompt user for package name -const packageName = getArgValue("--package", "-p") // !!MY-PACKAGE!! +const packageName = getArgValue("--package", "-p") // %PACKAGE-NAME% if (!packageName) { console.error("Please provide a package name") process.exit(1) } -const myGithub = getArgValue("--github", "-g") // !!MY-GITHUB!! +const myGithub = getArgValue("--github", "-g") // %GITHUB-USERNAME% 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") // %EMAIL-ADDRESS% if (!email) { console.error("Please provide an email address") process.exit(1) } const cwd = process.cwd() -//build up list of every file in cwd containing the text "test" const files = fs - .readdirSync(cwd, { withFileTypes: true }) - .filter((dirent) => dirent.isFile() && dirent.name !== "setup.js") + .readdirSync(cwd, { withFileTypes: true, recursive: true }) + .filter( + (dirent) => + dirent.isFile() && + !dirent.path.includes(".git") && + dirent.name !== "setup.js" + ) for (const file of files) { - const filePath = path.join(cwd, file.name) + console.log(`Updating ${file.name}`, file) + const filePath = path.join(file.path, 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) + .replaceAll("%PACKAGE-NAME%", packageName) + .replaceAll("%GITHUB-USERNAME%", myGithub) + .replaceAll("%EMAIL-ADDRESS%", email) fs.writeFileSync(filePath, updatedContent) }