@stratawp/cli 2.1.0 → 2.1.1
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/dist/chunk-YCJH2PCK.js +15 -0
- package/dist/create.js +4 -4
- package/dist/index.js +4 -1
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/version.ts
|
|
4
|
+
import { readFileSync } from "fs";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
6
|
+
import { dirname, join } from "path";
|
|
7
|
+
function getCliVersion() {
|
|
8
|
+
const packageJsonPath = join(dirname(fileURLToPath(import.meta.url)), "..", "package.json");
|
|
9
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
10
|
+
return packageJson.version;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
getCliVersion
|
|
15
|
+
};
|
package/dist/create.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
getCliVersion
|
|
4
|
+
} from "./chunk-YCJH2PCK.js";
|
|
2
5
|
|
|
3
6
|
// src/create.ts
|
|
4
7
|
import prompts from "prompts";
|
|
@@ -360,9 +363,6 @@ async function detectWordPressSites() {
|
|
|
360
363
|
return sites;
|
|
361
364
|
}
|
|
362
365
|
async function createBasicStructure(themePath, config) {
|
|
363
|
-
const __filename2 = fileURLToPath2(import.meta.url);
|
|
364
|
-
const __dirname2 = dirname2(__filename2);
|
|
365
|
-
const cliPackageJson = await fs3.readJson(path3.join(__dirname2, "..", "package.json"));
|
|
366
366
|
const packageJson = {
|
|
367
367
|
name: config.slug,
|
|
368
368
|
version: "1.0.0",
|
|
@@ -390,7 +390,7 @@ async function createBasicStructure(themePath, config) {
|
|
|
390
390
|
typescript: config.typescript ? "^5.3.3" : void 0
|
|
391
391
|
},
|
|
392
392
|
stratawp: {
|
|
393
|
-
createdWith:
|
|
393
|
+
createdWith: getCliVersion(),
|
|
394
394
|
template: config.template,
|
|
395
395
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
396
396
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
getCliVersion
|
|
4
|
+
} from "./chunk-YCJH2PCK.js";
|
|
2
5
|
import {
|
|
3
6
|
generateBlock,
|
|
4
7
|
generateComponent,
|
|
@@ -3756,7 +3759,7 @@ async function iconsListCommand() {
|
|
|
3756
3759
|
|
|
3757
3760
|
// src/index.ts
|
|
3758
3761
|
var program = new Command();
|
|
3759
|
-
program.name("stratawp").description("\u26A1 A modern WordPress theme framework").version(
|
|
3762
|
+
program.name("stratawp").description("\u26A1 A modern WordPress theme framework").version(getCliVersion());
|
|
3760
3763
|
program.command("dev").description("Start development server with hot reload").option("-p, --port <port>", "Port number", "3000").option("-h, --host <host>", "Host address", "localhost").action(devCommand);
|
|
3761
3764
|
program.command("build").description("Build theme for production").option("--analyze", "Analyze bundle size").action(buildCommand);
|
|
3762
3765
|
program.command("block:new <name>").description("Create a new Gutenberg block (dynamic, server-rendered via render.php)").option("--category <category>", "Block category", "common").option("--styleFramework <framework>", "Style framework (none|tailwind|unocss)", "none").action(blockCommand);
|