@raisenow/tamaro-cli 1.1.8 → 1.2.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.
Files changed (106) hide show
  1. package/.history/.eslintignore_20220609190420 +4 -0
  2. package/.history/.eslintignore_20230911190227 +6 -0
  3. package/.history/.eslintignore_20230911211247 +7 -0
  4. package/.history/.eslintignore_20230911211250 +7 -0
  5. package/.history/.eslintrc_20230911201601.js +49 -0
  6. package/.history/.eslintrc_20230911201643.js +49 -0
  7. package/.history/.eslintrc_20230911201735.js +49 -0
  8. package/.history/.eslintrc_20230911201913.js +64 -0
  9. package/.history/.eslintrc_20230911202002.js +62 -0
  10. package/.history/.eslintrc_20230911202138.js +133 -0
  11. package/.history/.eslintrc_20230911202140.js +133 -0
  12. package/.history/.eslintrc_20230911202145.js +133 -0
  13. package/.history/.eslintrc_20230911202147.js +133 -0
  14. package/.history/.eslintrc_20230911202406.js +133 -0
  15. package/.history/.eslintrc_20230911202447.js +133 -0
  16. package/.history/.eslintrc_20230911202453.js +133 -0
  17. package/.history/.eslintrc_20230911202511.js +133 -0
  18. package/.history/.eslintrc_20230911202527.js +133 -0
  19. package/.history/.eslintrc_20230911202639.js +125 -0
  20. package/.history/.eslintrc_20230911202721.js +149 -0
  21. package/.history/.eslintrc_20230911202746.js +149 -0
  22. package/.history/.eslintrc_20240423125702.cjs +148 -0
  23. package/.history/.gitignore_20220609190420 +14 -0
  24. package/.history/.gitignore_20230911185959 +4 -0
  25. package/.history/.gitignore_20230911190006 +4 -0
  26. package/.history/.gitignore_20230911190007 +4 -0
  27. package/.history/.nmprc_20241004144025 +0 -0
  28. package/.history/.nmprc_20241004144041 +1 -0
  29. package/.history/.npmrc_20241004144040 +1 -0
  30. package/.history/.npmrc_20241004144152 +1 -0
  31. package/.history/.npmrc_20241004145639 +2 -0
  32. package/.history/.npmrc_20241004145649 +1 -0
  33. package/.history/.nvmrc_20241125012803 +1 -0
  34. package/.history/.nvmrc_20241125022800 +1 -0
  35. package/.history/.nvmrc_20241125022806 +1 -0
  36. package/.history/.prettierignore_20220609190420 +5 -0
  37. package/.history/.prettierignore_20230911190242 +7 -0
  38. package/.history/.prettierignore_20230911190245 +7 -0
  39. package/.history/.prettierignore_20230911211301 +8 -0
  40. package/.history/CHANGELOG_20250624052910.md +20 -0
  41. package/.history/CHANGELOG_20250624055058.md +23 -0
  42. package/.history/CHANGELOG_20250624055107.md +23 -0
  43. package/.history/CHANGELOG_20250624055138.md +23 -0
  44. package/.history/CHANGELOG_20250624055156.md +23 -0
  45. package/.history/CHANGELOG_20250624055200.md +23 -0
  46. package/.history/CHANGELOG_20250624055203.md +23 -0
  47. package/.history/CHANGELOG_20250625142852.md +25 -0
  48. package/.history/CHANGELOG_20250625142901.md +22 -0
  49. package/.history/CHANGELOG_20250625142902.md +22 -0
  50. package/.history/README_20230911145033.md +245 -0
  51. package/.history/README_20230911151749.md +245 -0
  52. package/.history/README_20230911151844.md +245 -0
  53. package/.history/README_20230911153040.md +245 -0
  54. package/.history/README_20230911202959.md +245 -0
  55. package/.history/cli_20241005014539 +3 -0
  56. package/.history/cli_20241005014542 +3 -0
  57. package/.history/cli_20241005014848 +3 -0
  58. package/.history/dist/chunk-FICM3HUI_20230912183408.js +302 -0
  59. package/.history/dist/chunk-FICM3HUI_20230912201610.js +302 -0
  60. package/.history/package_20241107122123.json +106 -0
  61. package/.history/package_20241107122219.json +106 -0
  62. package/.history/package_20241107124611.json +106 -0
  63. package/.history/package_20241107125521.json +106 -0
  64. package/.history/package_20241107125538.json +106 -0
  65. package/.history/package_20241125013228.json +106 -0
  66. package/.history/package_20241125013249.json +106 -0
  67. package/.history/package_20241125014402.json +105 -0
  68. package/.history/package_20241125103106.json +105 -0
  69. package/.history/tsconfig_20241005001442.json +34 -0
  70. package/.history/tsconfig_20241005001500.json +34 -0
  71. package/.history/tsconfig_20241005001540.json +34 -0
  72. package/.history/tsconfig_20241005014429.json +42 -0
  73. package/.history/tsconfig_20241005014436.json +42 -0
  74. package/.history/tsconfig_20241005014439.json +38 -0
  75. package/.history/tsconfig_20241005014455.json +38 -0
  76. package/.idea/codeStyles/Project.xml +131 -0
  77. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  78. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  79. package/.idea/misc.xml +17 -0
  80. package/.idea/modules.xml +8 -0
  81. package/.idea/prettier.xml +6 -0
  82. package/.idea/tamaro-cli.iml +12 -0
  83. package/.idea/vcs.xml +6 -0
  84. package/README.md +35 -13
  85. package/bitbucket-pipelines.yml +43 -0
  86. package/dist/cli.js +42 -1
  87. package/dist/webpack.config.js +43 -12
  88. package/package.json +5 -1
  89. package/src/cli.ts +0 -178
  90. package/src/commands/build.ts +0 -131
  91. package/src/commands/deploy-email-config.ts +0 -159
  92. package/src/commands/deploy.ts +0 -164
  93. package/src/commands/dev.ts +0 -88
  94. package/src/commands/list-deployed.ts +0 -117
  95. package/src/commands/serve.ts +0 -69
  96. package/src/lib/InterpolateHtmlPlugin.ts +0 -47
  97. package/src/lib/aws.ts +0 -138
  98. package/src/lib/command.ts +0 -27
  99. package/src/lib/constants.ts +0 -9
  100. package/src/lib/env.ts +0 -175
  101. package/src/lib/https.ts +0 -27
  102. package/src/lib/logging.ts +0 -37
  103. package/src/lib/notifier.ts +0 -22
  104. package/src/lib/resolve.ts +0 -143
  105. package/src/webpack.config.ts +0 -437
  106. /package/{tsconfig.json → .history/tsconfig_20241005014521.json} +0 -0
@@ -1,437 +0,0 @@
1
- import {existsSync} from 'fs'
2
- import {createRequire} from 'module'
3
- import {basename, dirname, resolve} from 'path'
4
- import ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin'
5
- import StatoscopeWebpackPlugin from '@statoscope/webpack-plugin'
6
- import {CleanWebpackPlugin} from 'clean-webpack-plugin'
7
- import CopyPlugin from 'copy-webpack-plugin'
8
- import CssMinimizerPlugin from 'css-minimizer-webpack-plugin'
9
- import ESLintPlugin from 'eslint-webpack-plugin'
10
- import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'
11
- import {globSync} from 'glob'
12
- import HtmlWebpackPlugin from 'html-webpack-plugin'
13
- import MiniCssExtractPlugin from 'mini-css-extract-plugin'
14
- import {TsconfigPathsPlugin} from 'tsconfig-paths-webpack-plugin'
15
- import type {Configuration, RuleSetUseItem} from 'webpack'
16
- // eslint-disable-next-line import/no-named-as-default
17
- import webpack from 'webpack'
18
- import {getIfUtils, removeEmpty} from 'webpack-config-utils'
19
- // Needed for webpack-dev-server types to be picked up correctly
20
- import {} from 'webpack-dev-server'
21
- import {HTTPS_CRT_FILE, HTTPS_KEY_FILE} from 'lib/constants'
22
- import {getEnvVars} from 'lib/env'
23
- import {InterpolateHtmlPlugin} from 'lib/InterpolateHtmlPlugin'
24
- import {logDataTable, logTitle} from 'lib/logging'
25
- import {
26
- extensions,
27
- getIfCoreFns,
28
- getPaths,
29
- getRelativePaths,
30
- moduleFileExtensions,
31
- resolveApp,
32
- } from 'lib/resolve'
33
-
34
- ///////////////////////////////////////////////////////////////////////////////
35
-
36
- const require = createRequire(import.meta.url)
37
- const imageInlineSizeLimit = 0
38
- // const imageInlineSizeLimit = 8 * 1024 // 8kb
39
-
40
- ///////////////////////////////////////////////////////////////////////////////
41
-
42
- const getWebpackConfig = (env: any): Configuration => {
43
- const {ifMin, ifNotMin} = getIfUtils(env, ['min'])
44
- const {ifAnalyze} = getIfUtils(env, ['analyze'])
45
- const {ifHttps} = getIfUtils(env, ['https'])
46
- const {ifLocalCore} = getIfUtils(env, ['localCore'])
47
- const {ifCore} = getIfCoreFns()
48
- const paths = getPaths(ifCore)
49
- const appHtmlFiles = globSync(paths.appHtml)
50
- const appEnvFiles = globSync(paths.appEnv)
51
- const envVars = getEnvVars(appEnvFiles, ifMin, ifCore, ifLocalCore, ifHttps)
52
- const {ifHmr} = getIfUtils({hmr: process.env.HMR_ENABLED === 'true'}, ['hmr'])
53
- const {ifNolint} = getIfUtils(env, ['nolint'])
54
- const useTailwind =
55
- ifCore() && paths.appTailwindConfig && existsSync(paths.appTailwindConfig)
56
-
57
- logTitle('Paths:')
58
- logDataTable(getRelativePaths(paths))
59
-
60
- logTitle('Environment variables:')
61
- logDataTable(envVars.raw)
62
-
63
- const getCssLoaders = ({
64
- styleLoader = true,
65
- ...cssOptions
66
- }: {styleLoader?: boolean} & Record<string, any>): RuleSetUseItem[] => {
67
- return removeEmpty([
68
- styleLoader ? ifMin({loader: MiniCssExtractPlugin.loader}) : undefined,
69
- styleLoader
70
- ? ifNotMin({
71
- loader: require.resolve('style-loader'),
72
- options: {
73
- attributes: {
74
- 'data-widget': process.env.ELEMENT_ATTRIBUTE_DATA_WIDGET,
75
- },
76
- },
77
- })
78
- : undefined,
79
- {
80
- loader: require.resolve('css-loader'),
81
- options: {
82
- sourceMap: ifNotMin(),
83
- importLoaders: 3,
84
- ...cssOptions,
85
- },
86
- },
87
- {
88
- loader: require.resolve('postcss-loader'),
89
- options: {
90
- postcssOptions: {
91
- plugins: removeEmpty([
92
- useTailwind
93
- ? [
94
- require.resolve('tailwindcss', {
95
- paths: [paths.appNodeModules],
96
- }),
97
- paths.appTailwindConfig,
98
- ]
99
- : undefined,
100
- require.resolve('postcss-custom-properties'),
101
- require.resolve('autoprefixer'),
102
- ]),
103
- },
104
- },
105
- },
106
- {
107
- loader: require.resolve('resolve-url-loader'),
108
- options: {sourceMap: ifNotMin()},
109
- },
110
- {
111
- loader: require.resolve('sass-loader'),
112
- options: {api: 'modern-compiler', sourceMap: true},
113
- },
114
- ])
115
- }
116
-
117
- const config: Configuration = {
118
- mode: ifMin('production', 'development'),
119
- resolve: {
120
- symlinks: false,
121
- extensions: [...extensions, '...'],
122
- modules: ['node_modules', paths.appNodeModules],
123
- plugins: [
124
- new TsconfigPathsPlugin({
125
- configFile: paths.appTsConfig,
126
- extensions,
127
- }),
128
- ],
129
- },
130
- entry: paths.appEntry,
131
- output: {
132
- publicPath: 'auto',
133
- path: ifMin(paths.appDist, undefined),
134
- pathinfo: false,
135
- filename: ifCore('index.js', 'widget.js'),
136
- chunkFilename: ifMin('[name]-[contenthash:16].js', '[name].js'),
137
- assetModuleFilename: 'assets/[name]-[contenthash:16][ext]',
138
- crossOriginLoading: 'anonymous',
139
- uniqueName: process.env.WEBPACK_UNIQUE_NAME,
140
- },
141
- stats: ifAnalyze(
142
- {
143
- all: undefined,
144
- },
145
- {
146
- modules: false,
147
- children: false,
148
- chunks: false,
149
- env: true,
150
- entrypoints: true,
151
- errorDetails: true,
152
- },
153
- ),
154
- module: {
155
- rules: removeEmpty([
156
- // Source maps
157
- ifNotMin({
158
- enforce: 'pre',
159
- exclude: /@babel\/runtime/,
160
- test: /\.(js|jsx|ts|tsx|css|scss)$/,
161
- use: require.resolve('source-map-loader'),
162
- }),
163
-
164
- {
165
- oneOf: [
166
- /**
167
- * App Javascript and Typescript (Babel)
168
- * and some dependencies distributed in a non-es5 formats
169
- */
170
- {
171
- test: /\.(js|ts)x?$/,
172
- include: ifCore(
173
- [
174
- resolveApp('src'),
175
- resolveApp('node_modules/micromark'),
176
- resolveApp('node_modules/decode-named-character-reference'),
177
- ],
178
- [resolveApp('.'), resolveApp('../../src')],
179
- ),
180
-
181
- loader: require.resolve('babel-loader'),
182
- options: {
183
- babelrc: false,
184
- configFile: false,
185
- sourceMaps: ifNotMin(),
186
- inputSourceMap: ifNotMin(),
187
- presets: [
188
- require.resolve('@babel/preset-env'),
189
- [
190
- require.resolve('@babel/preset-typescript'),
191
- {
192
- allowDeclareFields: true,
193
- },
194
- ],
195
- require.resolve('@babel/preset-react'),
196
- ],
197
- plugins: removeEmpty([
198
- [
199
- require.resolve('@babel/plugin-transform-runtime'),
200
- {
201
- corejs: {
202
- version: 3,
203
- proposals: true,
204
- },
205
- absoluteRuntime: dirname(
206
- require.resolve('@babel/runtime-corejs3/package.json'),
207
- ),
208
- },
209
- ],
210
- [
211
- require.resolve('@babel/plugin-proposal-decorators'),
212
- {
213
- legacy: true,
214
- },
215
- ],
216
- require.resolve('@babel/plugin-syntax-dynamic-import'),
217
- require.resolve('babel-plugin-lodash'),
218
- ifHmr(require.resolve('react-refresh/babel')),
219
- ifNotMin(require.resolve('babel-plugin-istanbul')),
220
- ]),
221
- },
222
- },
223
-
224
- // Other Javascript (not in app) - no transformation
225
- {
226
- test: /\.(js|mjs)$/,
227
- },
228
-
229
- // Styles (extracted)
230
- {
231
- test: /\.s?css$/,
232
- resourceQuery: {not: [/inline/]},
233
- use: getCssLoaders({
234
- styleLoader: true,
235
- }),
236
- },
237
-
238
- // Styles (as string)
239
- {
240
- test: /\.s?css$/,
241
- resourceQuery: /inline/,
242
- use: getCssLoaders({
243
- styleLoader: false,
244
- exportType: 'string',
245
- sourceMap: false,
246
- }),
247
- },
248
-
249
- // Images and fonts
250
- {
251
- test: /\.(png|jpe?g|svg|webp|gif|ico|ttf|eot|woff2?)$/,
252
- type: 'asset',
253
- parser: {
254
- dataUrlCondition: {
255
- maxSize: imageInlineSizeLimit,
256
- },
257
- },
258
- },
259
-
260
- // YML
261
- {
262
- test: /\.ya?ml$/,
263
- use: [
264
- {loader: require.resolve('json-loader')},
265
- {
266
- loader: require.resolve('yaml-loader'),
267
- options: {asJSON: true},
268
- },
269
- ],
270
- },
271
-
272
- // HTML
273
- {
274
- test: /\.html$/,
275
- loader: require.resolve('html-loader'),
276
- options: {
277
- minimize: false,
278
- },
279
- },
280
-
281
- /**
282
- * All other files - fallback
283
- * This must be the latest rule!
284
- */
285
- {
286
- exclude: [/^$/, /\.(js|jsx|ts|tsx|mjs)$/, /\.html$/, /\.json$/],
287
- type: 'asset/resource',
288
- },
289
- ],
290
- },
291
- ]),
292
- },
293
-
294
- devtool: ifMin(false, 'cheap-module-source-map'),
295
-
296
- devServer: {
297
- static: false,
298
- historyApiFallback: {
299
- disableDotRule: true,
300
- },
301
- hot: ifHmr(),
302
- headers: {
303
- 'Access-Control-Allow-Origin': '*',
304
- },
305
- allowedHosts: 'all',
306
- client: {
307
- overlay: {
308
- warnings: false,
309
- errors: true,
310
- },
311
- },
312
- server: ifHttps({
313
- type: 'https',
314
- options: {
315
- cert: resolve(paths.root, HTTPS_CRT_FILE),
316
- key: resolve(paths.root, HTTPS_KEY_FILE),
317
- },
318
- }),
319
- },
320
-
321
- optimization: {
322
- // minimize: false,
323
- removeEmptyChunks: true,
324
- // moduleIds: 'deterministic', // todo: use instead of HashedModuleIdsPlugin
325
- // chunkIds: 'named',
326
- minimizer: ['...', new CssMinimizerPlugin()], // sourceMaps: true?
327
- },
328
-
329
- plugins: removeEmpty([
330
- new webpack.ProgressPlugin(),
331
- ifNolint(
332
- false,
333
- new ESLintPlugin({
334
- extensions: moduleFileExtensions,
335
- eslintPath: require.resolve('eslint'),
336
- cwd: paths.app,
337
- resolvePluginsRelativeTo: paths.app,
338
- }),
339
- ),
340
- ifMin(
341
- new CleanWebpackPlugin({
342
- // verbose: true,
343
- }),
344
- ),
345
-
346
- ...appHtmlFiles.map(
347
- (file) =>
348
- new HtmlWebpackPlugin({
349
- template: file,
350
- filename: basename(file),
351
- inject: false,
352
- minify: false,
353
- // ...ifMin({
354
- // minify: {
355
- // collapseWhitespace: true,
356
- // removeComments: true,
357
- // removeRedundantAttributes: true,
358
- // removeScriptTypeAttributes: true,
359
- // removeStyleLinkTypeAttributes: true,
360
- // useShortDoctype: true,
361
- // quoteCharacter: '"',
362
- // minifyJS: true,
363
- // minifyCSS: true,
364
- // },
365
- // }),
366
- }),
367
- ),
368
-
369
- new InterpolateHtmlPlugin(envVars.raw),
370
- new webpack.DefinePlugin(envVars.stringified),
371
-
372
- new ForkTsCheckerWebpackPlugin({
373
- typescript: {
374
- typescriptPath: require.resolve('typescript', {
375
- paths: [paths.appNodeModules],
376
- }),
377
- configFile: paths.appTsConfig,
378
- mode: 'write-references',
379
- diagnosticOptions: {
380
- syntactic: true,
381
- semantic: true,
382
- declaration: false,
383
- global: false,
384
- },
385
- },
386
- }),
387
-
388
- ifHmr(new ReactRefreshWebpackPlugin()),
389
-
390
- ifMin(
391
- new MiniCssExtractPlugin({
392
- filename: '[name]-[contenthash:16].css',
393
- chunkFilename: '[name]-[contenthash:16].css',
394
- ignoreOrder: true,
395
- attributes: {
396
- 'data-widget': process.env.ELEMENT_ATTRIBUTE_DATA_WIDGET!,
397
- },
398
- }),
399
- ),
400
-
401
- new webpack.IgnorePlugin({
402
- resourceRegExp: /^\.\/locale$/,
403
- contextRegExp: /moment$/,
404
- }),
405
-
406
- // eslint-disable-next-line import/no-named-as-default-member
407
- ifMin(new webpack.ids.HashedModuleIdsPlugin()), // todo: remove?
408
-
409
- ifMin() && ifCore()
410
- ? new CopyPlugin({
411
- patterns: ['*.md', '*.html'],
412
- })
413
- : undefined,
414
-
415
- ifMin() && ifAnalyze()
416
- ? new StatoscopeWebpackPlugin({
417
- name: ifCore('tamaro-core', 'tamaro-customer-config'),
418
- saveReportTo: 'reports/report.html',
419
- saveStatsTo: 'reports/stats-[name]-[hash].json',
420
- additionalStats: globSync('reports/*.json'),
421
- open: false,
422
- })
423
- : undefined,
424
- ]),
425
-
426
- infrastructureLogging: {
427
- stream: process.stdout,
428
- appendOnly: false,
429
- },
430
- }
431
-
432
- // console.log(util.inspect(config, {showHidden: false, depth: null}))
433
-
434
- return removeEmpty(config)
435
- }
436
-
437
- export default getWebpackConfig