create-spfx-tailwind-app 1.0.14 โ 1.0.17
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 +4 -4
- package/index.js +25 -25
- package/package.json +2 -2
package/Readme.md
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
npx create-spfx-tailwind-app MyProject
|
|
7
7
|
|
|
8
|
-

|
|
9
|
+

|
|
10
|
+

|
|
11
11
|

|
|
12
12
|
|
|
13
13
|
A modern CLI tool to scaffold **SharePoint Framework (SPFx)** projects
|
|
@@ -40,7 +40,7 @@ npx create-spfx-tailwind-app MyProject
|
|
|
40
40
|
|
|
41
41
|
``` bash
|
|
42
42
|
npm install -g create-spfx-tailwind-app
|
|
43
|
-
create-spfx-app MyProject
|
|
43
|
+
create-spfx-tailwind-app MyProject
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
------------------------------------------------------------------------
|
package/index.js
CHANGED
|
@@ -8,11 +8,6 @@ const ora = require("ora");
|
|
|
8
8
|
const inquirer = require("inquirer");
|
|
9
9
|
const figlet = require("figlet");
|
|
10
10
|
const gradient = require("gradient-string").default;
|
|
11
|
-
const setupPath = path.join(targetDir, "setup.js");
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
// ๐จ Banner
|
|
15
|
-
|
|
16
11
|
|
|
17
12
|
console.log(
|
|
18
13
|
gradient.instagram(figlet.textSync("SPFx CLI", { horizontalLayout: "full" })),
|
|
@@ -21,11 +16,8 @@ console.log(
|
|
|
21
16
|
async function run() {
|
|
22
17
|
try {
|
|
23
18
|
const args = process.argv.slice(2);
|
|
24
|
-
|
|
25
|
-
// ๐น detect flags
|
|
26
19
|
const noInstallFlag = args.includes("--no-install");
|
|
27
20
|
|
|
28
|
-
// ๐น get project name
|
|
29
21
|
let projectName = args.find((arg) => !arg.startsWith("--"));
|
|
30
22
|
|
|
31
23
|
if (!projectName) {
|
|
@@ -47,6 +39,7 @@ async function run() {
|
|
|
47
39
|
|
|
48
40
|
const templateDir = path.join(__dirname, "Template");
|
|
49
41
|
const targetDir = path.join(process.cwd(), projectName);
|
|
42
|
+
const setupPath = path.join(targetDir, "setup.js");
|
|
50
43
|
|
|
51
44
|
console.log(chalk.cyan("\n๐ Creating your SPFx project...\n"));
|
|
52
45
|
|
|
@@ -55,24 +48,39 @@ async function run() {
|
|
|
55
48
|
// ๐ Copy template
|
|
56
49
|
fs.cpSync(templateDir, targetDir, { recursive: true });
|
|
57
50
|
|
|
58
|
-
spinner.text = "
|
|
51
|
+
spinner.text = "Running setup...";
|
|
52
|
+
|
|
53
|
+
// โ Run setup.js if exists
|
|
54
|
+
if (fs.existsSync(setupPath)) {
|
|
55
|
+
execSync(`node setup.js "${projectName}"`, {
|
|
56
|
+
cwd: targetDir,
|
|
57
|
+
stdio: "inherit",
|
|
58
|
+
});
|
|
59
|
+
}
|
|
59
60
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
spinner.text = "Cleaning up...";
|
|
62
|
+
|
|
63
|
+
// ๐งน Remove setup.js after execution
|
|
64
|
+
try {
|
|
65
|
+
if (fs.existsSync(setupPath)) {
|
|
66
|
+
fs.unlinkSync(setupPath);
|
|
67
|
+
// optional log
|
|
68
|
+
// console.log(chalk.gray("๐งน setup.js removed"));
|
|
69
|
+
}
|
|
70
|
+
} catch (err) {
|
|
71
|
+
console.log(chalk.yellow("โ ๏ธ Could not remove setup.js"));
|
|
72
|
+
}
|
|
65
73
|
|
|
66
74
|
spinner.succeed(chalk.green("โ Project setup complete"));
|
|
67
75
|
|
|
68
|
-
// ๐ detect Tailwind
|
|
76
|
+
// ๐ detect Tailwind
|
|
69
77
|
let hasTailwind = false;
|
|
70
78
|
try {
|
|
71
79
|
const pkg = require(path.join(targetDir, "package.json"));
|
|
72
80
|
hasTailwind = !!pkg.scripts?.["build:tailwind"];
|
|
73
81
|
} catch {}
|
|
74
82
|
|
|
75
|
-
// โ Ask install
|
|
83
|
+
// โ Ask install
|
|
76
84
|
let install = true;
|
|
77
85
|
|
|
78
86
|
if (noInstallFlag) {
|
|
@@ -105,7 +113,7 @@ async function run() {
|
|
|
105
113
|
}
|
|
106
114
|
}
|
|
107
115
|
|
|
108
|
-
// ๐
|
|
116
|
+
// ๐ Done
|
|
109
117
|
console.log("\n" + chalk.bold.green("๐ Project created successfully!\n"));
|
|
110
118
|
|
|
111
119
|
console.log(chalk.yellow("๐ Next steps:"));
|
|
@@ -129,14 +137,6 @@ async function run() {
|
|
|
129
137
|
}
|
|
130
138
|
|
|
131
139
|
console.log("\n" + chalk.gray("Happy coding ๐\n"));
|
|
132
|
-
try {
|
|
133
|
-
if (fs.existsSync(setupPath)) {
|
|
134
|
-
fs.unlinkSync(setupPath);
|
|
135
|
-
// console.log(chalk.gray("๐งน setup.js removed"));
|
|
136
|
-
}
|
|
137
|
-
} catch (err) {
|
|
138
|
-
console.log(chalk.yellow("โ ๏ธ Could not remove setup.js"));
|
|
139
|
-
}
|
|
140
140
|
} catch (err) {
|
|
141
141
|
console.log(chalk.red("\nโ Something went wrong\n"));
|
|
142
142
|
console.error(err);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"engines": {
|
|
4
4
|
"node": ">=22"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.17",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"homepage": "https://github.com/deependrasingh002/create-spfx-tailwind-app.git",
|
|
32
32
|
"bin": {
|
|
33
|
-
"create-spfx-app": "./index.js"
|
|
33
|
+
"create-spfx-tailwind-app": "./index.js"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"chalk": "^4.1.2",
|