@raisenow/tamaro-cli 1.0.8 → 1.0.11

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/src/lib/env.ts ADDED
@@ -0,0 +1,102 @@
1
+ import {createRequire} from 'module'
2
+ import type {IfUtilsFn} from 'webpack-config-utils'
3
+ import {expand as dotenvExpand} from 'dotenv-expand'
4
+ import {config as dotenvConfig} from 'dotenv'
5
+ import {getWidgetUuid, resolveApp} from 'lib/resolve'
6
+
7
+ ///////////////////////////////////////////////////////////////////////////////
8
+
9
+ export type EnvVars = {
10
+ [key: string]: string | undefined
11
+ }
12
+
13
+ ///////////////////////////////////////////////////////////////////////////////
14
+
15
+ const require = createRequire(import.meta.url)
16
+
17
+ ///////////////////////////////////////////////////////////////////////////////
18
+
19
+ export const getEnvVars = (
20
+ filePath: string,
21
+ ifMin: IfUtilsFn,
22
+ ifCore: IfUtilsFn,
23
+ ifLocalCore: IfUtilsFn,
24
+ ) => {
25
+ dotenvExpand(dotenvConfig({path: filePath}))
26
+
27
+ process.env.NODE_ENV ??= ifMin('production', 'development')
28
+ process.env.BABEL_ENV ??= ifMin('production', 'development')
29
+ process.env.EXPOSE_VAR ??= ifCore('rnw.tamaroCore', 'rnw.tamaro')
30
+ process.env.ELEMENT_ATTRIBUTE_DATA_WIDGET ??= ifCore(
31
+ 'rnw-tamaro-core',
32
+ 'rnw-tamaro',
33
+ )
34
+ process.env.WEBPACK_UNIQUE_NAME ??= ifCore('RnwTamaroCore', 'RnwTamaro')
35
+
36
+ // HMR doesn't work in ie11, it breaks everything.
37
+ // If you want to run dev-server and test in ie11, set HMR_ENABLED to 'false'
38
+ process.env.HMR_ENABLED ??= ifMin('false', 'true')
39
+
40
+ if (ifCore()) {
41
+ process.env.PRODUCT_NAME = 'tamaro'
42
+
43
+ const corePkgPath = resolveApp('package.json')
44
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
45
+ const {version} = require(corePkgPath)
46
+
47
+ process.env.PRODUCT_VERSION = version
48
+ }
49
+
50
+ if (!ifCore()) {
51
+ process.env.WIDGET_UUID = getWidgetUuid()
52
+
53
+ if (ifLocalCore()) {
54
+ process.env.CORE_URL = `http://0.0.0.0:1234/index.js`
55
+ } else {
56
+ let version = process.env.CORE_VERSION
57
+ version = version ? `@${version}` : ''
58
+
59
+ process.env.CORE_URL ??= `https://cdn.jsdelivr.net/npm/@raisenow/tamaro-core${version}/dist/index.js`
60
+ }
61
+ }
62
+
63
+ // var names which will be exposed along with "PUBLIC_*" var names
64
+ const varNames = [
65
+ // common
66
+ 'NODE_ENV',
67
+ 'BABEL_ENV',
68
+ 'EXPOSE_VAR',
69
+ 'ELEMENT_ATTRIBUTE_DATA_WIDGET',
70
+ 'WEBPACK_UNIQUE_NAME',
71
+
72
+ // core
73
+ 'PRODUCT_NAME',
74
+ 'PRODUCT_VERSION',
75
+
76
+ // config
77
+ 'WIDGET_UUID',
78
+ 'CORE_URL',
79
+ 'CORE_VERSION', // must be explicitly specified in each config
80
+ 'IS_CREDIT_CARD_IFRAME',
81
+ ]
82
+
83
+ // Collect all vars which names start from "PUBLIC_" or present in "varNames" array
84
+ const raw = Object.keys(process.env)
85
+ .filter((key) => /^PUBLIC_/.test(key) || varNames.includes(key))
86
+ .reduce<EnvVars>((env, key) => {
87
+ env[key] = process.env[key]
88
+
89
+ return env
90
+ }, {})
91
+
92
+ // Stringify all values so we can feed into webpack DefinePlugin
93
+ const stringified = {
94
+ 'process.env': Object.keys(raw).reduce<EnvVars>((env, key) => {
95
+ env[key] = JSON.stringify(raw[key])
96
+
97
+ return env
98
+ }, {}),
99
+ }
100
+
101
+ return {raw, stringified}
102
+ }
@@ -0,0 +1,32 @@
1
+ import chalk from 'chalk'
2
+ import stripIndent from 'strip-indent'
3
+ import columnify from 'columnify'
4
+
5
+ ///////////////////////////////////////////////////////////////////////////////
6
+
7
+ export const logTitle = (title: string) => {
8
+ console.log(`${chalk.bold(title)}`)
9
+ }
10
+
11
+ ///////////////////////////////////////////////////////////////////////////////
12
+
13
+ export const logError = (message?: string) => {
14
+ if (message) {
15
+ console.log(chalk.red(message))
16
+ }
17
+ }
18
+
19
+ ///////////////////////////////////////////////////////////////////////////////
20
+
21
+ export const logCommand = (cmd: string): void => {
22
+ console.log(`\n${chalk.dim(stripIndent(cmd).trim())}\n`)
23
+ }
24
+
25
+ ///////////////////////////////////////////////////////////////////////////////
26
+
27
+ export const logDataTable = (data: {
28
+ [key: string]: string | undefined
29
+ }): void => {
30
+ console.log(columnify(data, {showHeaders: false}))
31
+ console.log('')
32
+ }
@@ -0,0 +1,22 @@
1
+ import notifier from 'node-notifier'
2
+ import stripIndent from 'strip-indent'
3
+
4
+ ///////////////////////////////////////////////////////////////////////////////
5
+
6
+ export type NotifyArgs = {
7
+ title: string
8
+ message: string
9
+ }
10
+
11
+ ///////////////////////////////////////////////////////////////////////////////
12
+
13
+ export const notify = (args: NotifyArgs) => {
14
+ const {title, message = ''} = args
15
+
16
+ notifier.notify({
17
+ title,
18
+ message: stripIndent(message).trim(),
19
+ contentImage: 'https://assets.raisenow.io/favicon.png',
20
+ sound: 'Funk',
21
+ })
22
+ }
@@ -0,0 +1,144 @@
1
+ import {createRequire} from 'module'
2
+ import {basename, dirname, join, relative, resolve} from 'path'
3
+ import {existsSync, realpathSync} from 'fs'
4
+ import {getIfUtils, IfUtils, IfUtilsFn} from 'webpack-config-utils'
5
+ import {logError} from 'lib/logging'
6
+ import stripIndent from 'strip-indent'
7
+ import chalk from 'chalk'
8
+
9
+ ///////////////////////////////////////////////////////////////////////////////
10
+
11
+ export type ResolveFn = (relativePath: string) => string
12
+
13
+ ///////////////////////////////////////////////////////////////////////////////
14
+
15
+ const require = createRequire(import.meta.url)
16
+ export const moduleFileExtensions = ['ts', 'tsx', 'js', 'jsx']
17
+ export const extensions = moduleFileExtensions.map((v) => `.${v}`)
18
+
19
+ ///////////////////////////////////////////////////////////////////////////////
20
+
21
+ const TAMARO_CORE_PACKAGE_NAMES = ['@raisenow/tamaro-core']
22
+ const TAMARO_CONFIGURATIONS_PACKAGE_NAMES = ['@raisenow/tamaro-configurations']
23
+
24
+ ///////////////////////////////////////////////////////////////////////////////
25
+
26
+ export const resolveApp: ResolveFn = (relativePath) =>
27
+ resolve(realpathSync(process.cwd()), relativePath)
28
+
29
+ ///////////////////////////////////////////////////////////////////////////////
30
+
31
+ // __dirname is "dist" in runtime
32
+ export const resolveOwn: ResolveFn = (relativePath) =>
33
+ resolve(__dirname, '..', relativePath)
34
+
35
+ ///////////////////////////////////////////////////////////////////////////////
36
+
37
+ export const resolveModule = (resolveFn: ResolveFn, filePath: string) => {
38
+ const extension = moduleFileExtensions.find((extension) =>
39
+ existsSync(resolveFn(`${filePath}.${extension}`)),
40
+ )
41
+
42
+ if (extension) {
43
+ return resolveFn(`${filePath}.${extension}`)
44
+ }
45
+
46
+ return resolveFn(`${filePath}.js`)
47
+ }
48
+
49
+ ///////////////////////////////////////////////////////////////////////////////
50
+
51
+ export const resolveBin = (name: string) => {
52
+ const pkgPath = require.resolve(`${name}/package.json`)
53
+ const {bin} = require(pkgPath)
54
+ const dir = dirname(pkgPath)
55
+ const binPath = typeof bin === 'object' ? bin[name] : bin
56
+
57
+ return join(dir, binPath)
58
+ }
59
+
60
+ ///////////////////////////////////////////////////////////////////////////////
61
+
62
+ export const getWidgetUuid = () => basename(resolveApp('.'))
63
+
64
+ ///////////////////////////////////////////////////////////////////////////////
65
+
66
+ export const getPaths = (ifCore: IfUtilsFn) => {
67
+ return ifCore(
68
+ {
69
+ app: resolveApp('.'),
70
+ appEntry: resolveModule(resolveApp, 'src/index'),
71
+ appDist: resolveApp('dist'),
72
+ appNodeModules: resolveApp('node_modules'),
73
+ appTsConfig: resolveApp('tsconfig.json'),
74
+ appHtml: resolveApp('src/*.html'),
75
+ appEnv: resolveApp('.env'),
76
+ appTailwindConfig: resolveApp('tailwind.config.js'),
77
+ },
78
+ {
79
+ app: resolveApp('.'),
80
+ appEntry: resolveModule(resolveApp, 'widget'),
81
+ appDist: resolveApp(`../../dist/${getWidgetUuid()}`),
82
+ appNodeModules: resolveApp('../../node_modules'),
83
+ appTsConfig: resolveApp('tsconfig.json'),
84
+ appHtml: resolveApp('*.html'),
85
+ appEnv: resolveApp('.env'),
86
+ appTailwindConfig: undefined,
87
+ },
88
+ )
89
+ }
90
+
91
+ ///////////////////////////////////////////////////////////////////////////////
92
+
93
+ type Paths = {
94
+ [key: string]: string | undefined
95
+ }
96
+
97
+ export const getRelativePaths = (paths: Paths): Paths => {
98
+ const relativePaths: Paths = {}
99
+
100
+ for (const [type, absPath] of Object.entries(paths)) {
101
+ if (absPath) {
102
+ relativePaths[type] = relative('./', absPath) || '.'
103
+ }
104
+ }
105
+
106
+ return relativePaths
107
+ }
108
+
109
+ ///////////////////////////////////////////////////////////////////////////////
110
+
111
+ export const getIfCoreFns = (): IfUtils => {
112
+ const corePkgPath = resolveApp('package.json')
113
+ const configsPkgPath = resolveApp('../../package.json')
114
+
115
+ if (existsSync(corePkgPath)) {
116
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
117
+ const {name} = require(corePkgPath)
118
+
119
+ if (TAMARO_CORE_PACKAGE_NAMES.includes(name)) {
120
+ return getIfUtils({core: true}, ['core'])
121
+ }
122
+ }
123
+
124
+ if (existsSync(configsPkgPath)) {
125
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
126
+ const {name} = require(configsPkgPath)
127
+
128
+ if (TAMARO_CONFIGURATIONS_PACKAGE_NAMES.includes(name)) {
129
+ return getIfUtils({core: false}, ['core'])
130
+ }
131
+ }
132
+
133
+ logError(
134
+ stripIndent(`\
135
+ You must run "npx @raisenow/tamaro-cli" commands from:
136
+ 1. Root of "${chalk.bold(TAMARO_CORE_PACKAGE_NAMES[0])}" package folder.
137
+ 2. Root of particular customer configuration folder of "${chalk.bold(
138
+ TAMARO_CONFIGURATIONS_PACKAGE_NAMES[0],
139
+ )}" package.
140
+ You are currently in "${chalk.bold(realpathSync(process.cwd()))}".
141
+ `),
142
+ )
143
+ process.exit(1)
144
+ }
@@ -1,14 +1,10 @@
1
+ import {createRequire} from 'module'
1
2
  import {basename, dirname} from 'path'
3
+ import {existsSync} from 'fs'
2
4
  import glob from 'glob'
3
5
  import {getIfUtils, removeEmpty} from 'webpack-config-utils'
4
- import webpack, {
5
- Configuration,
6
- DefinePlugin,
7
- IgnorePlugin,
8
- ProgressPlugin,
9
- RuleSetUseItem,
10
- } from 'webpack'
11
- import {getPortPromise} from 'portfinder'
6
+ import webpack from 'webpack'
7
+ import type {Configuration, RuleSetUseItem} from 'webpack'
12
8
  import {TsconfigPathsPlugin} from 'tsconfig-paths-webpack-plugin'
13
9
  import {CleanWebpackPlugin} from 'clean-webpack-plugin'
14
10
  import HtmlWebpackPlugin from 'html-webpack-plugin'
@@ -21,20 +17,21 @@ import {} from 'webpack-dev-server'
21
17
  import ESLintPlugin from 'eslint-webpack-plugin'
22
18
  import CopyPlugin from 'copy-webpack-plugin'
23
19
  import StatoscopeWebpackPlugin from '@statoscope/webpack-plugin'
24
- import InterpolateHtmlPlugin from 'lib/InterpolateHtmlPlugin'
20
+ import {InterpolateHtmlPlugin} from 'lib/InterpolateHtmlPlugin'
25
21
  import {
26
22
  extensions,
27
- getEnvVars,
28
23
  getIfCoreFns,
29
24
  getPaths,
30
- logDataTable,
25
+ getRelativePaths,
31
26
  moduleFileExtensions,
32
27
  resolveApp,
33
- resolveOwn,
34
- } from 'lib/helpers'
28
+ } from 'lib/resolve'
29
+ import {getEnvVars} from 'lib/env'
30
+ import {logDataTable, logTitle} from 'lib/logging'
35
31
 
36
32
  ///////////////////////////////////////////////////////////////////////////////
37
33
 
34
+ const require = createRequire(import.meta.url)
38
35
  const imageInlineSizeLimit = 0
39
36
  // const imageInlineSizeLimit = 8 * 1024 // 8kb
40
37
 
@@ -49,10 +46,14 @@ const getWebpackConfig = async (env: any): Promise<Configuration> => {
49
46
  const appHtmlFiles = glob.sync(paths.appHtml)
50
47
  const envVars = getEnvVars(paths.appEnv, ifMin, ifCore, ifLocalCore)
51
48
  const {ifHmr} = getIfUtils({hmr: process.env.HMR_ENABLED === 'true'}, ['hmr'])
52
- const port = await getPortPromise({port: 1234})
49
+ const useTailwind =
50
+ ifCore() && paths.appTailwindConfig && existsSync(paths.appTailwindConfig)
53
51
 
54
- logDataTable(paths, 'Paths')
55
- logDataTable(envVars.raw, 'Environment variables')
52
+ logTitle('Paths:')
53
+ logDataTable(getRelativePaths(paths))
54
+
55
+ logTitle('Environment variables:')
56
+ logDataTable(envVars.raw)
56
57
 
57
58
  const getCssLoaders = (cssOptions: any = {}): RuleSetUseItem[] => {
58
59
  return removeEmpty([
@@ -78,7 +79,15 @@ const getWebpackConfig = async (env: any): Promise<Configuration> => {
78
79
  options: {
79
80
  postcssOptions: {
80
81
  plugins: removeEmpty([
81
- ifCore([require.resolve('tailwindcss'), paths.appTailwindConfig]),
82
+ useTailwind
83
+ ? [
84
+ // eslint-disable-next-line node/no-missing-require
85
+ require.resolve('tailwindcss', {
86
+ paths: [paths.appNodeModules],
87
+ }),
88
+ paths.appTailwindConfig,
89
+ ]
90
+ : undefined,
82
91
  require.resolve('postcss-custom-properties'),
83
92
  require.resolve('autoprefixer'),
84
93
  ]),
@@ -109,7 +118,7 @@ const getWebpackConfig = async (env: any): Promise<Configuration> => {
109
118
  }),
110
119
  ],
111
120
  },
112
- entry: [resolveOwn('src/lib/polyfills.js'), paths.appEntry],
121
+ entry: paths.appEntry,
113
122
  output: {
114
123
  publicPath: 'auto',
115
124
  path: ifMin(paths.appDist, undefined),
@@ -309,7 +318,6 @@ const getWebpackConfig = async (env: any): Promise<Configuration> => {
309
318
  devtool: ifMin(false, 'cheap-module-source-map'),
310
319
 
311
320
  devServer: {
312
- port,
313
321
  static: false,
314
322
  historyApiFallback: {
315
323
  disableDotRule: true,
@@ -335,7 +343,7 @@ const getWebpackConfig = async (env: any): Promise<Configuration> => {
335
343
  },
336
344
 
337
345
  plugins: removeEmpty([
338
- new ProgressPlugin(),
346
+ new webpack.ProgressPlugin(),
339
347
  new ESLintPlugin({
340
348
  extensions: moduleFileExtensions,
341
349
  eslintPath: require.resolve('eslint'),
@@ -372,7 +380,7 @@ const getWebpackConfig = async (env: any): Promise<Configuration> => {
372
380
  ),
373
381
 
374
382
  new InterpolateHtmlPlugin(envVars.raw),
375
- new DefinePlugin(envVars.stringified),
383
+ new webpack.DefinePlugin(envVars.stringified),
376
384
 
377
385
  new ForkTsCheckerWebpackPlugin({
378
386
  typescript: {
@@ -403,7 +411,7 @@ const getWebpackConfig = async (env: any): Promise<Configuration> => {
403
411
  }),
404
412
  ),
405
413
 
406
- new IgnorePlugin({
414
+ new webpack.IgnorePlugin({
407
415
  resourceRegExp: /^\.\/locale$/,
408
416
  contextRegExp: /moment$/,
409
417
  }),
@@ -412,12 +420,7 @@ const getWebpackConfig = async (env: any): Promise<Configuration> => {
412
420
 
413
421
  ifMin() && ifCore()
414
422
  ? new CopyPlugin({
415
- patterns: [
416
- {
417
- from: 'docs',
418
- to: 'docs',
419
- },
420
- ],
423
+ patterns: ['README.md', 'readme.html'],
421
424
  })
422
425
  : undefined,
423
426
 
@@ -431,6 +434,11 @@ const getWebpackConfig = async (env: any): Promise<Configuration> => {
431
434
  })
432
435
  : undefined,
433
436
  ]),
437
+
438
+ infrastructureLogging: {
439
+ stream: process.stdout,
440
+ appendOnly: false,
441
+ },
434
442
  }
435
443
 
436
444
  // console.log(util.inspect(config, {showHidden: false, depth: null}))
package/tsconfig.json CHANGED
@@ -5,7 +5,7 @@
5
5
  /* Basic Options */
6
6
  // "incremental": true, /* Enable incremental compilation */
7
7
  "target": "esnext", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
8
- "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
8
+ "module": "esnext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
9
9
  // "lib": [], /* Specify library files to be included in the compilation. */
10
10
  "allowJs": true, /* Allow javascript files to be compiled. */
11
11
  // "checkJs": true, /* Report errors in .js files. */
package/readme.md DELETED
@@ -1,201 +0,0 @@
1
- # Getting started
2
-
3
- It's a command-line interface for all operations with Tamaro customer configurations and *Tamaro Core*.
4
-
5
- You don't need to install it manually. The recommended way is to run it using `npx` command, which must be available along with `node` and `npm` commands.
6
-
7
- # Usage
8
-
9
- To see an overview of all possible commands just run the following command without any arguments:
10
-
11
- ```bash
12
- npx -y @raisenow/tamaro-cli
13
- ```
14
-
15
- To see the info about some particular command (for example `dev` command), prepend `help` before the command name:
16
-
17
- ```bash
18
- npx -y @raisenow/tamaro-cli help dev
19
- ```
20
-
21
- Substitute `dev` with the command you want to get info about.
22
-
23
- # Commands
24
-
25
- Available commands:
26
- - [dev](#dev)
27
- - [build](#build)
28
- - [deploy](#deploy)
29
- - [serve](#serve)
30
-
31
- ## dev
32
-
33
- Runs development web-server for *Tamaro Core* or particular customer configuration.
34
-
35
- Options:
36
- - `--local-core` – Load *Tamaro Core* from localhost instead of CDN
37
-
38
- ### Run development web-server using Tamaro Core from CDN
39
-
40
- Run development web-server for `example-02-typical-customisations` customer configuration.
41
-
42
- After running this command, development web-server should be running on http://localhost:1234/ (port may differ).
43
-
44
- ```bash
45
- cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
46
- npx -y @raisenow/tamaro-cli dev
47
- ```
48
-
49
- ### Run development web-server using locally running Tamaro Core
50
-
51
- 1. Run development web-server for *Tamaro Core* in the first terminal tab.
52
-
53
- After running this command, development web-server should be running on http://localhost:1234/ (port may differ).
54
-
55
- ```bash
56
- cd /path/to/tamaro-core
57
- npx -y @raisenow/tamaro-cli dev
58
- ```
59
-
60
- 2. Run development web-server for `example-02-typical-customisations` customer configuration in the second terminal tab.
61
-
62
- After running this command, development web-server should be running on http://localhost:1235/ (port may differ).
63
-
64
- ```bash
65
- cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
66
- npx -y @raisenow/tamaro-cli dev --local-core
67
- ```
68
-
69
- ## build
70
-
71
- Build optimised (minified) bundle of *Tamaro Core* or customer configuration for production.
72
-
73
- Options:
74
- - `--local-core` – Load *Tamaro Core* from localhost instead of CDN
75
- - `--analyze` – Generate bundle statistics to `reports` folder
76
- - `--deploy` – Deploy *Tamaro Core* or customer configuration bundle to AWS
77
- - `--serve` – Run web-server for the bundle
78
- - `--tag <tag>` – Tag which will be used for deployment of the bundle
79
-
80
- Before trying to deploy a bundle, make sure you have proper AWS credentials in your environment, otherwise deployment will fail.
81
- More info about configuring AWS credentials and profiles is in the [wiki page](https://raisenow.atlassian.net/wiki/spaces/DEVOPS/pages/3201731220).
82
-
83
- ### Build and deploy customer configuration
84
-
85
- Build and deploy optimised (minified) bundle of `example-02-typical-customisations` customer configuration.
86
-
87
- ```bash
88
- cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
89
- npx -y @raisenow/tamaro-cli build --deploy
90
- ```
91
-
92
- As a result bundle should be deployed to: https://tamaro.raisenow.com/example-02-typical-customisations/latest/index.html
93
-
94
- ### Build and deploy customer configuration with a specific tag
95
-
96
- Build and deploy optimised (minified) bundle of `example-02-typical-customisations` customer configuration with `WEB-123` tag.
97
-
98
- ```bash
99
- cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
100
- npx -y @raisenow/tamaro-cli build --deploy --tag WEB-123
101
- ```
102
-
103
- As a result bundle should be deployed to: https://tamaro.raisenow.com/example-02-typical-customisations/WEB-123/index.html
104
-
105
- ### Build and serve customer configuration
106
-
107
- Build and serve optimised (minified) bundle of `example-02-typical-customisations` customer configuration.
108
-
109
- After running this command, web-server should be running on http://localhost:1234/ (port may differ).
110
-
111
- ```bash
112
- cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
113
- npx -y @raisenow/tamaro-cli build --serve
114
- ```
115
-
116
-
117
- ## deploy
118
-
119
- Deploy prebuilt Tamaro Core or customer configuration bundle to AWS.
120
-
121
- Options:
122
- - `--tag <tag>` – Tag which will be used for deployment of the bundle
123
-
124
- Make sure you have built the bundle before deploying it with this command, otherwise you may mistakenly deploy the bundle from previous build.
125
-
126
- Example:
127
-
128
- 1. Build optimised (minified) bundle of `example-02-typical-customisations` customer configuration.
129
-
130
- ```bash
131
- cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
132
- npx -y @raisenow/tamaro-cli build
133
- ```
134
-
135
- 2. Deploy it:
136
-
137
- ```bash
138
- npx -y @raisenow/tamaro-cli deploy
139
- ```
140
-
141
- 3. Optionally deploy it with `WEB-123` tag:
142
-
143
- ```bash
144
- npx -y @raisenow/tamaro-cli deploy --tag WEB-123
145
- ```
146
-
147
- ## serve
148
-
149
- Run web-server for prebuilt bundle.
150
-
151
- Example:
152
-
153
- 1. Build optimised (minified) bundle of `example-02-typical-customisations` customer configuration.
154
-
155
- ```bash
156
- cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
157
- npx -y @raisenow/tamaro-cli build
158
- ```
159
-
160
- 2. Serve it.
161
-
162
- After running this command, web-server should be running on http://localhost:1234/ (port may differ).
163
-
164
- ```bash
165
- npx -y @raisenow/tamaro-cli serve
166
- ```
167
-
168
-
169
- # Development
170
-
171
- Make sure you have installed and activated proper `node` and `npm` versions.
172
-
173
- - `node: ">= 16"`
174
- - `npm: ">= 8"`
175
-
176
- Clone the repo and install its dependencies:
177
-
178
- ```bash
179
- git clone git@bitbucket.org:raisenow/tamaro-cli.git
180
- cd tamaro-cli
181
- npm ci
182
- ```
183
-
184
- Link package source to be able to run its local version:
185
-
186
- ```bash
187
- npm link .
188
- ```
189
-
190
- Run the `dev` script to watch source files and automatically rebuild on changes.
191
- It must be running during *Tamaro CLI* development process.
192
-
193
- ```bash
194
- npm run dev
195
- ```
196
-
197
- To use local linked version of *Tamaro CLI*, use it without `@raisenow/` scope, `-y` flag is also not needed:
198
-
199
- ```bash
200
- npx tamaro-cli dev
201
- ```
Binary file