react-cosmos 7.0.0-beta.1 → 7.0.0-beta.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.
|
@@ -16,3 +16,4 @@ export declare function getDecoratorPatterns(): string[];
|
|
|
16
16
|
export declare function createImportMap(paths: string[], rootDir: string, relativeToDir: string | null): Record<string, string>;
|
|
17
17
|
export declare function importKeyPath(filePath: string, rootDir: string): string;
|
|
18
18
|
export declare function importPath(filePath: string, relativeToDir: string | null): string;
|
|
19
|
+
export declare function sortedImportKeys(importMap: Record<string, string>): string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { flatten } from 'lodash-es';
|
|
2
|
-
import { createImportMap, importPath, } from './shared.js';
|
|
2
|
+
import { createImportMap, importPath, sortedImportKeys, } from './shared.js';
|
|
3
3
|
export function userImportsLazyTemplate({ globalImports, modulePaths: { fixturePaths, decoratorPaths }, rendererConfig, rootDir, relativeToDir, typeScript, }) {
|
|
4
4
|
function ext(filePath) {
|
|
5
5
|
// Add compat with projects where allowImportingTsExtensions isn't enabled
|
|
@@ -10,10 +10,10 @@ export function userImportsLazyTemplate({ globalImports, modulePaths: { fixtureP
|
|
|
10
10
|
}
|
|
11
11
|
const globalImportItems = globalImports.map(p => `import '${ext(importPath(p, relativeToDir))}';`);
|
|
12
12
|
const fixtures = createImportMap(fixturePaths, rootDir, relativeToDir);
|
|
13
|
-
const fixtureKeys =
|
|
13
|
+
const fixtureKeys = sortedImportKeys(fixtures);
|
|
14
14
|
const fixtureItems = fixtureKeys.map(k => ` '${k}': { getModule: () => import('${ext(fixtures[k])}') }`);
|
|
15
15
|
const decorators = createImportMap(decoratorPaths, rootDir, relativeToDir);
|
|
16
|
-
const decoratorKeys =
|
|
16
|
+
const decoratorKeys = sortedImportKeys(decorators);
|
|
17
17
|
const decoratorItems = decoratorKeys.map(k => ` '${k}': { getModule: () => import('${ext(decorators[k])}') }`);
|
|
18
18
|
const rendererConfigStr = JSON.stringify(rendererConfig, null, 2);
|
|
19
19
|
let importGroups = [globalImportItems];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { flatten } from 'lodash-es';
|
|
2
|
-
import { createImportMap, importPath, } from './shared.js';
|
|
2
|
+
import { createImportMap, importPath, sortedImportKeys, } from './shared.js';
|
|
3
3
|
export function userImportsTemplate({ globalImports, modulePaths: { fixturePaths, decoratorPaths }, rendererConfig, rootDir, relativeToDir, typeScript, }) {
|
|
4
4
|
function ext(filePath) {
|
|
5
5
|
// Add compat with projects where allowImportingTsExtensions isn't enabled
|
|
@@ -10,11 +10,11 @@ export function userImportsTemplate({ globalImports, modulePaths: { fixturePaths
|
|
|
10
10
|
}
|
|
11
11
|
const globalImportItems = globalImports.map(p => `import '${ext(importPath(p, relativeToDir))}';`);
|
|
12
12
|
const fixtures = createImportMap(fixturePaths, rootDir, relativeToDir);
|
|
13
|
-
const fixtureKeys =
|
|
13
|
+
const fixtureKeys = sortedImportKeys(fixtures);
|
|
14
14
|
const fixtureImports = fixtureKeys.map((k, i) => `import * as fixture${i} from '${ext(fixtures[k])}';`);
|
|
15
15
|
const fixtureItems = fixtureKeys.map((k, i) => ` '${k}': { module: fixture${i} }`);
|
|
16
16
|
const decorators = createImportMap(decoratorPaths, rootDir, relativeToDir);
|
|
17
|
-
const decoratorKeys =
|
|
17
|
+
const decoratorKeys = sortedImportKeys(decorators);
|
|
18
18
|
const decoratorImports = decoratorKeys.map((k, i) => `import * as decorator${i} from '${ext(decorators[k])}';`);
|
|
19
19
|
const decoratorItems = decoratorKeys.map((k, i) => ` '${k}': { module: decorator${i} }`);
|
|
20
20
|
const rendererConfigStr = JSON.stringify(rendererConfig, null, 2);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-cosmos",
|
|
3
|
-
"version": "7.0.0-beta.
|
|
3
|
+
"version": "7.0.0-beta.3",
|
|
4
4
|
"description": "Sandbox for developing and testing UI components in isolation",
|
|
5
5
|
"repository": "https://github.com/react-cosmos/react-cosmos/tree/main/packages/react-cosmos",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"lodash-es": "4.17.21",
|
|
16
16
|
"micromatch": "4.0.8",
|
|
17
17
|
"open": "10.1.1",
|
|
18
|
-
"pem": "1.
|
|
18
|
+
"pem": "1.14.8",
|
|
19
19
|
"react-cosmos-core": "7.0.0-beta.0",
|
|
20
20
|
"react-cosmos-renderer": "7.0.0-beta.0",
|
|
21
|
-
"react-cosmos-ui": "7.0.0-beta.
|
|
21
|
+
"react-cosmos-ui": "7.0.0-beta.3",
|
|
22
22
|
"ws": "8.18.1",
|
|
23
23
|
"yargs": "17.7.2"
|
|
24
24
|
},
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"cosmos-export": "./bin/cosmos-export.js",
|
|
28
28
|
"cosmos-native": "./bin/cosmos-native.js"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "aa66d5e8aeb7ec3cc049fe89f35918435093d18a"
|
|
31
31
|
}
|