@suss/contract-storybook 0.19.0 → 0.20.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.
- package/dist/index.cjs +4 -3
- package/dist/index.js +8 -4
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -54,6 +54,7 @@ function generateSummariesFromStories(filePaths, options = {}) {
|
|
|
54
54
|
}
|
|
55
55
|
const projectRoot = options.projectRoot ?? process.cwd();
|
|
56
56
|
const summaries = [];
|
|
57
|
+
const resolution = new import_adapter_typescript.ResolutionStore();
|
|
57
58
|
for (const sf of project.getSourceFiles()) {
|
|
58
59
|
const absPath = sf.getFilePath();
|
|
59
60
|
const relPath = import_node_path.default.relative(projectRoot, absPath);
|
|
@@ -61,7 +62,7 @@ function generateSummariesFromStories(filePaths, options = {}) {
|
|
|
61
62
|
if (meta === null) {
|
|
62
63
|
continue;
|
|
63
64
|
}
|
|
64
|
-
const stories = extractStories(sf);
|
|
65
|
+
const stories = extractStories(sf, resolution);
|
|
65
66
|
for (const story of stories) {
|
|
66
67
|
summaries.push(buildSummary(story, meta, relPath));
|
|
67
68
|
}
|
|
@@ -135,9 +136,9 @@ function unwrapToObjectLiteral(node) {
|
|
|
135
136
|
}
|
|
136
137
|
return null;
|
|
137
138
|
}
|
|
138
|
-
function extractStories(sf) {
|
|
139
|
+
function extractStories(sf, resolution) {
|
|
139
140
|
const results = [];
|
|
140
|
-
for (const [name, decls] of (0, import_adapter_typescript.exportedDeclarationsOf)(sf)) {
|
|
141
|
+
for (const [name, decls] of (0, import_adapter_typescript.exportedDeclarationsOf)(sf, resolution)) {
|
|
141
142
|
if (name === "default") {
|
|
142
143
|
continue;
|
|
143
144
|
}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,10 @@ import {
|
|
|
4
4
|
Project,
|
|
5
5
|
SyntaxKind
|
|
6
6
|
} from "ts-morph";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
exportedDeclarationsOf,
|
|
9
|
+
ResolutionStore
|
|
10
|
+
} from "@suss/adapter-typescript";
|
|
8
11
|
import { functionCallBinding } from "@suss/behavioral-ir";
|
|
9
12
|
function generateSummariesFromStories(filePaths, options = {}) {
|
|
10
13
|
const project = new Project({
|
|
@@ -23,6 +26,7 @@ function generateSummariesFromStories(filePaths, options = {}) {
|
|
|
23
26
|
}
|
|
24
27
|
const projectRoot = options.projectRoot ?? process.cwd();
|
|
25
28
|
const summaries = [];
|
|
29
|
+
const resolution = new ResolutionStore();
|
|
26
30
|
for (const sf of project.getSourceFiles()) {
|
|
27
31
|
const absPath = sf.getFilePath();
|
|
28
32
|
const relPath = path.relative(projectRoot, absPath);
|
|
@@ -30,7 +34,7 @@ function generateSummariesFromStories(filePaths, options = {}) {
|
|
|
30
34
|
if (meta === null) {
|
|
31
35
|
continue;
|
|
32
36
|
}
|
|
33
|
-
const stories = extractStories(sf);
|
|
37
|
+
const stories = extractStories(sf, resolution);
|
|
34
38
|
for (const story of stories) {
|
|
35
39
|
summaries.push(buildSummary(story, meta, relPath));
|
|
36
40
|
}
|
|
@@ -104,9 +108,9 @@ function unwrapToObjectLiteral(node) {
|
|
|
104
108
|
}
|
|
105
109
|
return null;
|
|
106
110
|
}
|
|
107
|
-
function extractStories(sf) {
|
|
111
|
+
function extractStories(sf, resolution) {
|
|
108
112
|
const results = [];
|
|
109
|
-
for (const [name, decls] of exportedDeclarationsOf(sf)) {
|
|
113
|
+
for (const [name, decls] of exportedDeclarationsOf(sf, resolution)) {
|
|
110
114
|
if (name === "default") {
|
|
111
115
|
continue;
|
|
112
116
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suss/contract-storybook",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Generate suss behavioral summaries from Storybook CSF story files.",
|
|
6
6
|
"keywords": [
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"typecheck": "tsc --noEmit"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@suss/adapter-typescript": "0.
|
|
49
|
-
"@suss/behavioral-ir": "0.
|
|
48
|
+
"@suss/adapter-typescript": "0.20.0",
|
|
49
|
+
"@suss/behavioral-ir": "0.20.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"tsup": "*",
|