@emulsify/cli 1.4.0 → 1.5.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
@@ -44,3 +44,7 @@ Emulsify-cli is developed using TypeScript. You can find all of the source files
44
44
  - `npm run test`: runs Jest on the codebase. You can specify a path to a single test, and add any flags supported by Jest's CLI.
45
45
  - `npm run type`: uses typescript to check all type signatures.
46
46
  - `npm run twatch`: runs Jest without coverage, in verbose and watch mode. This is useful for running a single test during active development.
47
+
48
+ ## Deployment
49
+
50
+ This project is automatically built and deployed to NPM via a GitHub Actions workflow. In order to deploy changes merged into the `develop` branch, simply merge `develop` into `main`, and call it a day.
@@ -21,14 +21,14 @@ const git = (0, simple_git_1.default)();
21
21
  function init(progress) {
22
22
  return async (name, targetDirectory, options) => {
23
23
  const { name: autoPlatformName, emulsifyParentDirectory } = (await (0, getPlatformInfo_1.default)()) || {};
24
- const platformName = (options === null || options === void 0 ? void 0 : options.platform) || autoPlatformName;
24
+ const platformName = ((options === null || options === void 0 ? void 0 : options.platform) || autoPlatformName);
25
25
  if (!platformName) {
26
26
  return (0, log_1.default)('error', 'Unable to determine which platform you are installing Emulsify within. Please specify a platform (such as "drupal" or "wordpress") by passing a -p or --platform flag with your init command.', constants_2.EXIT_ERROR);
27
27
  }
28
28
  progress.tick(10, {
29
29
  message: `using starter for ${platformName}, validating config`,
30
30
  });
31
- const machineName = (options === null || options === void 0 ? void 0 : options.machineName) || (0, strToMachineName_1.default)(name);
31
+ const machineName = (options === null || options === void 0 ? void 0 : options.machineName) || (0, strToMachineName_1.default)(name, platformName);
32
32
  const starters = (0, getAvailableStarters_1.default)();
33
33
  const starter = starters.find(ramda_1.default.propEq('platform')(platformName));
34
34
  const targetParent = targetDirectory || emulsifyParentDirectory;
@@ -125,6 +125,6 @@ async function systemInstall(name, options) {
125
125
  catch (e) {
126
126
  return (0, log_1.default)('error', `Unable to install system assets and/or required components: ${ramda_1.default.toString(e)}`, constants_1.EXIT_ERROR);
127
127
  }
128
- return (0, log_1.default)('success', `Successfully installed the ${systemConf.name} system using the ${variantConf.platform} variant.`, constants_1.EXIT_ERROR);
128
+ return (0, log_1.default)('success', `Successfully installed the ${systemConf.name} system using the ${variantConf.platform} variant.`, constants_1.EXIT_SUCCESS);
129
129
  }
130
130
  exports.default = systemInstall;
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CACHE_DIR = exports.UTIL_DIR = exports.EMULSIFY_SYSTEM_CONFIG_FILE = exports.EMULSIFY_PROJECT_HOOK_SYSTEM_INSTALL = exports.EMULSIFY_PROJECT_HOOK_INIT = exports.EMULSIFY_PROJECT_HOOK_FOLDER = exports.EMULSIFY_PROJECT_CONFIG_FILE = exports.EXIT_ERROR = void 0;
3
+ exports.CACHE_DIR = exports.UTIL_DIR = exports.EMULSIFY_SYSTEM_CONFIG_FILE = exports.EMULSIFY_PROJECT_HOOK_SYSTEM_INSTALL = exports.EMULSIFY_PROJECT_HOOK_INIT = exports.EMULSIFY_PROJECT_HOOK_FOLDER = exports.EMULSIFY_PROJECT_CONFIG_FILE = exports.EXIT_SUCCESS = exports.EXIT_ERROR = void 0;
4
4
  const os_1 = require("os");
5
5
  const path_1 = require("path");
6
6
  exports.EXIT_ERROR = 1;
7
+ exports.EXIT_SUCCESS = 0;
7
8
  exports.EMULSIFY_PROJECT_CONFIG_FILE = 'project.emulsify.json';
8
9
  exports.EMULSIFY_PROJECT_HOOK_FOLDER = '.cli';
9
10
  exports.EMULSIFY_PROJECT_HOOK_INIT = 'init.js';
@@ -18,9 +18,9 @@
18
18
  "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw=="
19
19
  },
20
20
  "node_modules/@types/node": {
21
- "version": "14.18.0",
22
- "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.0.tgz",
23
- "integrity": "sha512-0GeIl2kmVMXEnx8tg1SlG6Gg8vkqirrW752KqolYo1PHevhhZN3bhJ67qHj+bQaINhX0Ra3TlWwRvMCd9iEfNQ=="
21
+ "version": "14.18.2",
22
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.2.tgz",
23
+ "integrity": "sha512-fqtSN5xn/bBzDxMT77C1rJg6CsH/R49E7qsGuvdPJa20HtV5zSTuLJPNfnlyVH3wauKnkHdLggTVkOW/xP9oQg=="
24
24
  },
25
25
  "node_modules/@types/progress": {
26
26
  "version": "2.0.5",
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v14.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Fri, 03 Dec 2021 12:31:02 GMT
11
+ * Last updated: Mon, 20 Dec 2021 23:01:23 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
14
14
 
@@ -237,7 +237,7 @@ declare module 'http' {
237
237
  constructor();
238
238
 
239
239
  setTimeout(msecs: number, callback?: () => void): this;
240
- setHeader(name: string, value: number | string | ReadonlyArray<string>): void;
240
+ setHeader(name: string, value: number | string | ReadonlyArray<string>): this;
241
241
  getHeader(name: string): number | string | string[] | undefined;
242
242
  getHeaders(): OutgoingHttpHeaders;
243
243
  getHeaderNames(): string[];
@@ -594,7 +594,7 @@ declare module 'http2' {
594
594
  readonly socket: net.Socket | tls.TLSSocket;
595
595
  readonly stream: ServerHttp2Stream;
596
596
  readonly trailers: IncomingHttpHeaders;
597
- readonly url: string;
597
+ url: string;
598
598
 
599
599
  setTimeout(msecs: number, callback?: () => void): void;
600
600
  read(size?: number): Buffer | string | null;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "14.18.0",
3
+ "version": "14.18.2",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -225,6 +225,6 @@
225
225
  },
226
226
  "scripts": {},
227
227
  "dependencies": {},
228
- "typesPublisherContentHash": "eae258c4cd666e101533e7968dec84fffca2b8844f142c4961eaed8caf8abe04",
228
+ "typesPublisherContentHash": "50b06853f2437862aaea36f3eb63de3623c57335209ea78eff60440c72a15b5c",
229
229
  "typeScriptVersion": "3.8"
230
230
  }
package/dist/package.json CHANGED
@@ -37,10 +37,10 @@
37
37
  "postbuild": "cp package.json dist/package.json && cd dist && npm install --only=production --ignore-scripts"
38
38
  },
39
39
  "devDependencies": {
40
- "@commitlint/cli": "^11.0.0",
40
+ "@commitlint/cli": "^15.0.0",
41
41
  "@commitlint/config-conventional": "^11.0.0",
42
- "@semantic-release/github": "^7.2.0",
43
- "@semantic-release/npm": "^7.1.3",
42
+ "@semantic-release/github": "^8.0.2",
43
+ "@semantic-release/npm": "^8.0.3",
44
44
  "@types/chalk": "^2.2.0",
45
45
  "@types/commander": "^2.12.2",
46
46
  "@types/fs-extra": "^9.0.8",
@@ -51,17 +51,17 @@
51
51
  "@typescript-eslint/parser": "^4.15.0",
52
52
  "eslint": "^7.19.0",
53
53
  "eslint-config-prettier": "^7.2.0",
54
- "eslint-plugin-prettier": "^3.3.1",
54
+ "eslint-plugin-prettier": "^4.0.0",
55
55
  "eslint-plugin-security": "^1.4.0",
56
56
  "husky": "^5.0.9",
57
57
  "jest": "^26.6.3",
58
58
  "json-schema-to-typescript": "^10.1.3",
59
- "lint-staged": "^10.5.4",
59
+ "lint-staged": "^12.1.2",
60
60
  "nodemon": "^2.0.7",
61
61
  "prettier": "^2.2.1",
62
- "semantic-release": "^17.3.8",
62
+ "semantic-release": "^18.0.1",
63
63
  "ts-jest": "^26.5.1",
64
- "ts-node": "^9.1.1",
64
+ "ts-node": "^10.4.0",
65
65
  "typescript": "^4.5.2"
66
66
  },
67
67
  "dependencies": {
@@ -11,19 +11,13 @@ function cloneIntoCache(bucket, itemPath) {
11
11
  return async ({ repository, checkout }) => {
12
12
  const destination = (0, getCachedItemPath_1.default)(bucket, itemPath);
13
13
  const parentDir = (0, path_1.dirname)(destination);
14
- let git = (0, simple_git_1.default)();
15
14
  if ((0, fs_1.existsSync)(destination)) {
16
- if (checkout) {
17
- git = (0, simple_git_1.default)(destination);
18
- await git.fetch();
19
- await git.checkout(checkout);
20
- await git.pull();
21
- }
22
15
  return;
23
16
  }
24
17
  if (!(0, fs_1.existsSync)(parentDir)) {
25
18
  await fs_1.promises.mkdir(parentDir, { recursive: true });
26
19
  }
20
+ const git = (0, simple_git_1.default)();
27
21
  await git.clone(repository, destination, checkout
28
22
  ? {
29
23
  '--branch': checkout,
@@ -6,7 +6,7 @@ function getAvailableStarters() {
6
6
  platform: 'drupal',
7
7
  platformMajorVersion: 9,
8
8
  repository: 'https://github.com/emulsify-ds/emulsify-drupal.git',
9
- checkout: 'cli',
9
+ checkout: 'master',
10
10
  },
11
11
  ];
12
12
  }
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- function strToMachineName(str) {
3
+ exports.getMachineNameSpaceReplacement = void 0;
4
+ const getMachineNameSpaceReplacement = (platform) => (platform === 'drupal' ? '_' : '-');
5
+ exports.getMachineNameSpaceReplacement = getMachineNameSpaceReplacement;
6
+ function strToMachineName(str, platform) {
4
7
  return (str
5
8
  .replace(/[^A-Za-z0-9 ]/g, '')
6
9
  .replace(/\s{2,}/g, ' ')
7
- .replace(/\s/g, '-')
10
+ .replace(/\s/g, (0, exports.getMachineNameSpaceReplacement)(platform))
8
11
  .toLowerCase());
9
12
  }
10
13
  exports.default = strToMachineName;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emulsify/cli",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Command line interface for Emulsify",
5
5
  "repository": "git@github.com:emulsify-ds/emulsify-cli.git",
6
6
  "author": "Patrick Coffey <patrickcoffey48@gmail.com>",
@@ -37,10 +37,10 @@
37
37
  "postbuild": "cp package.json dist/package.json && cd dist && npm install --only=production --ignore-scripts"
38
38
  },
39
39
  "devDependencies": {
40
- "@commitlint/cli": "^11.0.0",
40
+ "@commitlint/cli": "^15.0.0",
41
41
  "@commitlint/config-conventional": "^11.0.0",
42
- "@semantic-release/github": "^7.2.0",
43
- "@semantic-release/npm": "^7.1.3",
42
+ "@semantic-release/github": "^8.0.2",
43
+ "@semantic-release/npm": "^8.0.3",
44
44
  "@types/chalk": "^2.2.0",
45
45
  "@types/commander": "^2.12.2",
46
46
  "@types/fs-extra": "^9.0.8",
@@ -51,17 +51,17 @@
51
51
  "@typescript-eslint/parser": "^4.15.0",
52
52
  "eslint": "^7.19.0",
53
53
  "eslint-config-prettier": "^7.2.0",
54
- "eslint-plugin-prettier": "^3.3.1",
54
+ "eslint-plugin-prettier": "^4.0.0",
55
55
  "eslint-plugin-security": "^1.4.0",
56
56
  "husky": "^5.0.9",
57
57
  "jest": "^26.6.3",
58
58
  "json-schema-to-typescript": "^10.1.3",
59
- "lint-staged": "^10.5.4",
59
+ "lint-staged": "^12.1.2",
60
60
  "nodemon": "^2.0.7",
61
61
  "prettier": "^2.2.1",
62
- "semantic-release": "^17.3.8",
62
+ "semantic-release": "^18.0.1",
63
63
  "ts-jest": "^26.5.1",
64
- "ts-node": "^9.1.1",
64
+ "ts-node": "^10.4.0",
65
65
  "typescript": "^4.5.2"
66
66
  },
67
67
  "dependencies": {