@tramvai/storybook-addon 2.66.0 → 2.66.3
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type Config from 'webpack-chain';
|
|
2
|
-
import type { ConfigManager } from '@tramvai/cli';
|
|
2
|
+
import type { CliConfigEntry, ConfigManager } from '@tramvai/cli';
|
|
3
3
|
import type { StorybookOptions } from '../types';
|
|
4
4
|
export declare function addEnvVariables({ webpackConfig, configManager, options, }: {
|
|
5
5
|
webpackConfig: Config;
|
|
6
|
-
configManager: ConfigManager
|
|
6
|
+
configManager: ConfigManager<CliConfigEntry>;
|
|
7
7
|
options: StorybookOptions;
|
|
8
8
|
}): void;
|
|
@@ -8,7 +8,6 @@ const cli_1 = require("@tramvai/cli");
|
|
|
8
8
|
const options_1 = require("../utils/options");
|
|
9
9
|
function addEnvVariables({ webpackConfig, configManager, options, }) {
|
|
10
10
|
const rootDir = (0, options_1.getAppRootDir)(options);
|
|
11
|
-
const env = configManager.env === 'development' ? 'dev' : 'prod';
|
|
12
11
|
let envFromFile = {};
|
|
13
12
|
try {
|
|
14
13
|
envFromFile = require(path_1.default.join(rootDir, 'env.development.js'));
|
|
@@ -17,7 +16,7 @@ function addEnvVariables({ webpackConfig, configManager, options, }) {
|
|
|
17
16
|
console.error('env.development.js parsing failed, reason:', e);
|
|
18
17
|
}
|
|
19
18
|
webpackConfig.plugin('define').use(webpack_1.default.DefinePlugin, [
|
|
20
|
-
Object.assign(Object.assign({}, configManager.
|
|
19
|
+
Object.assign(Object.assign(Object.assign({}, configManager.define.shared), configManager.define[configManager.env]), { 'process.env.NODE_ENV': JSON.stringify(configManager.env), 'process.env.APP_ID': JSON.stringify(configManager.name), 'process.env.BROWSER': true, 'process.env.SERVER': false,
|
|
21
20
|
// pass `env.development.js` content to client code for env manager
|
|
22
21
|
'process.env.TRAMVAI_ENV_FROM_FILE': JSON.stringify(envFromFile) }),
|
|
23
22
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addEnvVariables.js","sourceRoot":"","sources":["../../src/webpack/addEnvVariables.ts"],"names":[],"mappings":";;;;AAAA,wDAAwB;AACxB,8DAA8B;AAG9B,sCAA2C;AAC3C,8CAAiD;AAGjD,SAAgB,eAAe,CAAC,EAC9B,aAAa,EACb,aAAa,EACb,OAAO,GAKR;IACC,MAAM,OAAO,GAAG,IAAA,uBAAa,EAAC,OAAO,CAAC,CAAC;IACvC,
|
|
1
|
+
{"version":3,"file":"addEnvVariables.js","sourceRoot":"","sources":["../../src/webpack/addEnvVariables.ts"],"names":[],"mappings":";;;;AAAA,wDAAwB;AACxB,8DAA8B;AAG9B,sCAA2C;AAC3C,8CAAiD;AAGjD,SAAgB,eAAe,CAAC,EAC9B,aAAa,EACb,aAAa,EACb,OAAO,GAKR;IACC,MAAM,OAAO,GAAG,IAAA,uBAAa,EAAC,OAAO,CAAC,CAAC;IACvC,IAAI,WAAW,GAA2B,EAAE,CAAC;IAE7C,IAAI;QACF,WAAW,GAAG,OAAO,CAAC,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC;KACjE;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,KAAK,CAAC,4CAA4C,EAAE,CAAC,CAAC,CAAC;KAChE;IAED,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,iBAAO,CAAC,YAAY,EAAE;sDAElD,aAAa,CAAC,MAAM,CAAC,MAAM,GAC3B,aAAa,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,KAC1C,sBAAsB,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC,EACzD,oBAAoB,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,EACxD,qBAAqB,EAAE,IAAI,EAC3B,oBAAoB,EAAE,KAAK;YAC3B,mEAAmE;YACnE,mCAAmC,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;KAEnE,CAAC,CAAC;IAEH,IAAA,iBAAW,EAAC,aAAa,CAAC,CAAC,aAAa,CAAC,CAAC;AAC5C,CAAC;AAhCD,0CAgCC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/storybook-addon",
|
|
3
|
-
"version": "2.66.
|
|
3
|
+
"version": "2.66.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/preset.js",
|
|
6
6
|
"typings": "lib/preset.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"registry": "https://registry.npmjs.org/"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@tramvai/test-mocks": "2.66.
|
|
23
|
+
"@tramvai/test-mocks": "2.66.3",
|
|
24
24
|
"@tinkoff/is-modern-lib": "2.0.6",
|
|
25
25
|
"webpack-chain": "^6.5.1",
|
|
26
26
|
"webpack-merge": "^5.8.0",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"webpack": "5.75.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@tramvai/cli": "2.66.
|
|
36
|
-
"@tramvai/core": "2.66.
|
|
37
|
-
"@tramvai/state": "2.66.
|
|
38
|
-
"@tramvai/react": "2.66.
|
|
39
|
-
"@tramvai/tokens-common": "2.66.
|
|
35
|
+
"@tramvai/cli": "2.66.3",
|
|
36
|
+
"@tramvai/core": "2.66.3",
|
|
37
|
+
"@tramvai/state": "2.66.3",
|
|
38
|
+
"@tramvai/react": "2.66.3",
|
|
39
|
+
"@tramvai/tokens-common": "2.66.3",
|
|
40
40
|
"@tinkoff/dippy": "0.8.12",
|
|
41
41
|
"@tinkoff/router": "0.2.7",
|
|
42
42
|
"@tinkoff/url": "0.8.4",
|