@comet/create-app 1.18.0 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -17,17 +17,25 @@ The following arguments can be passed to customize the project setup:
17
17
 
18
18
  - `project-name` (required): Specifies the name of the project. It will be used as the directory name for the project.
19
19
  - `-ni` or `--no-install`: Disables the automatic installation of dependencies.
20
+ - `-r` or `--repository <repository>`: Repository to clone from. Defaults to `https://github.com/vivid-planet/comet-starter.git`.
21
+ - `-b` or `--branch <branch>`: Branch to checkout. Defaults to `main`.
20
22
  - `-v` or `--verbose`: Enables extra console logs for verbose output.
21
23
  - `-V` or `--version`: Outputs the version number.
22
24
  - `-h` or `--help`: Display help for the command.
23
25
 
24
- Example usage with arguments:
26
+ #### Example usage with arguments
27
+
28
+ Create a new Comet app with the name "my-project" and enable verbose logging:
25
29
 
26
30
  ```bash
27
31
  npx @comet/create-app my-project -v
28
32
  ```
29
33
 
30
- This command will create a new Comet app with the name "my-project" and enable verbose logging.
34
+ Create a new Comet app with a different repository and branch:
35
+
36
+ ```bash
37
+ npx @comet/create-app my-project -r https://github.com/my-company/comet-starter.git -b next
38
+ ```
31
39
 
32
40
  ### Commands
33
41
 
package/lib/index.js CHANGED
@@ -23,9 +23,17 @@ void (async () => {
23
23
  .argument("<projectName>", "Sets the name of the project.")
24
24
  .option("-v, --verbose", "Enables extra console logs for verbose output.")
25
25
  .option("-ni, --no-install", "Disables the automatic installation of dependencies.")
26
+ .option("-r, --repository <repository>", "Repository to clone from.")
27
+ .option("-b, --branch <branch>", "Branch to checkout.")
26
28
  .action((projectName, options) => {
27
29
  if ((0, isValidProjectName_1.isValidProjectName)(projectName)) {
28
- (0, createApp_1.createApp)({ projectName, verbose: options.verbose, install: options.install });
30
+ (0, createApp_1.createApp)({
31
+ projectName,
32
+ verbose: options.verbose,
33
+ install: options.install,
34
+ repository: options.repository,
35
+ branch: options.branch,
36
+ });
29
37
  }
30
38
  else {
31
39
  program.error("Please provide a valid project name.");
@@ -17,7 +17,7 @@ const createInitialGitCommit_1 = require("./createInitialGitCommit");
17
17
  const createWorkingDirectoryCopy_1 = require("./createWorkingDirectoryCopy");
18
18
  async function createApp(commandOptions) {
19
19
  console.log(`Creating a new Comet app in ${kleur_1.default.blue(`${process_1.default.cwd()}\n`)}`);
20
- (0, createWorkingDirectoryCopy_1.createWorkingDirectoryCopy)(commandOptions.projectName, commandOptions.verbose);
20
+ (0, createWorkingDirectoryCopy_1.createWorkingDirectoryCopy)(commandOptions);
21
21
  (0, cleanupReadme_1.cleanupReadme)(commandOptions.verbose);
22
22
  (0, cleanupWorkingDirectory_1.cleanupWorkingDirectory)(commandOptions.verbose);
23
23
  (0, replacePlaceholder_1.replacePlaceholder)(commandOptions.projectName, commandOptions.verbose);
@@ -7,9 +7,9 @@ exports.createWorkingDirectoryCopy = void 0;
7
7
  const child_process_1 = require("child_process");
8
8
  const kleur_1 = __importDefault(require("kleur"));
9
9
  const process_1 = __importDefault(require("process"));
10
- function createWorkingDirectoryCopy(projectName, verbose) {
10
+ function createWorkingDirectoryCopy({ projectName, repository = "https://github.com/vivid-planet/comet-starter.git", branch = "main", verbose, }) {
11
11
  try {
12
- const clone = `git clone --depth 1 https://github.com/vivid-planet/comet-starter.git ./${projectName}`;
12
+ const clone = `git clone --depth 1 --branch ${branch} ${repository} ./${projectName}`;
13
13
  (0, child_process_1.execSync)(clone);
14
14
  process_1.default.chdir(`./${projectName}`);
15
15
  if (verbose) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comet/create-app",
3
- "version": "1.18.0",
3
+ "version": "1.20.0",
4
4
  "description": "Command-line interface to create a new Comet application",
5
5
  "homepage": "https://github.com/vivid-planet/comet-starter/tree/main/create-app#readme",
6
6
  "bugs": {
@@ -39,7 +39,7 @@
39
39
  "rimraf": "^5.0.1"
40
40
  },
41
41
  "devDependencies": {
42
- "@comet/eslint-config": "^6.5.0",
42
+ "@comet/eslint-config": "^6.9.0",
43
43
  "@tsconfig/node20": "^20.1.2",
44
44
  "@types/node": "^20.0.0",
45
45
  "npm-run-all": "^4.1.5",