@atomicsmash/cli 9.0.0-beta.5 → 9.0.0-beta.7

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.
@@ -4,6 +4,7 @@ import type { ArgumentsCamelCase } from "yargs";
4
4
  import webpack from "webpack";
5
5
  export declare const command = "blocks";
6
6
  export declare const describe = "A command to generate WordPress blocks from a src folder.";
7
+ export declare const deprecated = "Please migrate to using the @atomicsmash/compiler package. This command will be removed in the next major version.";
7
8
  export declare const builder: (yargs: YargsInstance) => import("yargs").Argv<import("yargs").Omit<{}, "in" | "out" | "tsConfigPath" | "postcssConfigPath" | "watch" | "excludeBlocks" | "excludeRootFiles" | "alwaysCompileRootFiles" | "ignoreWarnings"> & import("yargs").InferredOptionTypes<{
8
9
  in: {
9
10
  string: true;
@@ -1 +1 @@
1
- {"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../src/commands/blocks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAIjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAwBhD,OAAO,OAAO,MAAM,SAAS,CAAC;AAM9B,eAAO,MAAM,OAAO,WAAW,CAAC;AAChC,eAAO,MAAM,QAAQ,8DACuC,CAAC;AAC7D,eAAO,MAAM,OAAO,GAAa,OAAO,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0ClC,MAAM,EAAE;;;;;;;;;;;;;GAqB1B,CAAC;AAEF,wBAAsB,OAAO,CAC5B,IAAI,EAAE,kBAAkB,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,iBA4CrE;AAkJD,wBAAsB,wBAAwB,CAAC,EAC9C,SAAS,EACT,gBAAgB,GAChB,EAAE;IACF,SAAS,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CAAC,iBA4CrE;AAqJD,wBAAsB,wBAAwB,CAAC,EAC9C,SAAS,EACT,gBAAgB,GAChB,EAAE;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC3B,gCAmCA;AAED,wBAAgB,yBAAyB,CAAC,EACzC,SAAS,EACT,MAAM,GACN,EAAE;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CACb,MAAM,EACN;QACC,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,SAAS,CAAC;KACrB,CACD,CAAC;CACF,uBAkCA;AAED,KAAK,SAAS,GAAG,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAE7C,wBAAsB,iBAAiB,CACtC,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EAAE;iBAUqB,MAAM;eAAa,SAAS;IAuBxE;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,SAAS,6EAW5D;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,0EAW3D"}
@@ -20,6 +20,7 @@ import { getSmashConfig, startRunningMessage, toCamelCase } from "../utils.js";
20
20
  const isProduction = process.env.NODE_ENV === "production";
21
21
  export const command = "blocks";
22
22
  export const describe = "A command to generate WordPress blocks from a src folder.";
23
+ export const deprecated = "Please migrate to using the @atomicsmash/compiler package. This command will be removed in the next major version.";
23
24
  export const builder = function (yargs) {
24
25
  return yargs
25
26
  .options({
@@ -165,6 +166,7 @@ async function runCommand({ srcFolder, distFolder, tsConfigLocation, postcssConf
165
166
  node: { global: false },
166
167
  });
167
168
  if (isWatch) {
169
+ console.log("The blocks command is now deprecated. " + deprecated);
168
170
  const watching = compiler.watch({
169
171
  // Example
170
172
  aggregateTimeout: 300,
@@ -189,6 +191,7 @@ async function runCommand({ srcFolder, distFolder, tsConfigLocation, postcssConf
189
191
  });
190
192
  process.on("SIGINT", function () {
191
193
  watching.close((closeError) => {
194
+ console.log("The blocks command is now deprecated. " + deprecated);
192
195
  console.error(closeError);
193
196
  });
194
197
  });
@@ -216,6 +219,7 @@ async function runCommand({ srcFolder, distFolder, tsConfigLocation, postcssConf
216
219
  }
217
220
  }
218
221
  compiler.close((closeError) => {
222
+ console.log("The blocks command is now deprecated. " + deprecated);
219
223
  if (closeError) {
220
224
  process.exitCode = 1;
221
225
  }
@@ -32,7 +32,7 @@ export async function handler() {
32
32
  throw new Error("STAGING_URL is missing from .env file.");
33
33
  }
34
34
  else {
35
- const { themeName } = smashConfig;
35
+ const { projectName } = smashConfig;
36
36
  const stopRunningMessage = startRunningMessage("Pulling database from staging");
37
37
  performance.mark("Start");
38
38
  await (async () => {
@@ -50,7 +50,7 @@ export async function handler() {
50
50
  });
51
51
  const rl = readline.createInterface({ input: readStream });
52
52
  rl.on("line", (line) => {
53
- writeStream.write(line.replaceAll(stagingUrl, `//${themeName}.test`) + "\n");
53
+ writeStream.write(line.replaceAll(stagingUrl, `//${projectName}.test`) + "\n");
54
54
  });
55
55
  rl.on("close", () => {
56
56
  writeStream.end();
@@ -16,12 +16,12 @@ export async function handler() {
16
16
  throw new Error("Unable to determine project setup information. Please add a smash.config.ts file with the required info.");
17
17
  }
18
18
  else {
19
- const { themeName } = smashConfig;
19
+ const { projectName, themeFolderName } = smashConfig;
20
20
  const stopRunningMessage = startRunningMessage("Initialising database");
21
21
  performance.mark("Start");
22
22
  await execute("wp db create")
23
23
  .then(() => {
24
- return execute(`wp core install --url=http://${process.env.CI ? "127.0.0.1" : `${themeName}.test`}/ --title=Temp --admin_user=Bot --admin_email=fake@fake.com --admin_password=password`);
24
+ return execute(`wp core install --url=http://${process.env.CI ? "127.0.0.1" : `${projectName}.test`}/ --title=Temp --admin_user=Bot --admin_email=fake@fake.com --admin_password=password`);
25
25
  })
26
26
  .then(() => {
27
27
  performance.mark("wordpress-tables");
@@ -40,7 +40,7 @@ export async function handler() {
40
40
  .then(() => {
41
41
  performance.mark("plugins");
42
42
  console.log(`Plugins activated. (${convertMeasureToPrettyString(performance.measure("plugins", addCustomUser ? "add-custom-user" : "wordpress-tables"))})`);
43
- return execute(`wp theme activate ${themeName}`);
43
+ return execute(`wp theme activate ${themeFolderName}`);
44
44
  })
45
45
  .then(async () => {
46
46
  performance.mark("theme");
@@ -1 +1 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/commands/setup.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,OAAO,UAAU,CAAC;AAC/B,eAAO,MAAM,QAAQ,kDAAkD,CAAC;AACxE,wBAAsB,OAAO,kBAiM5B"}
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/commands/setup.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,OAAO,UAAU,CAAC;AAC/B,eAAO,MAAM,QAAQ,kDAAkD,CAAC;AACxE,wBAAsB,OAAO,kBAkM5B"}
@@ -22,7 +22,7 @@ export async function handler() {
22
22
  throw new Error("Unable to determine project setup information. Please add a smash.config.ts file with the required info.");
23
23
  }
24
24
  else {
25
- const { themeName, composerInstallPaths, npmInstallPaths } = smashConfig;
25
+ const { projectName, composerInstallPaths, npmInstallPaths } = smashConfig;
26
26
  const stopRunningMessage = startRunningMessage("Running setup");
27
27
  performance.mark("Start");
28
28
  await Promise.allSettled([
@@ -44,7 +44,8 @@ export async function handler() {
44
44
  throw new Error("Failed to copy .env file.");
45
45
  }),
46
46
  (async () => {
47
- if (existsSync(resolve(process.cwd(), "herd.yml")) &&
47
+ if ((existsSync(resolve(process.cwd(), "herd.yaml")) ||
48
+ existsSync(resolve(process.cwd(), "herd.yml"))) &&
48
49
  (await execute(`herd --version`)
49
50
  .then(() => true)
50
51
  .catch(() => false))) {
@@ -60,7 +61,7 @@ export async function handler() {
60
61
  else if (await execute(`valet --version`)
61
62
  .then(() => true)
62
63
  .catch(() => false)) {
63
- await execute(`valet link ${themeName} --secure --isolate`)
64
+ await execute(`valet link ${projectName} --secure --isolate`)
64
65
  .then(() => {
65
66
  console.log(`Valet is linked, secured and isolated. (${convertMeasureToPrettyString(performance.measure("herd-or-valet", "Start"))})`);
66
67
  })
package/dist/index.d.ts CHANGED
@@ -4,8 +4,9 @@ export type SCSSAliases = {
4
4
  importers?: Options<"async">["importers"];
5
5
  };
6
6
  export type SmashConfig = {
7
- themeName: string;
7
+ projectName: string;
8
8
  themePath: string;
9
+ themeFolderName?: string;
9
10
  assetsOutputFolder?: string;
10
11
  npmInstallPaths?: string[];
11
12
  composerInstallPaths?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,MAAM,MAAM,WAAW,GAAG;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,WAAW,CAAC,EAAE,WAAW,CAAC;CAC1B,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,MAAM,MAAM,WAAW,GAAG;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,WAAW,CAAC,EAAE,WAAW,CAAC;CAC1B,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
package/dist/utils.d.ts CHANGED
@@ -19,8 +19,9 @@ export declare function getSmashConfig(): Promise<Required<SmashConfig> | {
19
19
  npmInstallPaths: string[];
20
20
  composerInstallPaths: string[];
21
21
  assetsOutputFolder: string;
22
- themeName: string;
22
+ projectName: string;
23
23
  themePath: string;
24
+ themeFolderName: string;
24
25
  scssAliases: SCSSAliases;
25
26
  } | null>;
26
27
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAQ7C,eAAO,MAAM,WAAW,EAAiC,WAAW,CAAC;AAIrE,eAAO,MAAM,WAAW,QAA6D,CAAC;AAItF,eAAO,MAAM,cAAc,QAAsB,CAAC;AAElD,wBAAsB,OAAO,CAC5B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAqB;WAGtC,aAAa,GAAG,IAAI;YACnB,MAAM;YACN,MAAM;GAaf;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,UAQvC;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,kBAAkB,UAevE;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,uBAiClD;AAyBD,wBAAsB,cAAc;;;;;;;UAiEnC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAQ7C,eAAO,MAAM,WAAW,EAAiC,WAAW,CAAC;AAIrE,eAAO,MAAM,WAAW,QAA6D,CAAC;AAItF,eAAO,MAAM,cAAc,QAAsB,CAAC;AAElD,wBAAsB,OAAO,CAC5B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAqB;WAGtC,aAAa,GAAG,IAAI;YACnB,MAAM;YACN,MAAM;GAaf;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,UAQvC;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,kBAAkB,UAevE;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,uBAiClD;AAyBD,wBAAsB,cAAc;;;;;;;;UAmEnC"}
package/dist/utils.js CHANGED
@@ -116,6 +116,7 @@ export async function getSmashConfig() {
116
116
  if (isValidSmashConfig(config)) {
117
117
  return {
118
118
  scssAliases: getDefaultSCSSAliases(config.themePath),
119
+ themeFolderName: config.projectName,
119
120
  ...config,
120
121
  // Normalize and resolve paths to cwd.
121
122
  npmInstallPaths: config.npmInstallPaths?.map((path) => {
@@ -153,8 +154,9 @@ export async function getSmashConfig() {
153
154
  }
154
155
  console.warn("Using env vars for theme name and path is deprecated and will be removed in a future version. Create a smash.config.ts file with the relevant properties in it instead.");
155
156
  const defaultConfig = {
156
- themeName,
157
+ projectName: themeName,
157
158
  themePath,
159
+ themeFolderName: themeName,
158
160
  assetsOutputFolder: "dist",
159
161
  npmInstallPaths: [],
160
162
  composerInstallPaths: [],
@@ -167,8 +169,8 @@ export async function getSmashConfig() {
167
169
  function isValidSmashConfig(config) {
168
170
  return (typeof config === "object" &&
169
171
  config !== null &&
170
- "themeName" in config &&
171
- typeof config.themeName === "string" &&
172
+ "projectName" in config &&
173
+ typeof config.projectName === "string" &&
172
174
  "themePath" in config &&
173
175
  typeof config.themePath === "string");
174
176
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomicsmash/cli",
3
- "version": "9.0.0-beta.5",
3
+ "version": "9.0.0-beta.7",
4
4
  "description": "A collection of CLI tools by Atomic Smash.",
5
5
  "keywords": [],
6
6
  "homepage": "https://www.atomicsmash.co.uk/",