@atlaskit/ads-mcp 0.13.1 → 0.13.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.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/tools/get-components/components.js +72 -76
- package/dist/cjs/tools/i18n-conversion/guide.js +6 -6
- package/dist/es2019/tools/get-components/components.js +72 -76
- package/dist/es2019/tools/i18n-conversion/guide.js +6 -17
- package/dist/esm/tools/get-components/components.js +72 -76
- package/dist/esm/tools/i18n-conversion/guide.js +6 -6
- package/dist/types/tools/get-components/components.d.ts +1 -1
- package/dist/types-ts4.5/tools/get-components/components.d.ts +1 -1
- package/package.json +4 -4
|
@@ -14,17 +14,15 @@ export const i18nConversionGuide = {
|
|
|
14
14
|
**CRITICAL: FIX ALL VIOLATIONS IN FILE**: When a specific file is mentioned (even with line numbers like \`@file.tsx:139-142\`), you MUST find and fix **ALL** @atlassian/i18n/no-literal-string-in-jsx violations in that entire file, not just the specific lines mentioned. Scan the entire file for hardcoded strings and convert them all. The line numbers are just a reference point - the goal is to fix all i18n violations in the provided file.
|
|
15
15
|
|
|
16
16
|
**CRITICAL: STRING FILTERING**: When finding eslint-disable comments, you MUST examine the actual string content. Only convert strings that contain **user-facing English text**. Many English strings are technical/non-user-facing and should NOT be converted (e.g., product names like "Jira", URLs like "https://example.com", technical IDs, symbols). Use the ESLint ignore patterns to identify which English strings to skip - strings matching ignore patterns should be LEFT AS-IS with their eslint-disable comments intact.`,
|
|
17
|
-
implementationChecklist: ['Create message constants using defineMessage (singular) at the top of the file - use defineMessage for each individual message, NOT defineMessages', 'Import: Use "@atlassian/jira-intl" for Jira files
|
|
17
|
+
implementationChecklist: ['Create message constants using defineMessage (singular) at the top of the file - use defineMessage for each individual message, NOT defineMessages', 'Import: Use "@atlassian/jira-intl" for Jira files or "react-intl-next" for non-Jira files', '**CRITICAL: i18n ID Format**: For files in `/next/packages/`, i18n ids MUST start with the package name (with dashes). Format: `{package-name}.{component-or-feature}.{message-key}`. Example: For package `comment-extension-handlers`, use `comment-extension-handlers.legacy-content-modal.close-button`. For package `rovo-ai-search`, use `rovo-ai-search.view-profile-text` or `rovo-ai-search.knowledge-cards.copy-email-address`.', '**CRITICAL: ai-non-final Suffix**: ALL new message IDs MUST end with `.ai-non-final` suffix. This applies to ALL newly created messages, regardless of whether existing messages in the file have this suffix. Format: `{message-key}.ai-non-final`. Example: `applinks.administration.list.applinks-table.system-label.ai-non-final`. This suffix indicates the message is AI-generated and may need review before finalization.', 'Add useIntl hook: const { formatMessage } = useIntl();', 'Replace hardcoded strings with formatMessage(messageKey)', 'Add descriptions (40+ chars, unique from defaultMessage) and descriptive placeholder names', 'Remove eslint-disable for no-literal-string-in-jsx ONLY after converting', '**VERIFICATION**: To verify all hardcoded strings are fixed, search for `@atlassian/i18n/no-literal-string-in-jsx` in the file. Do NOT run eslint - just search for the eslint-disable comments. If no matches are found, all hardcoded strings have been converted.'],
|
|
18
18
|
patterns: [{
|
|
19
19
|
title: 'Button Text and Action Labels',
|
|
20
20
|
description: 'Converting hardcoded button text with variables',
|
|
21
21
|
before: `<Button style={styles} onClick={onClearVersion}>
|
|
22
22
|
Exit {description.join(' ')}
|
|
23
23
|
</Button>`,
|
|
24
|
-
after:
|
|
25
|
-
import { useIntl, defineMessage } from '@atlassian/jira-intl';
|
|
24
|
+
after: `import { useIntl, defineMessage } from '@atlassian/jira-intl';
|
|
26
25
|
|
|
27
|
-
// eslint-disable-next-line jira/deprecations/ban-identifiers
|
|
28
26
|
const exitButton = defineMessage({
|
|
29
27
|
id: 'rovo-ai-search.exit-button.ai-non-final',
|
|
30
28
|
defaultMessage: 'Exit {version}',
|
|
@@ -45,10 +43,8 @@ export function MyComponent() {
|
|
|
45
43
|
title: 'Loading States and Status Messages',
|
|
46
44
|
description: 'Converting hardcoded loading and status messages',
|
|
47
45
|
before: `return <Box>Loading...</Box>;`,
|
|
48
|
-
after:
|
|
49
|
-
import { useIntl, defineMessage } from '@atlassian/jira-intl';
|
|
46
|
+
after: `import { useIntl, defineMessage } from '@atlassian/jira-intl';
|
|
50
47
|
|
|
51
|
-
// eslint-disable-next-line jira/deprecations/ban-identifiers
|
|
52
48
|
const loading = defineMessage({
|
|
53
49
|
id: 'rovo-ai-search.loading.ai-non-final',
|
|
54
50
|
defaultMessage: 'Loading...',
|
|
@@ -76,10 +72,8 @@ export function MyComponent() {
|
|
|
76
72
|
</Badge>
|
|
77
73
|
)}
|
|
78
74
|
</Box>`,
|
|
79
|
-
after:
|
|
80
|
-
import { useIntl, defineMessage } from '@atlassian/jira-intl';
|
|
75
|
+
after: `import { useIntl, defineMessage } from '@atlassian/jira-intl';
|
|
81
76
|
|
|
82
|
-
// eslint-disable-next-line jira/deprecations/ban-identifiers
|
|
83
77
|
const statusLabel = defineMessage({
|
|
84
78
|
id: 'filter.status-label.ai-non-final',
|
|
85
79
|
defaultMessage: 'Status: {status}',
|
|
@@ -109,17 +103,14 @@ export function MyComponent() {
|
|
|
109
103
|
title: 'Dynamic Text Content',
|
|
110
104
|
description: 'Converting conditional hardcoded strings',
|
|
111
105
|
before: `<Text>{state.hasMore ? 'Show more' : 'Show less'}</Text>`,
|
|
112
|
-
after:
|
|
113
|
-
import { useIntl, defineMessage } from '@atlassian/jira-intl';
|
|
106
|
+
after: `import { useIntl, defineMessage } from '@atlassian/jira-intl';
|
|
114
107
|
|
|
115
|
-
// eslint-disable-next-line jira/deprecations/ban-identifiers
|
|
116
108
|
const showMore = defineMessage({
|
|
117
109
|
id: 'work-item.comments.show-more.ai-non-final',
|
|
118
110
|
defaultMessage: 'Show more',
|
|
119
111
|
description: 'The text is shown as a button when there are more items available to display. Used in the comments section footer to expand and show additional content.',
|
|
120
112
|
});
|
|
121
113
|
|
|
122
|
-
// eslint-disable-next-line jira/deprecations/ban-identifiers
|
|
123
114
|
const showLess = defineMessage({
|
|
124
115
|
id: 'work-item.comments.show-less.ai-non-final',
|
|
125
116
|
defaultMessage: 'Show less',
|
|
@@ -142,10 +133,8 @@ export function MyComponent() {
|
|
|
142
133
|
title: 'ICU Format for Numeric Values',
|
|
143
134
|
description: 'Converting numeric placeholders to ICU plural format',
|
|
144
135
|
before: `const moreMessage = \`+ \${count} more\`;`,
|
|
145
|
-
after:
|
|
146
|
-
import { useIntl, defineMessage } from '@atlassian/jira-intl';
|
|
136
|
+
after: `import { useIntl, defineMessage } from '@atlassian/jira-intl';
|
|
147
137
|
|
|
148
|
-
// eslint-disable-next-line jira/deprecations/ban-identifiers
|
|
149
138
|
const moreProjectsMessage = defineMessage({
|
|
150
139
|
id: 'app.more-projects.ai-non-final',
|
|
151
140
|
defaultMessage: '{count, plural, one {+ # more} other {+ # more}}',
|