Skip to content

Commit 6e3ab50

Browse files
author
Daniel Del Core
committed
changesets
1 parent f24ede5 commit 6e3ab50

File tree

6 files changed

+31
-13
lines changed

6 files changed

+31
-13
lines changed

.changeset/silent-steaks-chew.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hypermod/validator': patch
3+
---
4+
5+
Fixes usage of fetchConfig to account for undefined. Now errors should be reported correctly

.changeset/slimy-mangos-refuse.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hypermod/fetcher': patch
3+
---
4+
5+
Correctly types fetchConfig function to correctly show that this function can return `undefined`

.changeset/wild-pigs-care.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hypermod/mod-atlaskit__textfield': patch
3+
---
4+
5+
Removes unused variables

community/hypermod/src/defineInlineTest-to-applyTransform/transform.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ function transformDefineInlineTestCalls(
102102
path.node.callee.property.name === 'defineInlineTest'),
103103
)
104104
.forEach(path => {
105-
const [transformerOpts, input, output, description] = path.node.arguments;
105+
const [transformerOpts, _configOpts, input, output, description] =
106+
path.node.arguments;
106107

107108
const transformer = j(transformerOpts).find(j.ObjectProperty, {
108109
key: { name: 'default' },

packages/fetcher/src/index.spec.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@ describe('fetcher', () => {
109109
require: jest.fn().mockReturnValue(mockConfig),
110110
};
111111

112-
const { filePath, config } = await fetchPackage(
112+
const configMeta = await fetchPackage(
113113
'fake-package',
114114
mockPackageManager as unknown as PluginManager,
115115
);
116116

117-
expect(config).toEqual(mockConfig);
118-
expect(filePath).toEqual(mockFilePath);
117+
expect(configMeta!.config).toEqual(mockConfig);
118+
expect(configMeta!.filePath).toEqual(mockFilePath);
119119
});
120120

121121
it('should throw if fetching fails', async () => {
@@ -148,13 +148,15 @@ describe('fetcher', () => {
148148
}),
149149
};
150150

151-
const { config, filePath } = await fetchRemotePackage(
151+
const configMeta = await fetchRemotePackage(
152152
'fake-package',
153153
mockPackageManager as unknown as PluginManager,
154154
);
155155

156-
expect(config).toEqual(mockConfig);
157-
expect(filePath).toEqual(mockBasePath + '/hypermod.config.js');
156+
expect(configMeta!.config).toEqual(mockConfig);
157+
expect(configMeta!.filePath).toEqual(
158+
mockBasePath + '/hypermod.config.js',
159+
);
158160
});
159161

160162
it('should throw if fetching fails', async () => {
@@ -181,13 +183,13 @@ describe('fetcher', () => {
181183
}),
182184
};
183185

184-
const { config, filePath } = await fetchRemotePackage(
186+
const configMeta = await fetchRemotePackage(
185187
'fake-package',
186188
mockPackageManager as unknown as PluginManager,
187189
);
188190

189-
expect(config).toEqual(mockConfig);
190-
expect(filePath).toEqual(mockBasePath + '/index.js');
191+
expect(configMeta!.config).toEqual(mockConfig);
192+
expect(configMeta!.filePath).toEqual(mockBasePath + '/index.js');
191193
});
192194

193195
it('throws if entrypoint-based config does not contain a valid config (and there are no config files available elsewhere)', async () => {

scripts/docs.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ async function main() {
7373
const directories = communityCodemods.filter(dir => junk.not(dir));
7474

7575
for (const dir of directories) {
76-
const { config } = await fetchConfig(path.join(COMMUNITY_PATH, dir));
76+
const configMeta = await fetchConfig(path.join(COMMUNITY_PATH, dir));
7777

78-
if (!config) {
78+
if (!configMeta || !configMeta.config) {
7979
throw new Error(`Unable to locate config for path: ${dir}`);
8080
}
8181

82-
data.push({ name: dir, config });
82+
data.push({ name: dir, config: configMeta.config });
8383
}
8484

8585
cleanTargetDir(DOCS_PATH);

0 commit comments

Comments
 (0)