Skip to content

Commit b4238c0

Browse files
committed
add deprecation warning for github-actions
1 parent d0c3955 commit b4238c0

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

.changeset/sixty-cases-fry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
'create-rock': minor
2+
'create-rock': patch
33
---
44

55
feat: add remote cache provider setup

packages/config/src/lib/config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,13 @@ export async function getConfig(
172172
getRemoteCacheProvider: async () => {
173173
// special case for github-actions
174174
if (validatedConfig.remoteCacheProvider === 'github-actions') {
175+
logger.warnOnce('github-actions')(
176+
`Using shorthand "github-actions" as "remoteCacheProvider" value in ${colorLink(
177+
'rock.config.mjs',
178+
)} is deprecated. It will be removed in future releases.
179+
Please use "@rock-js/provider-github" plugin explicitly instead.
180+
Read more: ${colorLink('https://rockjs.dev/docs/configuration#github-actions-provider')}`,
181+
);
175182
const { providerGitHub } = await import('@rock-js/provider-github');
176183
return providerGitHub();
177184
}

packages/tools/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ export {
2222
handleUploadResponse,
2323
} from './lib/build-cache/fetchCachedBuild.js';
2424
export { getInfoPlist } from './lib/getInfoPlist.js';
25-
export { getReactNativeVersion } from './lib/getReactNativeVersion.js';
25+
export { getReactNativeVersion } from './lib/getReactNativeVersion.js';

packages/tools/src/lib/logger.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import util from 'node:util';
22
import { log as clackLog } from '@clack/prompts';
33
import isUnicodeSupported from 'is-unicode-supported';
4+
import cacheManager from './cacheManager.js';
45
import { color } from './color.js';
56
import { isInteractive } from './isInteractive.js';
67

@@ -28,6 +29,16 @@ const warn = (...messages: Array<unknown>) => {
2829
clackLog.warn(mapLines(output, color.yellow));
2930
};
3031

32+
const warnOnce =
33+
(key: string) =>
34+
(...messages: Array<unknown>) => {
35+
if (cacheManager.get(`warnOnce-${key}`)) {
36+
return;
37+
}
38+
warn(...messages);
39+
cacheManager.set(`warnOnce-${key}`, 'true');
40+
};
41+
3142
const error = (...messages: Array<unknown>) => {
3243
const output = util.format(...messages);
3344
clackLog.error(mapLines(output, color.red));
@@ -60,6 +71,7 @@ export default {
6071
success,
6172
info,
6273
warn,
74+
warnOnce,
6375
error,
6476
debug,
6577
log,

0 commit comments

Comments
 (0)