@raisenow/tamaro-cli 1.2.0 → 1.4.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/.nvmrc +1 -1
- package/README.md +1 -0
- package/bitbucket-pipelines.yml +6 -2
- package/dist/{chunk-KVWFHWZD.js → chunk-H4BMVFM6.js} +2 -2
- package/dist/cli.js +186 -68
- package/dist/webpack.config.js +1 -1
- package/package.json +51 -46
- package/vitest.config.ts +20 -0
- package/.history/.eslintignore_20220609190420 +0 -4
- package/.history/.eslintignore_20230911190227 +0 -6
- package/.history/.eslintignore_20230911211247 +0 -7
- package/.history/.eslintignore_20230911211250 +0 -7
- package/.history/.eslintrc_20230911201601.js +0 -49
- package/.history/.eslintrc_20230911201643.js +0 -49
- package/.history/.eslintrc_20230911201735.js +0 -49
- package/.history/.eslintrc_20230911201913.js +0 -64
- package/.history/.eslintrc_20230911202002.js +0 -62
- package/.history/.eslintrc_20230911202138.js +0 -133
- package/.history/.eslintrc_20230911202140.js +0 -133
- package/.history/.eslintrc_20230911202145.js +0 -133
- package/.history/.eslintrc_20230911202147.js +0 -133
- package/.history/.eslintrc_20230911202406.js +0 -133
- package/.history/.eslintrc_20230911202447.js +0 -133
- package/.history/.eslintrc_20230911202453.js +0 -133
- package/.history/.eslintrc_20230911202511.js +0 -133
- package/.history/.eslintrc_20230911202527.js +0 -133
- package/.history/.eslintrc_20230911202639.js +0 -125
- package/.history/.eslintrc_20230911202721.js +0 -149
- package/.history/.eslintrc_20230911202746.js +0 -149
- package/.history/.eslintrc_20240423125702.cjs +0 -148
- package/.history/.gitignore_20220609190420 +0 -14
- package/.history/.gitignore_20230911185959 +0 -4
- package/.history/.gitignore_20230911190006 +0 -4
- package/.history/.gitignore_20230911190007 +0 -4
- package/.history/.nmprc_20241004144025 +0 -0
- package/.history/.nmprc_20241004144041 +0 -1
- package/.history/.npmrc_20241004144040 +0 -1
- package/.history/.npmrc_20241004144152 +0 -1
- package/.history/.npmrc_20241004145639 +0 -2
- package/.history/.npmrc_20241004145649 +0 -1
- package/.history/.nvmrc_20241125012803 +0 -1
- package/.history/.nvmrc_20241125022800 +0 -1
- package/.history/.nvmrc_20241125022806 +0 -1
- package/.history/.prettierignore_20220609190420 +0 -5
- package/.history/.prettierignore_20230911190242 +0 -7
- package/.history/.prettierignore_20230911190245 +0 -7
- package/.history/.prettierignore_20230911211301 +0 -8
- package/.history/CHANGELOG_20250624052910.md +0 -20
- package/.history/CHANGELOG_20250624055058.md +0 -23
- package/.history/CHANGELOG_20250624055107.md +0 -23
- package/.history/CHANGELOG_20250624055138.md +0 -23
- package/.history/CHANGELOG_20250624055156.md +0 -23
- package/.history/CHANGELOG_20250624055200.md +0 -23
- package/.history/CHANGELOG_20250624055203.md +0 -23
- package/.history/CHANGELOG_20250625142852.md +0 -25
- package/.history/CHANGELOG_20250625142901.md +0 -22
- package/.history/CHANGELOG_20250625142902.md +0 -22
- package/.history/README_20230911145033.md +0 -245
- package/.history/README_20230911151749.md +0 -245
- package/.history/README_20230911151844.md +0 -245
- package/.history/README_20230911153040.md +0 -245
- package/.history/README_20230911202959.md +0 -245
- package/.history/cli_20241005014539 +0 -3
- package/.history/cli_20241005014542 +0 -3
- package/.history/cli_20241005014848 +0 -3
- package/.history/dist/chunk-FICM3HUI_20230912183408.js +0 -302
- package/.history/dist/chunk-FICM3HUI_20230912201610.js +0 -302
- package/.history/package_20241107122123.json +0 -106
- package/.history/package_20241107122219.json +0 -106
- package/.history/package_20241107124611.json +0 -106
- package/.history/package_20241107125521.json +0 -106
- package/.history/package_20241107125538.json +0 -106
- package/.history/package_20241125013228.json +0 -106
- package/.history/package_20241125013249.json +0 -106
- package/.history/package_20241125014402.json +0 -105
- package/.history/package_20241125103106.json +0 -105
- package/.history/tsconfig_20241005001442.json +0 -34
- package/.history/tsconfig_20241005001500.json +0 -34
- package/.history/tsconfig_20241005001540.json +0 -34
- package/.history/tsconfig_20241005014429.json +0 -42
- package/.history/tsconfig_20241005014436.json +0 -42
- package/.history/tsconfig_20241005014439.json +0 -38
- package/.history/tsconfig_20241005014455.json +0 -38
- package/.history/tsconfig_20241005014521.json +0 -38
- package/.idea/codeStyles/Project.xml +0 -131
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/misc.xml +0 -17
- package/.idea/modules.xml +0 -8
- package/.idea/prettier.xml +0 -6
- package/.idea/tamaro-cli.iml +0 -12
- package/.idea/vcs.xml +0 -6
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
v22.
|
|
1
|
+
v22.17.1
|
package/README.md
CHANGED
|
@@ -112,6 +112,7 @@ Build an optimised (minified) bundle of _Tamaro Core_ or a customer configuratio
|
|
|
112
112
|
- `--env <env>` – Environment (dev, stage, prod)
|
|
113
113
|
- `--deploy` – Deploy _Tamaro Core_ or a customer configuration bundle to AWS S3
|
|
114
114
|
- `--tag <tag>` – Tag which should be used for the deployment of the bundle (default: "latest")
|
|
115
|
+
- `--dryrun` – Displays the operations that would be performed using the specified command without actually running them.
|
|
115
116
|
|
|
116
117
|
### Build and deploy a customer configuration
|
|
117
118
|
|
package/bitbucket-pipelines.yml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
image: node:
|
|
1
|
+
image: node:22
|
|
2
2
|
|
|
3
3
|
definitions:
|
|
4
4
|
caches:
|
|
@@ -35,7 +35,11 @@ definitions:
|
|
|
35
35
|
script:
|
|
36
36
|
- *initialize
|
|
37
37
|
- pnpm lint
|
|
38
|
-
- pnpm
|
|
38
|
+
- pnpm typecheck
|
|
39
|
+
- pnpm test
|
|
40
|
+
# Do not bother for dev deps
|
|
41
|
+
# @see https://raisenow.atlassian.net/wiki/spaces/PD/pages/5680037889/TP+RFC+014+-+Unsafe+Outdated+Libraries+Upgrades#Regular-upgrade-of-NPM-libraries-versions
|
|
42
|
+
- pnpm audit --audit-level=critical --prod
|
|
39
43
|
|
|
40
44
|
pipelines:
|
|
41
45
|
default:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// node_modules/.pnpm/tsup@8.
|
|
2
|
-
import { fileURLToPath } from "url";
|
|
1
|
+
// node_modules/.pnpm/tsup@8.5.0_jiti@1.21.0_postcss@8.5.6_tsx@4.19.1_typescript@5.8.3/node_modules/tsup/assets/esm_shims.js
|
|
3
2
|
import path from "path";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
4
|
var getFilename = () => fileURLToPath(import.meta.url);
|
|
5
5
|
var getDirname = () => path.dirname(getFilename());
|
|
6
6
|
var __dirname = /* @__PURE__ */ getDirname();
|
package/dist/cli.js
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
resolveBin,
|
|
23
23
|
resolveOwn,
|
|
24
24
|
runCommandSync
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-H4BMVFM6.js";
|
|
26
26
|
|
|
27
27
|
// src/cli.ts
|
|
28
28
|
import { createCommand } from "commander";
|
|
@@ -31,31 +31,121 @@ import { createCommand } from "commander";
|
|
|
31
31
|
import { glob } from "glob";
|
|
32
32
|
|
|
33
33
|
// src/lib/validators/validateEmailTemplates.ts
|
|
34
|
-
import fs from "
|
|
35
|
-
import
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
import fs from "fs";
|
|
35
|
+
import Handlebars from "handlebars";
|
|
36
|
+
import helpers from "handlebars-helpers";
|
|
37
|
+
helpers.comparison({
|
|
38
|
+
handlebars: Handlebars
|
|
39
|
+
});
|
|
40
|
+
var validateEmailTemplates = (templatePaths) => {
|
|
38
41
|
const errors = [];
|
|
39
|
-
for (const
|
|
42
|
+
for (const templatePath of templatePaths) {
|
|
40
43
|
try {
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
const template = fs.readFileSync(templatePath, "utf-8");
|
|
45
|
+
assureOnlySupportedHelpers(template);
|
|
46
|
+
compileEmailTemplate(template);
|
|
47
|
+
console.log(`${templatePath} is a valid email template`);
|
|
44
48
|
} catch (e) {
|
|
45
|
-
errors.push(`${
|
|
49
|
+
errors.push(`${templatePath} is invalid`);
|
|
46
50
|
errors.push(e);
|
|
47
51
|
}
|
|
48
52
|
}
|
|
49
53
|
return errors;
|
|
50
54
|
};
|
|
55
|
+
var assureOnlySupportedHelpers = (template) => {
|
|
56
|
+
const extractHelpers = (ast2) => {
|
|
57
|
+
const usedHelpers2 = /* @__PURE__ */ new Set();
|
|
58
|
+
const extractHelperName = (node) => {
|
|
59
|
+
if (node.path?.type === "PathExpression" && (node.params?.length > 0 || node.hash?.pairs?.length > 0)) {
|
|
60
|
+
return node.path?.original;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const visit = (node) => {
|
|
64
|
+
if (!node) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
switch (node.type) {
|
|
68
|
+
case "MustacheStatement":
|
|
69
|
+
case "BlockStatement": {
|
|
70
|
+
const name = extractHelperName(node);
|
|
71
|
+
if (name) {
|
|
72
|
+
usedHelpers2.add(name);
|
|
73
|
+
}
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
for (const key in node) {
|
|
78
|
+
const value = node[key];
|
|
79
|
+
if (Array.isArray(value)) {
|
|
80
|
+
value.forEach(visit);
|
|
81
|
+
} else if (value && typeof value === "object" && value.type) {
|
|
82
|
+
visit(value);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
visit(ast2);
|
|
87
|
+
return usedHelpers2;
|
|
88
|
+
};
|
|
89
|
+
const ast = Handlebars.parse(template);
|
|
90
|
+
const usedHelpers = extractHelpers(ast);
|
|
91
|
+
const supportedHelpers = /* @__PURE__ */ new Set([
|
|
92
|
+
// Built-in Handlebars helpers
|
|
93
|
+
"if",
|
|
94
|
+
"unless",
|
|
95
|
+
"each",
|
|
96
|
+
"with",
|
|
97
|
+
"log",
|
|
98
|
+
"lookup",
|
|
99
|
+
// Comparison helpers, provided by "handlebars-helpers" lib
|
|
100
|
+
"and",
|
|
101
|
+
"compare",
|
|
102
|
+
"contains",
|
|
103
|
+
"default",
|
|
104
|
+
"eq",
|
|
105
|
+
"gt",
|
|
106
|
+
"gte",
|
|
107
|
+
"has",
|
|
108
|
+
"isFalsey",
|
|
109
|
+
"isTruthy",
|
|
110
|
+
"ifEven",
|
|
111
|
+
"ifNth",
|
|
112
|
+
"ifOdd",
|
|
113
|
+
"is",
|
|
114
|
+
"isnt",
|
|
115
|
+
"lt",
|
|
116
|
+
"lte",
|
|
117
|
+
"neither",
|
|
118
|
+
"not",
|
|
119
|
+
"or",
|
|
120
|
+
"unlessEq",
|
|
121
|
+
"unlessGt",
|
|
122
|
+
"unlessLt",
|
|
123
|
+
"unlessGteq",
|
|
124
|
+
"unlessLteq"
|
|
125
|
+
]);
|
|
126
|
+
const unsupportedHelpers = Array.from(usedHelpers).filter(
|
|
127
|
+
(h) => !supportedHelpers.has(h)
|
|
128
|
+
);
|
|
129
|
+
if (unsupportedHelpers.length > 0) {
|
|
130
|
+
throw new Error(
|
|
131
|
+
`Email template uses unsupported Handlebars helpers: ${unsupportedHelpers.join(", ")}`
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
var compileEmailTemplate = (template) => {
|
|
136
|
+
const compiled = Handlebars.compile(template);
|
|
137
|
+
compiled({});
|
|
138
|
+
};
|
|
51
139
|
|
|
52
140
|
// src/commands/validate.ts
|
|
53
141
|
var validate = async () => {
|
|
54
|
-
const errors =
|
|
142
|
+
const errors = validateEmailTemplates(
|
|
143
|
+
(await glob("email-config/templates/**/*.hbs")).sort()
|
|
144
|
+
);
|
|
55
145
|
if (errors.length) {
|
|
56
146
|
halt(errors.map((el) => el.toString()).join("\n"));
|
|
57
147
|
}
|
|
58
|
-
logTitle("
|
|
148
|
+
logTitle("Validated successfully");
|
|
59
149
|
};
|
|
60
150
|
|
|
61
151
|
// src/lib/aws.ts
|
|
@@ -263,16 +353,21 @@ var deploy = async (options) => {
|
|
|
263
353
|
await validate();
|
|
264
354
|
awsAuthenticate(options);
|
|
265
355
|
const flags = prepareFlags(options);
|
|
266
|
-
const { tag } = options;
|
|
356
|
+
const { tag, dryrun } = options;
|
|
357
|
+
const dryRunFlag = dryrun ? `--dryrun` : "";
|
|
267
358
|
const configName = ifCore(CORE_CONFIG_NAME, getWidgetUuid());
|
|
268
359
|
const deployUrl = `s3://${AWS_S3_BUCKET_TAMARO}/${configName}/${tag}`;
|
|
269
360
|
const entryFilename = ifCore("index.js", "widget.js");
|
|
361
|
+
if (dryRunFlag) {
|
|
362
|
+
logTitle("\u{1F9EA} DRY RUN MODE - No actual changes will be made \u{1F9EA}");
|
|
363
|
+
}
|
|
270
364
|
const cmdSyncAll = `
|
|
271
365
|
aws s3 sync ${paths.appDist} ${deployUrl}
|
|
272
366
|
--acl public-read
|
|
273
367
|
--exclude ${paths.appDist}/${entryFilename}
|
|
274
368
|
--cache-control max-age=31536000
|
|
275
369
|
${flags}
|
|
370
|
+
${dryRunFlag}
|
|
276
371
|
`;
|
|
277
372
|
logTitle("Deploying to AWS S3 \u2026");
|
|
278
373
|
logCommand(cmdSyncAll);
|
|
@@ -286,6 +381,7 @@ var deploy = async (options) => {
|
|
|
286
381
|
--acl public-read
|
|
287
382
|
--cache-control max-age=64800
|
|
288
383
|
${flags}
|
|
384
|
+
${dryRunFlag}
|
|
289
385
|
`;
|
|
290
386
|
logCommand(cmdCpEntry);
|
|
291
387
|
try {
|
|
@@ -293,18 +389,20 @@ var deploy = async (options) => {
|
|
|
293
389
|
} catch (error) {
|
|
294
390
|
halt(error.stderr);
|
|
295
391
|
}
|
|
296
|
-
|
|
392
|
+
if (!dryRunFlag) {
|
|
393
|
+
const cmdInvalidateCache = `
|
|
297
394
|
aws cloudfront create-invalidation
|
|
298
395
|
--distribution-id ${AWS_CLOUDFRONT_DISTRIBUTION_ID}
|
|
299
396
|
--paths /${configName}/${tag}/*
|
|
300
397
|
${flags}
|
|
301
398
|
`;
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
399
|
+
logTitle("\nInvalidating edge cache \u2026");
|
|
400
|
+
logCommand(cmdInvalidateCache);
|
|
401
|
+
try {
|
|
402
|
+
runCommandSync(cmdInvalidateCache);
|
|
403
|
+
} catch (error) {
|
|
404
|
+
halt(error.stderr);
|
|
405
|
+
}
|
|
308
406
|
}
|
|
309
407
|
const demoPage = `https://${AWS_S3_BUCKET_TAMARO}/${configName}/${tag}/index.html`;
|
|
310
408
|
const entryPoint = `https://${AWS_S3_BUCKET_TAMARO}/${configName}/${tag}/${entryFilename}`;
|
|
@@ -371,13 +469,18 @@ var deployEmailConfig = async (options) => {
|
|
|
371
469
|
await validate();
|
|
372
470
|
awsAuthenticate(options);
|
|
373
471
|
const flags = prepareFlags(options);
|
|
472
|
+
const dryRunFlag = options.dryrun ? `--dryrun` : "";
|
|
374
473
|
const configName = getWidgetUuid();
|
|
375
474
|
const deployUrl = `s3://${options.bucket}/${configName}`;
|
|
475
|
+
if (dryRunFlag) {
|
|
476
|
+
logTitle("\u{1F9EA} DRY RUN MODE - No actual changes will be made \u{1F9EA}");
|
|
477
|
+
}
|
|
376
478
|
const cmd = `
|
|
377
479
|
aws s3 sync ${emailConfigPath} ${deployUrl}
|
|
378
480
|
--delete
|
|
379
481
|
--exact-timestamps
|
|
380
482
|
${flags}
|
|
483
|
+
${dryRunFlag}
|
|
381
484
|
`;
|
|
382
485
|
logTitle(
|
|
383
486
|
`Deploying email configuration for "${configName}" customer configuration to AWS S3 \u2026`
|
|
@@ -611,79 +714,83 @@ var prepareFlags4 = async (options) => {
|
|
|
611
714
|
// package.json
|
|
612
715
|
var package_default = {
|
|
613
716
|
name: "@raisenow/tamaro-cli",
|
|
614
|
-
version: "1.
|
|
717
|
+
version: "1.4.0",
|
|
615
718
|
author: {
|
|
616
719
|
name: "RaiseNow",
|
|
617
720
|
email: "development@raisenow.com"
|
|
618
721
|
},
|
|
619
722
|
type: "module",
|
|
620
723
|
bin: "dist/cli.js",
|
|
621
|
-
packageManager: "pnpm@
|
|
724
|
+
packageManager: "pnpm@10.13.1",
|
|
622
725
|
engines: {
|
|
623
|
-
node: ">=
|
|
624
|
-
pnpm: ">=
|
|
726
|
+
node: ">=22",
|
|
727
|
+
pnpm: ">= 10",
|
|
625
728
|
npm: "please-use-pnpm",
|
|
626
729
|
yarn: "please-use-pnpm"
|
|
627
730
|
},
|
|
628
731
|
scripts: {
|
|
629
732
|
prepare: "pnpm build",
|
|
630
|
-
|
|
733
|
+
typecheck: "tsc --noEmit",
|
|
631
734
|
build: "tsup src/cli.ts src/webpack.config.ts --clean --shims --format esm",
|
|
632
735
|
"build:watch": "pnpm build --watch --ignore-watch .history --ignore-watch .idea",
|
|
633
736
|
readme: "pnpx http-server . --cors -o /readme.html",
|
|
634
737
|
lint: "DEBUG=eslint:cli-engine eslint .",
|
|
635
738
|
"lint:fix": "DEBUG=eslint:cli-engine eslint --fix .",
|
|
636
|
-
format: "prettier --write ."
|
|
739
|
+
format: "prettier --write .",
|
|
740
|
+
test: "vitest",
|
|
741
|
+
"test:watch": "vitest --watch",
|
|
742
|
+
"test:coverage": "vitest --coverage"
|
|
637
743
|
},
|
|
638
744
|
dependencies: {
|
|
639
|
-
"@babel/cli": "^7.
|
|
640
|
-
"@babel/core": "^7.
|
|
641
|
-
"@babel/plugin-proposal-decorators": "^7.
|
|
745
|
+
"@babel/cli": "^7.28.0",
|
|
746
|
+
"@babel/core": "^7.28.0",
|
|
747
|
+
"@babel/plugin-proposal-decorators": "^7.28.0",
|
|
642
748
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
643
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
644
|
-
"@babel/preset-env": "^7.
|
|
645
|
-
"@babel/preset-react": "^7.
|
|
646
|
-
"@babel/preset-typescript": "^7.
|
|
647
|
-
"@babel/runtime-corejs3": "^7.
|
|
648
|
-
"@pmmmwh/react-refresh-webpack-plugin": "^0.
|
|
649
|
-
"@statoscope/webpack-plugin": "^5.
|
|
749
|
+
"@babel/plugin-transform-runtime": "^7.28.0",
|
|
750
|
+
"@babel/preset-env": "^7.28.0",
|
|
751
|
+
"@babel/preset-react": "^7.27.1",
|
|
752
|
+
"@babel/preset-typescript": "^7.27.1",
|
|
753
|
+
"@babel/runtime-corejs3": "^7.28.2",
|
|
754
|
+
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.1",
|
|
755
|
+
"@statoscope/webpack-plugin": "^5.29.0",
|
|
650
756
|
"@types/columnify": "^1.5.4",
|
|
651
|
-
"@types/
|
|
652
|
-
"@types/
|
|
757
|
+
"@types/handlebars-helpers": "^0.5.6",
|
|
758
|
+
"@types/lodash": "^4.17.20",
|
|
759
|
+
"@types/node": "^22.17.0",
|
|
653
760
|
"@types/node-notifier": "^8.0.5",
|
|
654
761
|
"@types/prompts": "^2.4.9",
|
|
655
762
|
"@types/resolve-bin": "^0.4.3",
|
|
656
763
|
"@types/webpack-config-utils": "^2.3.4",
|
|
657
764
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
658
765
|
"@typescript-eslint/parser": "^7.18.0",
|
|
659
|
-
autoprefixer: "^10.4.
|
|
660
|
-
"babel-loader": "^
|
|
766
|
+
autoprefixer: "^10.4.21",
|
|
767
|
+
"babel-loader": "^10.0.0",
|
|
661
768
|
"babel-plugin-istanbul": "^7.0.0",
|
|
662
769
|
"babel-plugin-lodash": "^3.3.4",
|
|
663
|
-
chalk: "^5.
|
|
770
|
+
chalk: "^5.4.1",
|
|
664
771
|
"clean-webpack-plugin": "^4.0.0",
|
|
665
772
|
columnify: "^1.6.0",
|
|
666
|
-
commander: "^
|
|
667
|
-
"copy-webpack-plugin": "^
|
|
668
|
-
"core-js": "^3.
|
|
773
|
+
commander: "^14.0.0",
|
|
774
|
+
"copy-webpack-plugin": "^13.0.0",
|
|
775
|
+
"core-js": "^3.44.0",
|
|
669
776
|
"css-loader": "^7.1.2",
|
|
670
|
-
"css-minimizer-webpack-plugin": "^7.0.
|
|
671
|
-
dotenv: "^
|
|
777
|
+
"css-minimizer-webpack-plugin": "^7.0.2",
|
|
778
|
+
dotenv: "^17.2.1",
|
|
672
779
|
"escape-string-regexp": "^5.0.0",
|
|
673
780
|
eslint: "^8.57.1",
|
|
674
|
-
"eslint-config-prettier": "^
|
|
781
|
+
"eslint-config-prettier": "^10.1.8",
|
|
675
782
|
"eslint-import-resolver-typescript": "^3.6.3",
|
|
676
783
|
"eslint-plugin-deprecation": "^3.0.0",
|
|
677
|
-
"eslint-plugin-import": "^2.
|
|
678
|
-
"eslint-plugin-markdownlint": "^0.
|
|
679
|
-
"eslint-plugin-promise": "^7.1
|
|
784
|
+
"eslint-plugin-import": "^2.32.0",
|
|
785
|
+
"eslint-plugin-markdownlint": "^0.9.0",
|
|
786
|
+
"eslint-plugin-promise": "^7.2.1",
|
|
680
787
|
"eslint-plugin-unused-imports": "^3.2.0",
|
|
681
|
-
"eslint-plugin-yml": "^1.
|
|
788
|
+
"eslint-plugin-yml": "^1.18.0",
|
|
682
789
|
"eslint-webpack-plugin": "^4.2.0",
|
|
683
|
-
execa: "^9.
|
|
790
|
+
execa: "^9.6.0",
|
|
684
791
|
"file-loader": "^6.2.0",
|
|
685
|
-
"fork-ts-checker-webpack-plugin": "^9.0
|
|
686
|
-
glob: "^11.0.
|
|
792
|
+
"fork-ts-checker-webpack-plugin": "^9.1.0",
|
|
793
|
+
glob: "^11.0.3",
|
|
687
794
|
handlebars: "^4.7.8",
|
|
688
795
|
"handlebars-helpers": "^0.10.0",
|
|
689
796
|
"html-loader": "^5.1.0",
|
|
@@ -692,29 +799,30 @@ var package_default = {
|
|
|
692
799
|
lodash: "^4.17.21",
|
|
693
800
|
"mini-css-extract-plugin": "^2.9.2",
|
|
694
801
|
"node-notifier": "^10.0.1",
|
|
695
|
-
portfinder: "^1.0.
|
|
696
|
-
postcss: "^8.
|
|
697
|
-
"postcss-custom-properties": "^14.0.
|
|
802
|
+
portfinder: "^1.0.37",
|
|
803
|
+
postcss: "^8.5.6",
|
|
804
|
+
"postcss-custom-properties": "^14.0.6",
|
|
698
805
|
"postcss-import": "^16.1.1",
|
|
699
806
|
"postcss-loader": "^8.1.1",
|
|
700
807
|
"postcss-nested": "^7.0.2",
|
|
701
|
-
prettier: "^3.
|
|
808
|
+
prettier: "^3.6.2",
|
|
702
809
|
prompts: "^2.4.2",
|
|
703
|
-
"react-refresh": "^0.
|
|
810
|
+
"react-refresh": "^0.17.0",
|
|
704
811
|
"resolve-url-loader": "^5.0.0",
|
|
705
|
-
sass: "^1.
|
|
706
|
-
"sass-loader": "^16.0.
|
|
812
|
+
sass: "^1.89.2",
|
|
813
|
+
"sass-loader": "^16.0.5",
|
|
707
814
|
"source-map-loader": "^5.0.0",
|
|
708
815
|
"strip-indent": "^4.0.0",
|
|
709
816
|
"style-loader": "^4.0.0",
|
|
710
817
|
"tsconfig-paths-webpack-plugin": "^4.2.0",
|
|
711
|
-
tsup: "^8.
|
|
712
|
-
typescript: "^5.
|
|
818
|
+
tsup: "^8.5.0",
|
|
819
|
+
typescript: "^5.8.3",
|
|
713
820
|
"url-loader": "^4.1.1",
|
|
714
|
-
|
|
715
|
-
|
|
821
|
+
vitest: "^3.2.4",
|
|
822
|
+
webpack: "^5.101.0",
|
|
823
|
+
"webpack-cli": "^6.0.1",
|
|
716
824
|
"webpack-config-utils": "^2.3.1",
|
|
717
|
-
"webpack-dev-server": "^5.
|
|
825
|
+
"webpack-dev-server": "^5.2.2",
|
|
718
826
|
"yaml-loader": "^0.8.1"
|
|
719
827
|
}
|
|
720
828
|
};
|
|
@@ -780,6 +888,10 @@ cli.command("deploy").description(
|
|
|
780
888
|
"--tag <tag>",
|
|
781
889
|
"Tag which should be used for the deployment of the bundle",
|
|
782
890
|
DEFAULT_TAG
|
|
891
|
+
).option(
|
|
892
|
+
"--dryrun",
|
|
893
|
+
"Displays the operations that would be performed without actually running them",
|
|
894
|
+
false
|
|
783
895
|
).action(async (options) => {
|
|
784
896
|
await deploy(options);
|
|
785
897
|
});
|
|
@@ -791,10 +903,16 @@ cli.command("list-deployed").description(
|
|
|
791
903
|
).action(async (options) => {
|
|
792
904
|
await listDeployed(options);
|
|
793
905
|
});
|
|
794
|
-
cli.command("deploy-email-config").description("Deploy a widget's email configuration to AWS S3").option("--profile <profile>", "AWS profile").option("--ci", "CI environment", false).option("--bucket <bucket>", "AWS bucket for email configs").
|
|
906
|
+
cli.command("deploy-email-config").description("Deploy a widget's email configuration to AWS S3").option("--profile <profile>", "AWS profile").option("--ci", "CI environment", false).option("--bucket <bucket>", "AWS bucket for email configs").option(
|
|
907
|
+
"--dryrun",
|
|
908
|
+
"Displays the operations that would be performed without actually running them",
|
|
909
|
+
false
|
|
910
|
+
).action(async (options) => {
|
|
795
911
|
await deployEmailConfig(options);
|
|
796
912
|
});
|
|
797
|
-
cli.command("validate").description(
|
|
913
|
+
cli.command("validate").description(
|
|
914
|
+
"Validate the current Tamaro configuration to avoid common errors"
|
|
915
|
+
).action(async () => {
|
|
798
916
|
await validate();
|
|
799
917
|
});
|
|
800
918
|
(async () => {
|
package/dist/webpack.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,78 +1,82 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raisenow/tamaro-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "RaiseNow",
|
|
6
6
|
"email": "development@raisenow.com"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
9
|
"bin": "dist/cli.js",
|
|
10
|
-
"packageManager": "pnpm@
|
|
10
|
+
"packageManager": "pnpm@10.13.1",
|
|
11
11
|
"engines": {
|
|
12
|
-
"node": ">=
|
|
13
|
-
"pnpm": ">=
|
|
12
|
+
"node": ">=22",
|
|
13
|
+
"pnpm": ">= 10",
|
|
14
14
|
"npm": "please-use-pnpm",
|
|
15
15
|
"yarn": "please-use-pnpm"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
18
|
"prepare": "pnpm build",
|
|
19
|
-
"
|
|
19
|
+
"typecheck": "tsc --noEmit",
|
|
20
20
|
"build": "tsup src/cli.ts src/webpack.config.ts --clean --shims --format esm",
|
|
21
21
|
"build:watch": "pnpm build --watch --ignore-watch .history --ignore-watch .idea",
|
|
22
22
|
"readme": "pnpx http-server . --cors -o /readme.html",
|
|
23
23
|
"lint": "DEBUG=eslint:cli-engine eslint .",
|
|
24
24
|
"lint:fix": "DEBUG=eslint:cli-engine eslint --fix .",
|
|
25
|
-
"format": "prettier --write ."
|
|
25
|
+
"format": "prettier --write .",
|
|
26
|
+
"test": "vitest",
|
|
27
|
+
"test:watch": "vitest --watch",
|
|
28
|
+
"test:coverage": "vitest --coverage"
|
|
26
29
|
},
|
|
27
30
|
"dependencies": {
|
|
28
|
-
"@babel/cli": "^7.
|
|
29
|
-
"@babel/core": "^7.
|
|
30
|
-
"@babel/plugin-proposal-decorators": "^7.
|
|
31
|
+
"@babel/cli": "^7.28.0",
|
|
32
|
+
"@babel/core": "^7.28.0",
|
|
33
|
+
"@babel/plugin-proposal-decorators": "^7.28.0",
|
|
31
34
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
32
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
33
|
-
"@babel/preset-env": "^7.
|
|
34
|
-
"@babel/preset-react": "^7.
|
|
35
|
-
"@babel/preset-typescript": "^7.
|
|
36
|
-
"@babel/runtime-corejs3": "^7.
|
|
37
|
-
"@pmmmwh/react-refresh-webpack-plugin": "^0.
|
|
38
|
-
"@statoscope/webpack-plugin": "^5.
|
|
35
|
+
"@babel/plugin-transform-runtime": "^7.28.0",
|
|
36
|
+
"@babel/preset-env": "^7.28.0",
|
|
37
|
+
"@babel/preset-react": "^7.27.1",
|
|
38
|
+
"@babel/preset-typescript": "^7.27.1",
|
|
39
|
+
"@babel/runtime-corejs3": "^7.28.2",
|
|
40
|
+
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.1",
|
|
41
|
+
"@statoscope/webpack-plugin": "^5.29.0",
|
|
39
42
|
"@types/columnify": "^1.5.4",
|
|
40
|
-
"@types/
|
|
41
|
-
"@types/
|
|
43
|
+
"@types/handlebars-helpers": "^0.5.6",
|
|
44
|
+
"@types/lodash": "^4.17.20",
|
|
45
|
+
"@types/node": "^22.17.0",
|
|
42
46
|
"@types/node-notifier": "^8.0.5",
|
|
43
47
|
"@types/prompts": "^2.4.9",
|
|
44
48
|
"@types/resolve-bin": "^0.4.3",
|
|
45
49
|
"@types/webpack-config-utils": "^2.3.4",
|
|
46
50
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
47
51
|
"@typescript-eslint/parser": "^7.18.0",
|
|
48
|
-
"autoprefixer": "^10.4.
|
|
49
|
-
"babel-loader": "^
|
|
52
|
+
"autoprefixer": "^10.4.21",
|
|
53
|
+
"babel-loader": "^10.0.0",
|
|
50
54
|
"babel-plugin-istanbul": "^7.0.0",
|
|
51
55
|
"babel-plugin-lodash": "^3.3.4",
|
|
52
|
-
"chalk": "^5.
|
|
56
|
+
"chalk": "^5.4.1",
|
|
53
57
|
"clean-webpack-plugin": "^4.0.0",
|
|
54
58
|
"columnify": "^1.6.0",
|
|
55
|
-
"commander": "^
|
|
56
|
-
"copy-webpack-plugin": "^
|
|
57
|
-
"core-js": "^3.
|
|
59
|
+
"commander": "^14.0.0",
|
|
60
|
+
"copy-webpack-plugin": "^13.0.0",
|
|
61
|
+
"core-js": "^3.44.0",
|
|
58
62
|
"css-loader": "^7.1.2",
|
|
59
|
-
"css-minimizer-webpack-plugin": "^7.0.
|
|
60
|
-
"dotenv": "^
|
|
63
|
+
"css-minimizer-webpack-plugin": "^7.0.2",
|
|
64
|
+
"dotenv": "^17.2.1",
|
|
61
65
|
"escape-string-regexp": "^5.0.0",
|
|
62
66
|
"eslint": "^8.57.1",
|
|
63
|
-
"eslint-config-prettier": "^
|
|
67
|
+
"eslint-config-prettier": "^10.1.8",
|
|
64
68
|
"eslint-import-resolver-typescript": "^3.6.3",
|
|
65
69
|
"eslint-plugin-deprecation": "^3.0.0",
|
|
66
|
-
"eslint-plugin-import": "^2.
|
|
67
|
-
"eslint-plugin-markdownlint": "^0.
|
|
68
|
-
"eslint-plugin-promise": "^7.1
|
|
70
|
+
"eslint-plugin-import": "^2.32.0",
|
|
71
|
+
"eslint-plugin-markdownlint": "^0.9.0",
|
|
72
|
+
"eslint-plugin-promise": "^7.2.1",
|
|
69
73
|
"eslint-plugin-unused-imports": "^3.2.0",
|
|
70
|
-
"eslint-plugin-yml": "^1.
|
|
74
|
+
"eslint-plugin-yml": "^1.18.0",
|
|
71
75
|
"eslint-webpack-plugin": "^4.2.0",
|
|
72
|
-
"execa": "^9.
|
|
76
|
+
"execa": "^9.6.0",
|
|
73
77
|
"file-loader": "^6.2.0",
|
|
74
|
-
"fork-ts-checker-webpack-plugin": "^9.0
|
|
75
|
-
"glob": "^11.0.
|
|
78
|
+
"fork-ts-checker-webpack-plugin": "^9.1.0",
|
|
79
|
+
"glob": "^11.0.3",
|
|
76
80
|
"handlebars": "^4.7.8",
|
|
77
81
|
"handlebars-helpers": "^0.10.0",
|
|
78
82
|
"html-loader": "^5.1.0",
|
|
@@ -81,29 +85,30 @@
|
|
|
81
85
|
"lodash": "^4.17.21",
|
|
82
86
|
"mini-css-extract-plugin": "^2.9.2",
|
|
83
87
|
"node-notifier": "^10.0.1",
|
|
84
|
-
"portfinder": "^1.0.
|
|
85
|
-
"postcss": "^8.
|
|
86
|
-
"postcss-custom-properties": "^14.0.
|
|
88
|
+
"portfinder": "^1.0.37",
|
|
89
|
+
"postcss": "^8.5.6",
|
|
90
|
+
"postcss-custom-properties": "^14.0.6",
|
|
87
91
|
"postcss-import": "^16.1.1",
|
|
88
92
|
"postcss-loader": "^8.1.1",
|
|
89
93
|
"postcss-nested": "^7.0.2",
|
|
90
|
-
"prettier": "^3.
|
|
94
|
+
"prettier": "^3.6.2",
|
|
91
95
|
"prompts": "^2.4.2",
|
|
92
|
-
"react-refresh": "^0.
|
|
96
|
+
"react-refresh": "^0.17.0",
|
|
93
97
|
"resolve-url-loader": "^5.0.0",
|
|
94
|
-
"sass": "^1.
|
|
95
|
-
"sass-loader": "^16.0.
|
|
98
|
+
"sass": "^1.89.2",
|
|
99
|
+
"sass-loader": "^16.0.5",
|
|
96
100
|
"source-map-loader": "^5.0.0",
|
|
97
101
|
"strip-indent": "^4.0.0",
|
|
98
102
|
"style-loader": "^4.0.0",
|
|
99
103
|
"tsconfig-paths-webpack-plugin": "^4.2.0",
|
|
100
|
-
"tsup": "^8.
|
|
101
|
-
"typescript": "^5.
|
|
104
|
+
"tsup": "^8.5.0",
|
|
105
|
+
"typescript": "^5.8.3",
|
|
102
106
|
"url-loader": "^4.1.1",
|
|
103
|
-
"
|
|
104
|
-
"webpack
|
|
107
|
+
"vitest": "^3.2.4",
|
|
108
|
+
"webpack": "^5.101.0",
|
|
109
|
+
"webpack-cli": "^6.0.1",
|
|
105
110
|
"webpack-config-utils": "^2.3.1",
|
|
106
|
-
"webpack-dev-server": "^5.
|
|
111
|
+
"webpack-dev-server": "^5.2.2",
|
|
107
112
|
"yaml-loader": "^0.8.1"
|
|
108
113
|
}
|
|
109
114
|
}
|
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {defineConfig} from 'vitest/config'
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
test: {
|
|
5
|
+
watch: false,
|
|
6
|
+
globals: true,
|
|
7
|
+
environment: 'node',
|
|
8
|
+
include: ['{src,tests}/**/*.{test,spec}.{ts,tsx}'],
|
|
9
|
+
reporters: ['default'],
|
|
10
|
+
coverage: {
|
|
11
|
+
provider: 'v8',
|
|
12
|
+
exclude: [
|
|
13
|
+
'dist/**',
|
|
14
|
+
'.eslintrc.cjs',
|
|
15
|
+
'.prettierrc.cjs',
|
|
16
|
+
'vitest.config.ts',
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
})
|