@raisenow/tamaro-cli 1.4.2 → 1.6.0-dev.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raisenow/tamaro-cli",
3
- "version": "1.4.2",
3
+ "version": "1.6.0-dev.1",
4
4
  "author": {
5
5
  "name": "RaiseNow",
6
6
  "email": "development@raisenow.com"
@@ -8,98 +8,94 @@
8
8
  "type": "module",
9
9
  "bin": "dist/cli.js",
10
10
  "engines": {
11
- "node": ">=22",
12
- "pnpm": ">=10",
11
+ "node": ">=22.22.0",
12
+ "pnpm": ">=10.28.2",
13
13
  "npm": "please-use-pnpm",
14
14
  "yarn": "please-use-pnpm"
15
15
  },
16
16
  "dependencies": {
17
- "@babel/cli": "^7.28.3",
18
- "@babel/core": "^7.28.4",
19
- "@babel/plugin-proposal-decorators": "^7.28.0",
17
+ "@babel/cli": "^7.28.6",
18
+ "@babel/core": "^7.29.0",
20
19
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
21
- "@babel/plugin-transform-runtime": "^7.28.3",
22
- "@babel/preset-env": "^7.28.3",
23
- "@babel/preset-react": "^7.27.1",
24
- "@babel/preset-typescript": "^7.27.1",
25
- "@babel/runtime-corejs3": "^7.28.4",
26
- "@pmmmwh/react-refresh-webpack-plugin": "^0.6.1",
20
+ "@babel/preset-env": "^7.29.0",
21
+ "@babel/preset-react": "^7.28.5",
22
+ "@babel/preset-typescript": "^7.28.5",
23
+ "@pmmmwh/react-refresh-webpack-plugin": "^0.6.2",
27
24
  "@statoscope/webpack-plugin": "^5.29.0",
28
25
  "@types/columnify": "^1.5.4",
29
26
  "@types/handlebars-helpers": "^0.5.6",
30
- "@types/lodash": "^4.17.20",
31
- "@types/node": "^22.18.6",
27
+ "@types/lodash": "^4.17.23",
28
+ "@types/node": "^22.19.8",
32
29
  "@types/node-notifier": "^8.0.5",
33
30
  "@types/prompts": "^2.4.9",
34
31
  "@types/resolve-bin": "^0.4.3",
35
32
  "@types/webpack-config-utils": "^2.3.4",
36
33
  "@typescript-eslint/eslint-plugin": "^7.18.0",
37
34
  "@typescript-eslint/parser": "^7.18.0",
38
- "autoprefixer": "^10.4.21",
35
+ "autoprefixer": "^10.4.24",
39
36
  "babel-loader": "^10.0.0",
40
37
  "babel-plugin-istanbul": "^7.0.1",
41
38
  "babel-plugin-lodash": "^3.3.4",
42
39
  "chalk": "^5.6.2",
43
40
  "clean-webpack-plugin": "^4.0.0",
44
41
  "columnify": "^1.6.0",
45
- "commander": "^14.0.1",
42
+ "commander": "^14.0.3",
46
43
  "copy-webpack-plugin": "^13.0.1",
47
- "core-js": "^3.45.1",
48
- "css-loader": "^7.1.2",
49
- "css-minimizer-webpack-plugin": "^7.0.2",
50
- "dotenv": "^17.2.2",
44
+ "core-js": "^3.48.0",
45
+ "css-loader": "^7.1.3",
46
+ "css-minimizer-webpack-plugin": "^7.0.4",
47
+ "dotenv": "^17.2.3",
51
48
  "escape-string-regexp": "^5.0.0",
52
49
  "eslint": "^8.57.1",
53
50
  "eslint-config-prettier": "^10.1.8",
54
- "eslint-import-resolver-typescript": "^3.6.3",
51
+ "eslint-import-resolver-typescript": "^3.10.1",
55
52
  "eslint-plugin-deprecation": "^3.0.0",
56
53
  "eslint-plugin-import": "^2.32.0",
57
54
  "eslint-plugin-markdownlint": "^0.9.0",
58
55
  "eslint-plugin-promise": "^7.2.1",
59
56
  "eslint-plugin-unused-imports": "^3.2.0",
60
- "eslint-plugin-yml": "^1.18.0",
57
+ "eslint-plugin-yml": "^1.19.1",
61
58
  "eslint-webpack-plugin": "^5.0.2",
62
- "execa": "^9.6.0",
59
+ "execa": "^9.6.1",
63
60
  "file-loader": "^6.2.0",
64
61
  "fork-ts-checker-webpack-plugin": "^9.1.0",
65
- "glob": "^11.0.3",
62
+ "glob": "^13.0.1",
66
63
  "handlebars": "^4.7.8",
67
64
  "handlebars-helpers": "^0.10.0",
68
65
  "html-loader": "^5.1.0",
69
- "html-webpack-plugin": "^5.6.4",
66
+ "html-webpack-plugin": "^5.6.6",
70
67
  "json-loader": "^0.5.7",
71
- "lodash": "^4.17.21",
72
- "mini-css-extract-plugin": "^2.9.4",
68
+ "lodash": "^4.17.23",
69
+ "mini-css-extract-plugin": "^2.10.0",
73
70
  "node-notifier": "^10.0.1",
74
71
  "portfinder": "^1.0.38",
75
72
  "postcss": "^8.5.6",
76
- "postcss-custom-properties": "^14.0.6",
77
73
  "postcss-import": "^16.1.1",
78
74
  "postcss-loader": "^8.2.0",
79
75
  "postcss-nested": "^7.0.2",
80
- "prettier": "^3.6.2",
76
+ "prettier": "^3.8.1",
81
77
  "prompts": "^2.4.2",
82
- "react-refresh": "^0.17.0",
78
+ "react-refresh": "^0.18.0",
83
79
  "resolve-url-loader": "^5.0.0",
84
- "sass": "^1.93.1",
85
- "sass-loader": "^16.0.5",
86
- "strip-indent": "^4.1.0",
80
+ "sass": "^1.97.3",
81
+ "sass-loader": "^16.0.6",
82
+ "strip-indent": "^4.1.1",
87
83
  "style-loader": "^4.0.0",
88
- "terser-webpack-plugin": "^5.3.14",
84
+ "terser-webpack-plugin": "^5.3.16",
89
85
  "tsconfig-paths-webpack-plugin": "^4.2.0",
90
- "tsup": "^8.5.0",
91
- "typescript": "^5.9.2",
86
+ "tsdown": "^0.20.1",
87
+ "typescript": "^5.9.3",
92
88
  "url-loader": "^4.1.1",
93
- "vitest": "^3.2.4",
94
- "webpack": "^5.101.3",
89
+ "vitest": "^4.0.18",
90
+ "webpack": "^5.105.0",
95
91
  "webpack-cli": "^6.0.1",
96
92
  "webpack-config-utils": "^2.3.1",
97
- "webpack-dev-server": "^5.2.2",
98
- "yaml-loader": "^0.8.1"
93
+ "webpack-dev-server": "^5.2.3",
94
+ "yaml-loader": "^0.9.0"
99
95
  },
100
96
  "scripts": {
101
97
  "typecheck": "tsc --noEmit",
102
- "build": "tsup src/cli.ts src/webpack.config.ts --clean --shims --format esm",
98
+ "build": "tsdown",
103
99
  "build:watch": "pnpm build --watch --ignore-watch .history --ignore-watch .idea",
104
100
  "readme": "pnpx http-server . --cors -o /readme.html",
105
101
  "lint": "DEBUG=eslint:cli-engine eslint .",
@@ -1,2 +1,11 @@
1
+ minimumReleaseAge: 1440
2
+
3
+ minimumReleaseAgeExclude:
4
+ - '@raisenow/*'
5
+ - '@rnw-npm/*'
6
+
1
7
  onlyBuiltDependencies:
2
8
  - core-js
9
+ - core-js-pure
10
+ - esbuild
11
+ - unrs-resolver
package/renovate.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json"
3
+ }
@@ -0,0 +1,11 @@
1
+ import {defineConfig} from 'tsdown'
2
+
3
+ export default defineConfig({
4
+ entry: ['./src/cli.ts', './src/webpack.config.ts'],
5
+ clean: true,
6
+ shims: true,
7
+ fixedExtension: false,
8
+ outDir: './dist',
9
+ target: 'esnext',
10
+ inlineOnly: false,
11
+ })
@@ -1,315 +0,0 @@
1
- // node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_tsx@4.19.1_typescript@5.9.2/node_modules/tsup/assets/esm_shims.js
2
- import path from "path";
3
- import { fileURLToPath } from "url";
4
- var getFilename = () => fileURLToPath(import.meta.url);
5
- var getDirname = () => path.dirname(getFilename());
6
- var __dirname = /* @__PURE__ */ getDirname();
7
-
8
- // src/lib/logging.ts
9
- import chalk from "chalk";
10
- import columnify from "columnify";
11
- import stripIndent from "strip-indent";
12
- var logTitle = (title) => {
13
- console.log(chalk.bold(title));
14
- };
15
- var logError = (message) => {
16
- if (message) {
17
- console.log(chalk.red(message));
18
- }
19
- };
20
- var logCommand = (cmd) => {
21
- console.log(`
22
- ${chalk.dim(stripIndent(cmd).trim())}
23
- `);
24
- };
25
- var logDataTable = (data) => {
26
- console.log(columnify(data, { showHeaders: false }));
27
- console.log("");
28
- };
29
-
30
- // src/lib/command.ts
31
- import { execaCommandSync } from "execa";
32
- var halt = (message) => {
33
- logError(message);
34
- process.exit(1);
35
- };
36
- var prepareCommand = (cmd) => {
37
- return cmd.replace(/\n/gm, " ").replace(/[ \t]{2,}/gm, " ").trim();
38
- };
39
- var runCommandSync = (cmd, options) => {
40
- return execaCommandSync(prepareCommand(cmd), options);
41
- };
42
-
43
- // src/lib/constants.ts
44
- var DEFAULT_TAG = "latest";
45
- var DEFAULT_PORT = 1234;
46
- var AWS_S3_BUCKET_TAMARO = "tamaro.raisenow.com";
47
- var AWS_S3_BUCKET_TAMARO_EMAIL_CONFIG_STAGE = "rnw-stage-email-service";
48
- var AWS_S3_BUCKET_TAMARO_EMAIL_CONFIG_PROD = "rnw-email-service";
49
- var CORE_CONFIG_NAME = "tamaro-core";
50
- var AWS_CLOUDFRONT_DISTRIBUTION_ID = "EHJ1OM458YQ0I";
51
- var HTTPS_CRT_FILE = "localhost.crt";
52
- var HTTPS_KEY_FILE = "localhost.key";
53
-
54
- // src/lib/resolve.ts
55
- import { existsSync, realpathSync } from "fs";
56
- import { createRequire } from "module";
57
- import { basename, dirname, join, relative, resolve } from "path";
58
- import chalk2 from "chalk";
59
- import stripIndent2 from "strip-indent";
60
- import { getIfUtils } from "webpack-config-utils";
61
- var require2 = createRequire(import.meta.url);
62
- var moduleFileExtensions = ["ts", "tsx", "js", "jsx"];
63
- var extensions = moduleFileExtensions.map((v) => `.${v}`);
64
- var TAMARO_CORE_PACKAGE_NAMES = ["@raisenow/tamaro-core"];
65
- var TAMARO_CONFIGURATIONS_PACKAGE_NAMES = ["@raisenow/tamaro-configurations"];
66
- var TAMARO_SELF_SERVICE_PACKAGE_NAMES = ["@raisenow/tamaro-self-service"];
67
- var resolveApp = (relativePath) => resolve(realpathSync(process.cwd()), relativePath);
68
- var resolveOwn = (relativePath) => resolve(__dirname, "..", relativePath);
69
- var resolveModule = (resolveFn, filePath) => {
70
- const extension = moduleFileExtensions.find(
71
- (extension2) => existsSync(resolveFn(`${filePath}.${extension2}`))
72
- );
73
- if (extension) {
74
- return resolveFn(`${filePath}.${extension}`);
75
- }
76
- return resolveFn(`${filePath}.js`);
77
- };
78
- var resolveEslintPluginConfig = (paths) => {
79
- try {
80
- const opts = { paths: [paths.appNodeModules] };
81
- const eslintPath = require2.resolve("eslint", opts);
82
- const pkg = require2(require2.resolve("eslint/package.json", opts));
83
- const version = pkg.version;
84
- const configType = version.startsWith("8.") ? "eslintrc" : "flat";
85
- return {
86
- extensions: moduleFileExtensions,
87
- eslintPath,
88
- cwd: paths.app,
89
- configType
90
- };
91
- } catch (error) {
92
- console.error(error);
93
- return void 0;
94
- }
95
- };
96
- var resolveBin = (name) => {
97
- const pkgPath = require2.resolve(`${name}/package.json`);
98
- const { bin } = require2(pkgPath);
99
- const dir = dirname(pkgPath);
100
- const binPath = typeof bin === "object" ? bin[name] : bin;
101
- return join(dir, binPath);
102
- };
103
- var getWidgetUuid = () => basename(resolveApp("."));
104
- var getPaths = (ifCore) => {
105
- return ifCore(
106
- {
107
- root: resolveApp("."),
108
- app: resolveApp("."),
109
- appEntry: resolveModule(resolveApp, "src/index"),
110
- appDist: resolveApp("dist"),
111
- appNodeModules: resolveApp("node_modules"),
112
- appTsConfig: resolveApp("tsconfig.json"),
113
- appHtml: resolveApp("src/*.html"),
114
- appEnv: resolveApp(".env*"),
115
- appTailwindConfig: resolveApp("tailwind.config.js")
116
- },
117
- {
118
- root: resolveApp("../.."),
119
- app: resolveApp("."),
120
- appEntry: resolveModule(resolveApp, "widget"),
121
- appDist: resolveApp(`../../dist/${getWidgetUuid()}`),
122
- appNodeModules: resolveApp("../../node_modules"),
123
- appTsConfig: resolveApp("tsconfig.json"),
124
- appHtml: resolveApp("*.html"),
125
- appEnv: resolveApp(".env*"),
126
- appTailwindConfig: void 0
127
- }
128
- );
129
- };
130
- var getRelativePaths = (paths) => {
131
- const relativePaths = {};
132
- for (const [type, absPath] of Object.entries(paths)) {
133
- if (absPath) {
134
- relativePaths[type] = relative("./", absPath) || ".";
135
- }
136
- }
137
- return relativePaths;
138
- };
139
- var getIfCoreFns = () => {
140
- const corePkgPath = resolveApp("package.json");
141
- const configsPkgPath = resolveApp("../../package.json");
142
- let packageName;
143
- if (existsSync(corePkgPath)) {
144
- packageName = require2(corePkgPath).name;
145
- } else if (existsSync(configsPkgPath)) {
146
- packageName = require2(configsPkgPath).name;
147
- }
148
- if (packageName) {
149
- return getIfUtils({ core: TAMARO_CORE_PACKAGE_NAMES.includes(packageName) }, [
150
- "core"
151
- ]);
152
- }
153
- logError(
154
- stripIndent2(` You must run "npx @raisenow/tamaro-cli" commands from:
155
- 1. Root of "${chalk2.bold(TAMARO_CORE_PACKAGE_NAMES[0])}" package folder.
156
- 2. Root of particular customer configuration folder of "${chalk2.bold(
157
- TAMARO_CONFIGURATIONS_PACKAGE_NAMES[0]
158
- )}" package.
159
- 3. "src/self-service" folder of "${chalk2.bold(
160
- TAMARO_SELF_SERVICE_PACKAGE_NAMES[0]
161
- )}" package.
162
- You are currently in "${chalk2.bold(realpathSync(process.cwd()))}".
163
- `)
164
- );
165
- process.exit(1);
166
- };
167
-
168
- // src/lib/env.ts
169
- import { createRequire as createRequire2 } from "module";
170
- import { basename as basename2 } from "path";
171
- import { config as dotenvConfig } from "dotenv";
172
- import { globSync } from "glob";
173
- import stripIndent3 from "strip-indent";
174
- var require3 = createRequire2(import.meta.url);
175
- var getEnvVars = (files, ifMin, ifCore, ifLocalCore, ifHttps) => {
176
- const filePath = files.find((file) => basename2(file) === ".env");
177
- if (filePath) {
178
- dotenvConfig({ path: filePath });
179
- }
180
- process.env.NODE_ENV ??= ifMin("production", "development");
181
- process.env.BABEL_ENV ??= ifMin("production", "development");
182
- process.env.EXPOSE_VAR ??= ifCore("rnw.tamaroCore", "rnw.tamaro");
183
- process.env.ELEMENT_ATTRIBUTE_DATA_WIDGET ??= ifCore(
184
- "rnw-tamaro-core",
185
- "rnw-tamaro"
186
- );
187
- process.env.WEBPACK_UNIQUE_NAME ??= ifCore("RnwTamaroCore", "RnwTamaro");
188
- process.env.BUILD_DATE = (/* @__PURE__ */ new Date()).toISOString();
189
- process.env.PUBLIC_URL ??= "";
190
- process.env.HMR_ENABLED ??= ifMin("false", "true");
191
- if (ifCore()) {
192
- process.env.PRODUCT_NAME = "tamaro";
193
- const corePkgPath = resolveApp("package.json");
194
- const { version } = require3(corePkgPath);
195
- process.env.PRODUCT_VERSION = version;
196
- }
197
- if (!ifCore()) {
198
- process.env.WIDGET_UUID = getWidgetUuid();
199
- if (ifLocalCore()) {
200
- const protocol = ifHttps() ? "https" : "http";
201
- process.env.CORE_URL = `${protocol}://localhost:1234/index.js`;
202
- } else {
203
- let version = process.env.CORE_VERSION;
204
- version = version ? `@${version}` : "";
205
- process.env.CORE_URL ??= `https://cdn.jsdelivr.net/npm/@raisenow/tamaro-core${version}/dist/index.js`;
206
- }
207
- }
208
- const varNames = [
209
- // common
210
- "NODE_ENV",
211
- "BABEL_ENV",
212
- "EXPOSE_VAR",
213
- "ELEMENT_ATTRIBUTE_DATA_WIDGET",
214
- "WEBPACK_UNIQUE_NAME",
215
- "BUILD_DATE",
216
- "PUBLIC_URL",
217
- // core
218
- "PRODUCT_NAME",
219
- "PRODUCT_VERSION",
220
- // config
221
- "WIDGET_UUID",
222
- "CORE_URL",
223
- "CORE_VERSION",
224
- // should be explicitly specified in each config
225
- // epik (obsolete since Tamaro v2.5.0)
226
- "EPP_API_KEY_DEFAULT",
227
- "EPP_API_URL_STAGE",
228
- "EPP_API_URL_PROD",
229
- "EPMS_API_URL_STAGE",
230
- "EPMS_API_URL_PROD",
231
- "EPP_PROXY_URL_STAGE",
232
- "EPP_PROXY_URL_PROD",
233
- "EPMS_PROXY_URL_STAGE",
234
- "EPMS_PROXY_URL_PROD",
235
- "EPMS_TWINT_CHECKOUT_URL_STAGE",
236
- "EPMS_TWINT_CHECKOUT_URL_PROD"
237
- ];
238
- const raw = Object.keys(process.env).filter((key) => key.startsWith("PUBLIC_") || varNames.includes(key)).reduce((env, key) => {
239
- env[key] = process.env[key];
240
- return env;
241
- }, {});
242
- const stringified = {
243
- "process.env": Object.keys(raw).reduce((env, key) => {
244
- env[key] = JSON.stringify(raw[key]);
245
- return env;
246
- }, {})
247
- };
248
- return { raw, stringified };
249
- };
250
- var assertEnvValid = (env) => {
251
- const { ifCore } = getIfCoreFns();
252
- const paths = getPaths(ifCore);
253
- const files = globSync(paths.appEnv);
254
- const envs = files.map((file) => basename2(file).replace(/^\.env\./, "")).map((file) => basename2(file).replace(/^\.env$/, "")).filter((v) => !!v);
255
- if (envs.length === 0) {
256
- if (env) {
257
- console.log('Flag "--env" is ignored.');
258
- }
259
- }
260
- if (envs.length !== 0) {
261
- if (!env) {
262
- halt('Flag "--env" is required.');
263
- }
264
- if (env && !envs.includes(env)) {
265
- halt(
266
- stripIndent3(`
267
- Flag "--env" has wrong value.
268
- Available values are: ${envs.map((v) => `"${v}"`).join(", ")}.
269
- `)
270
- );
271
- }
272
- }
273
- };
274
- var applyEnv = (env) => {
275
- if (!env) {
276
- return;
277
- }
278
- const { ifCore } = getIfCoreFns();
279
- const paths = getPaths(ifCore);
280
- const files = globSync(paths.appEnv);
281
- const filePath = files.find((file) => basename2(file) === `.env.${env}`);
282
- if (filePath) {
283
- dotenvConfig({ path: filePath });
284
- }
285
- };
286
-
287
- export {
288
- logTitle,
289
- logError,
290
- logCommand,
291
- logDataTable,
292
- halt,
293
- runCommandSync,
294
- DEFAULT_TAG,
295
- DEFAULT_PORT,
296
- AWS_S3_BUCKET_TAMARO,
297
- AWS_S3_BUCKET_TAMARO_EMAIL_CONFIG_STAGE,
298
- AWS_S3_BUCKET_TAMARO_EMAIL_CONFIG_PROD,
299
- CORE_CONFIG_NAME,
300
- AWS_CLOUDFRONT_DISTRIBUTION_ID,
301
- HTTPS_CRT_FILE,
302
- HTTPS_KEY_FILE,
303
- extensions,
304
- resolveApp,
305
- resolveOwn,
306
- resolveEslintPluginConfig,
307
- resolveBin,
308
- getWidgetUuid,
309
- getPaths,
310
- getRelativePaths,
311
- getIfCoreFns,
312
- getEnvVars,
313
- assertEnvValid,
314
- applyEnv
315
- };