@raisenow/tamaro-cli 3.0.0-dev.1 → 3.0.0-dev.2

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.
Files changed (3) hide show
  1. package/README.md +36 -0
  2. package/dist/cli.js +66 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -36,6 +36,9 @@ Available commands:
36
36
  - [`unarchive`](#unarchive)
37
37
  - [`update-epms`](#update-epms)
38
38
  - [`validate`](#validate)
39
+ - [`typecheck`](#typecheck)
40
+ - [`lint`](#lint)
41
+ - [`format`](#format)
39
42
 
40
43
  ## `dev`
41
44
 
@@ -288,6 +291,39 @@ cd /path/to/tamaro-configurations/configs/epms-demo
288
291
  pnpx @raisenow/tamaro-cli validate
289
292
  ```
290
293
 
294
+ ## `typecheck`
295
+
296
+ Typecheck the current Tamaro configuration.
297
+
298
+ ### Example
299
+
300
+ ```bash
301
+ cd /path/to/tamaro-configurations/configs/epms-demo
302
+ pnpx @raisenow/tamaro-cli typecheck
303
+ ```
304
+
305
+ ## `lint`
306
+
307
+ Lint the current Tamaro configuration with ESLint.
308
+
309
+ ### Example
310
+
311
+ ```bash
312
+ cd /path/to/tamaro-configurations/configs/epms-demo
313
+ pnpx @raisenow/tamaro-cli lint
314
+ ```
315
+
316
+ ## `format`
317
+
318
+ Format the current Tamaro configuration with Prettier.
319
+
320
+ ### Example
321
+
322
+ ```bash
323
+ cd /path/to/tamaro-configurations/configs/epms-demo
324
+ pnpx @raisenow/tamaro-cli format
325
+ ```
326
+
291
327
  # Development
292
328
 
293
329
  Use the versions declared in `package.json`:
package/dist/cli.js CHANGED
@@ -1112,6 +1112,56 @@ const dev = async (options) => {
1112
1112
  });
1113
1113
  };
1114
1114
  //#endregion
1115
+ //#region src/commands/format.ts
1116
+ const format = () => {
1117
+ const configsPackageRoot = getConfigsPackageRoot();
1118
+ const relativeCwd = path.relative(configsPackageRoot, process.cwd());
1119
+ const cmd1 = "pnpm prettier --write . \"!configs/**\"";
1120
+ logTitle("Formatting root with Prettier...");
1121
+ logCommand(cmd1);
1122
+ runCommandSync(cmd1, {
1123
+ cwd: configsPackageRoot,
1124
+ shell: true,
1125
+ stdio: "inherit"
1126
+ });
1127
+ const cmd2 = `pnpm prettier --write ${relativeCwd}`;
1128
+ logTitle(`\nFormatting config folder "${relativeCwd}" with Prettier...`);
1129
+ logCommand(cmd2);
1130
+ runCommandSync(cmd2, {
1131
+ cwd: configsPackageRoot,
1132
+ shell: true,
1133
+ stdio: "inherit"
1134
+ });
1135
+ };
1136
+ //#endregion
1137
+ //#region src/commands/lint.ts
1138
+ const lint = () => {
1139
+ const configsPackageRoot = getConfigsPackageRoot();
1140
+ const relativeCwd = path.relative(configsPackageRoot, process.cwd());
1141
+ const env = {
1142
+ ...process.env,
1143
+ DEBUG: "eslint:eslint-helpers"
1144
+ };
1145
+ const cmd1 = "pnpm eslint --ignore-pattern \"configs/\" .";
1146
+ logTitle("Linting root with ESLint...");
1147
+ logCommand(cmd1);
1148
+ runCommandSync(cmd1, {
1149
+ cwd: configsPackageRoot,
1150
+ env,
1151
+ shell: true,
1152
+ stdio: "inherit"
1153
+ });
1154
+ const cmd2 = `pnpm eslint ${relativeCwd}`;
1155
+ logTitle(`\nLinting config folder "${relativeCwd}" with ESLint...`);
1156
+ logCommand(cmd2);
1157
+ runCommandSync(cmd2, {
1158
+ cwd: configsPackageRoot,
1159
+ env,
1160
+ shell: true,
1161
+ stdio: "inherit"
1162
+ });
1163
+ };
1164
+ //#endregion
1115
1165
  //#region src/commands/list-deployed.ts
1116
1166
  const listDeployed = async (options) => {
1117
1167
  const configName = getConfigName();
@@ -1151,6 +1201,18 @@ const assertOptionsValid$3 = (options) => {
1151
1201
  if (profile) assertProfileValid(profile);
1152
1202
  };
1153
1203
  //#endregion
1204
+ //#region src/commands/typecheck.ts
1205
+ const typecheck = () => {
1206
+ const configsPackageRoot = getConfigsPackageRoot();
1207
+ const cmd = `pnpm tsc --project ${path.relative(configsPackageRoot, process.cwd())}/tsconfig.json`;
1208
+ logTitle("Running TypeScript type-checking...");
1209
+ logCommand(cmd);
1210
+ runCommandSync(cmd, {
1211
+ cwd: configsPackageRoot,
1212
+ stdio: "inherit"
1213
+ });
1214
+ };
1215
+ //#endregion
1154
1216
  //#region src/commands/unarchive.ts
1155
1217
  const unarchive = async (options) => {
1156
1218
  assertIsArchived();
@@ -1345,7 +1407,7 @@ const promptBucketTamaroEmailConfig = async () => {
1345
1407
  //#endregion
1346
1408
  //#region package.json
1347
1409
  var name = "@raisenow/tamaro-cli";
1348
- var version = "3.0.0-dev.1";
1410
+ var version = "3.0.0-dev.2";
1349
1411
  //#endregion
1350
1412
  //#region src/cli.ts
1351
1413
  /**
@@ -1369,6 +1431,9 @@ cli.command("archive").description("Archive a customer configuration by moving i
1369
1431
  cli.command("unarchive").description("Unarchive a customer configuration by restoring it from the _archived folder").option("--profile <profile>", "AWS profile").option("--ci", "CI environment", false).option("--dryrun", "Displays the operations that would be performed without actually running them", false).option("--force-skip-epms-sync", "Skip EPMS unarchive sync (emergency use only)", false).action(unarchive);
1370
1432
  cli.command("update-epms").description("Update EPMS with the currently deployed widget tags.").option("--profile <profile>", "AWS profile").option("--ci", "CI environment", false).option("--dryrun", "Displays the operations that would be performed without actually running them", false).option("--tag <tag>", "Tag which should be set for the deployment", DEFAULT_TAG).action(updateEpms);
1371
1433
  cli.command("validate").description("Validate the current Tamaro configuration to avoid common errors").action(validate);
1434
+ cli.command("typecheck").description("Typecheck the current Tamaro configuration").action(typecheck);
1435
+ cli.command("lint").description("Lint the current Tamaro configuration with ESLint").action(lint);
1436
+ cli.command("format").description("Format the current Tamaro configuration with Prettier").action(format);
1372
1437
  try {
1373
1438
  logTitle(`${name} ${version}\n`);
1374
1439
  await cli.parseAsync(process.argv);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raisenow/tamaro-cli",
3
- "version": "3.0.0-dev.1",
3
+ "version": "3.0.0-dev.2",
4
4
  "author": {
5
5
  "name": "RaiseNow",
6
6
  "email": "development@raisenow.com"