@comet/create-app 1.79.0 → 1.81.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
|
@@ -15,13 +15,13 @@ npx @comet/create-app <project-name>
|
|
|
15
15
|
|
|
16
16
|
The following arguments can be passed to customize the project setup:
|
|
17
17
|
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
18
|
+
- `project-name` (required): Specifies the name of the project. It will be used as the directory name for the project.
|
|
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`.
|
|
22
|
+
- `-v` or `--verbose`: Enables extra console logs for verbose output.
|
|
23
|
+
- `-V` or `--version`: Outputs the version number.
|
|
24
|
+
- `-h` or `--help`: Display help for the command.
|
|
25
25
|
|
|
26
26
|
#### Example usage with arguments
|
|
27
27
|
|
|
@@ -41,7 +41,7 @@ npx @comet/create-app my-project -r https://github.com/my-company/comet-starter.
|
|
|
41
41
|
|
|
42
42
|
The following commands can be used to customize the project setup:
|
|
43
43
|
|
|
44
|
-
-
|
|
44
|
+
- `remove-site`: Removes the site from the project.
|
|
45
45
|
|
|
46
46
|
Example usage:
|
|
47
47
|
|
package/lib/index.js
CHANGED
|
@@ -5,20 +5,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const commander_1 = require("commander");
|
|
7
7
|
const kleur_1 = __importDefault(require("kleur"));
|
|
8
|
+
const package_json_1 = require("../package.json");
|
|
8
9
|
const createApp_1 = require("./scripts/create-app/createApp");
|
|
9
10
|
const removeSite_1 = require("./scripts/remove-site/removeSite");
|
|
10
11
|
const cwdIsCometProject_1 = require("./util/cwdIsCometProject");
|
|
11
12
|
const isValidNodeVersion_1 = require("./util/isValidNodeVersion");
|
|
12
13
|
const isValidProjectName_1 = require("./util/isValidProjectName");
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
14
|
-
const { name, version } = require("../package.json");
|
|
15
14
|
if (!(0, isValidNodeVersion_1.isValidNodeVersion)()) {
|
|
16
|
-
console.error("Invalid Node Version (your Node.js version is prior to
|
|
15
|
+
console.error("Invalid Node Version (your Node.js version is prior to v22).");
|
|
17
16
|
process.exit(1);
|
|
18
17
|
}
|
|
19
18
|
void (async () => {
|
|
20
19
|
const program = new commander_1.Command();
|
|
21
|
-
program.name(name).description("CLI to create a Comet app").version(version);
|
|
20
|
+
program.name(package_json_1.name).description("CLI to create a Comet app").version(package_json_1.version);
|
|
22
21
|
program
|
|
23
22
|
.argument("<projectName>", "Sets the name of the project.")
|
|
24
23
|
.option("-v, --verbose", "Enables extra console logs for verbose output.")
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addProjectNameToUserDictionary = addProjectNameToUserDictionary;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const userDictionary = ".cspellignore";
|
|
6
|
+
function addProjectNameToUserDictionary(projectName) {
|
|
7
|
+
if (!(0, fs_1.existsSync)(userDictionary)) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
let fileContent = (0, fs_1.readFileSync)(userDictionary, "utf8");
|
|
11
|
+
fileContent += `${projectName.split("-").join("\n")}\n`;
|
|
12
|
+
(0, fs_1.writeFileSync)(userDictionary, fileContent);
|
|
13
|
+
}
|
|
@@ -10,6 +10,7 @@ const nanospinner_1 = require("nanospinner");
|
|
|
10
10
|
const process_1 = __importDefault(require("process"));
|
|
11
11
|
const replacePlaceholder_1 = require("../../util/replacePlaceholder");
|
|
12
12
|
const runEslintFix_1 = require("../../util/runEslintFix");
|
|
13
|
+
const addProjectNameToUserDictionary_1 = require("./addProjectNameToUserDictionary");
|
|
13
14
|
const amendCommitChanges_1 = require("./amendCommitChanges");
|
|
14
15
|
const cleanupReadme_1 = require("./cleanupReadme");
|
|
15
16
|
const cleanupWorkingDirectory_1 = require("./cleanupWorkingDirectory");
|
|
@@ -21,6 +22,7 @@ async function createApp(commandOptions) {
|
|
|
21
22
|
(0, cleanupReadme_1.cleanupReadme)(commandOptions.verbose);
|
|
22
23
|
(0, cleanupWorkingDirectory_1.cleanupWorkingDirectory)(commandOptions.verbose);
|
|
23
24
|
(0, replacePlaceholder_1.replacePlaceholder)(commandOptions.projectName, commandOptions.verbose);
|
|
25
|
+
(0, addProjectNameToUserDictionary_1.addProjectNameToUserDictionary)(commandOptions.projectName);
|
|
24
26
|
(0, createInitialGitCommit_1.createInitialGitCommit)(commandOptions.verbose);
|
|
25
27
|
if (commandOptions.install) {
|
|
26
28
|
const spinner = (0, nanospinner_1.createSpinner)("Installing project...").spin();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isValidNodeVersion = isValidNodeVersion;
|
|
4
|
-
function
|
|
4
|
+
function isNodeVersionGreaterThan22() {
|
|
5
5
|
const [major] = process.versions.node.split(".").map(Number);
|
|
6
|
-
return major >=
|
|
6
|
+
return major >= 22;
|
|
7
7
|
}
|
|
8
8
|
function isValidNodeVersion() {
|
|
9
|
-
return
|
|
9
|
+
return isNodeVersionGreaterThan22();
|
|
10
10
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comet/create-app",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.81.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": {
|
|
@@ -32,25 +32,29 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"commander": "^12.1.0",
|
|
35
|
-
"eslint": "^
|
|
35
|
+
"eslint": "^9.18.0",
|
|
36
36
|
"glob": "^11.0.1",
|
|
37
37
|
"kleur": "^4.1.5",
|
|
38
38
|
"nanospinner": "^1.2.2",
|
|
39
39
|
"rimraf": "^6.0.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@comet/eslint-config": "^
|
|
43
|
-
"@comet/eslint-plugin": "^
|
|
42
|
+
"@comet/eslint-config": "^8.0.0-beta.3",
|
|
43
|
+
"@comet/eslint-plugin": "^8.0.0-beta.3",
|
|
44
44
|
"@cspell/eslint-plugin": "^8.17.5",
|
|
45
|
-
"@tsconfig/
|
|
45
|
+
"@tsconfig/node22": "^22.0.1",
|
|
46
46
|
"@types/node": "^22.13.10",
|
|
47
47
|
"cspell": "^8.17.5",
|
|
48
48
|
"npm-run-all2": "^7.0.2",
|
|
49
|
-
"prettier": "^
|
|
50
|
-
"typescript": "5.8.2"
|
|
49
|
+
"prettier": "^3.5.3",
|
|
50
|
+
"typescript": "5.8.2",
|
|
51
|
+
"eslint-plugin-package-json": "0.26.3"
|
|
51
52
|
},
|
|
52
53
|
"publishConfig": {
|
|
53
54
|
"access": "public",
|
|
54
55
|
"registry": "https://registry.npmjs.org"
|
|
56
|
+
},
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": "22"
|
|
55
59
|
}
|
|
56
60
|
}
|