@atlaskit/icon 23.9.1 → 23.10.1
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
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/icon
|
|
2
2
|
|
|
3
|
+
## 23.10.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#116447](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116447)
|
|
8
|
+
[`d0c45e793a17d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d0c45e793a17d) -
|
|
9
|
+
Remove old codemod.
|
|
10
|
+
|
|
11
|
+
## 23.10.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#116138](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116138)
|
|
16
|
+
[`b50c5d5d65ae2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b50c5d5d65ae2) -
|
|
17
|
+
Bump to the latest version of @compiled/react
|
|
18
|
+
|
|
3
19
|
## 23.9.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/icon",
|
|
3
|
-
"version": "23.
|
|
3
|
+
"version": "23.10.1",
|
|
4
4
|
"description": "An icon is a symbol representing a command, device, directory, or common action.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -82,29 +82,29 @@
|
|
|
82
82
|
"@af/integration-testing": "*",
|
|
83
83
|
"@af/visual-regression": "*",
|
|
84
84
|
"@atlaskit/button": "^20.3.12",
|
|
85
|
-
"@atlaskit/code": "^15.
|
|
86
|
-
"@atlaskit/css": "^0.
|
|
85
|
+
"@atlaskit/code": "^15.8.0",
|
|
86
|
+
"@atlaskit/css": "^0.9.0",
|
|
87
87
|
"@atlaskit/docs": "*",
|
|
88
88
|
"@atlaskit/ds-lib": "^3.5.0",
|
|
89
|
-
"@atlaskit/form": "^11.0
|
|
90
|
-
"@atlaskit/heading": "^4.
|
|
89
|
+
"@atlaskit/form": "^11.2.0",
|
|
90
|
+
"@atlaskit/heading": "^4.3.0",
|
|
91
91
|
"@atlaskit/icon-file-type": "^6.8.0",
|
|
92
92
|
"@atlaskit/icon-object": "^6.11.0",
|
|
93
|
-
"@atlaskit/link": "^2.
|
|
94
|
-
"@atlaskit/logo": "^15.
|
|
93
|
+
"@atlaskit/link": "^2.2.0",
|
|
94
|
+
"@atlaskit/logo": "^15.4.0",
|
|
95
95
|
"@atlaskit/menu": "^2.14.0",
|
|
96
96
|
"@atlaskit/modal-dialog": "^12.19.3",
|
|
97
|
-
"@atlaskit/primitives": "^13.
|
|
97
|
+
"@atlaskit/primitives": "^13.6.0",
|
|
98
98
|
"@atlaskit/section-message": "*",
|
|
99
99
|
"@atlaskit/ssr": "*",
|
|
100
|
-
"@atlaskit/textfield": "^
|
|
100
|
+
"@atlaskit/textfield": "^7.0.0",
|
|
101
101
|
"@atlaskit/theme": "^16.0.0",
|
|
102
|
-
"@atlaskit/toggle": "^14.
|
|
103
|
-
"@atlaskit/tooltip": "^19.
|
|
102
|
+
"@atlaskit/toggle": "^14.2.0",
|
|
103
|
+
"@atlaskit/tooltip": "^19.2.0",
|
|
104
104
|
"@atlaskit/visual-regression": "*",
|
|
105
105
|
"@babel/core": "7.24.9",
|
|
106
106
|
"@codeshift/utils": "^0.2.4",
|
|
107
|
-
"@compiled/react": "^0.18.
|
|
107
|
+
"@compiled/react": "^0.18.2",
|
|
108
108
|
"@testing-library/react": "^13.4.0",
|
|
109
109
|
"fs-extra": "^4.0.2",
|
|
110
110
|
"globby": "^6.1.0",
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
default as core,
|
|
3
|
-
API,
|
|
4
|
-
FileInfo,
|
|
5
|
-
ImportSpecifier,
|
|
6
|
-
ASTPath,
|
|
7
|
-
ImportDefaultSpecifier,
|
|
8
|
-
Options,
|
|
9
|
-
} from 'jscodeshift';
|
|
10
|
-
import { type Collection } from 'jscodeshift/src/Collection';
|
|
11
|
-
|
|
12
|
-
export const packageName = '@atlaskit/icon';
|
|
13
|
-
|
|
14
|
-
export default function transformer(file: FileInfo, api: API, options: Options) {
|
|
15
|
-
const j = api.jscodeshift;
|
|
16
|
-
const root = j(file.source, { quote: 'auto' });
|
|
17
|
-
if (hasImportDeclaration(j, root, packageName)) {
|
|
18
|
-
const imports = root.find(j.ImportSpecifier, {
|
|
19
|
-
imported: { name: 'metadata' },
|
|
20
|
-
});
|
|
21
|
-
imports.forEach((p: ASTPath<ImportSpecifier | ImportDefaultSpecifier>) => {
|
|
22
|
-
if (p.parentPath.parentPath.node.source.value !== packageName) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
if (p.parentPath.node.specifiers.length === 1) {
|
|
26
|
-
p.node.type = 'ImportDefaultSpecifier';
|
|
27
|
-
p.parentPath.node.source.value = `${packageName}/metadata`;
|
|
28
|
-
} else if (p.node.local) {
|
|
29
|
-
tryCreateImport({
|
|
30
|
-
j,
|
|
31
|
-
base: root,
|
|
32
|
-
packageName: `${packageName}/metadata`,
|
|
33
|
-
relativeToPackage: packageName,
|
|
34
|
-
});
|
|
35
|
-
addToImport({
|
|
36
|
-
j,
|
|
37
|
-
base: root,
|
|
38
|
-
packageName: `${packageName}/metadata`,
|
|
39
|
-
importSpecifier: j.importDefaultSpecifier(j.identifier(p.node.local.name)),
|
|
40
|
-
});
|
|
41
|
-
p.replace();
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
return root.toSource(options.printOptions || { quote: 'single' });
|
|
45
|
-
}
|
|
46
|
-
return file.source;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function hasImportDeclaration(
|
|
50
|
-
j: core.JSCodeshift,
|
|
51
|
-
source: ReturnType<typeof j>,
|
|
52
|
-
importPath: string,
|
|
53
|
-
) {
|
|
54
|
-
return !!source.find(j.ImportDeclaration).filter((path) => path.node.source.value === importPath)
|
|
55
|
-
.length;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function tryCreateImport({
|
|
59
|
-
j,
|
|
60
|
-
base,
|
|
61
|
-
relativeToPackage,
|
|
62
|
-
packageName,
|
|
63
|
-
}: {
|
|
64
|
-
j: core.JSCodeshift;
|
|
65
|
-
base: Collection<any>;
|
|
66
|
-
relativeToPackage: string;
|
|
67
|
-
packageName: string;
|
|
68
|
-
}) {
|
|
69
|
-
const exists: boolean =
|
|
70
|
-
base.find(j.ImportDeclaration).filter((path) => path.value.source.value === packageName)
|
|
71
|
-
.length > 0;
|
|
72
|
-
|
|
73
|
-
if (exists) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
base
|
|
78
|
-
.find(j.ImportDeclaration)
|
|
79
|
-
.filter((path) => path.value.source.value === relativeToPackage)
|
|
80
|
-
.insertBefore(j.importDeclaration([], j.literal(packageName)));
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function addToImport({
|
|
84
|
-
j,
|
|
85
|
-
base,
|
|
86
|
-
importSpecifier,
|
|
87
|
-
packageName,
|
|
88
|
-
}: {
|
|
89
|
-
j: core.JSCodeshift;
|
|
90
|
-
base: Collection<any>;
|
|
91
|
-
importSpecifier: ImportSpecifier | ImportDefaultSpecifier;
|
|
92
|
-
packageName: string;
|
|
93
|
-
}) {
|
|
94
|
-
base
|
|
95
|
-
.find(j.ImportDeclaration)
|
|
96
|
-
.filter((path) => path.value.source.value === packageName)
|
|
97
|
-
.replaceWith((declaration) => {
|
|
98
|
-
return j.importDeclaration(
|
|
99
|
-
[
|
|
100
|
-
// we are appending to the existing specifiers
|
|
101
|
-
// We are doing a filter hear because sometimes specifiers can be removed
|
|
102
|
-
// but they hand around in the declaration
|
|
103
|
-
...(declaration.value.specifiers || []).filter(
|
|
104
|
-
(item) => item.type === 'ImportSpecifier' && item.imported != null,
|
|
105
|
-
),
|
|
106
|
-
importSpecifier,
|
|
107
|
-
],
|
|
108
|
-
j.literal(packageName),
|
|
109
|
-
);
|
|
110
|
-
});
|
|
111
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
jest.disableAutomock();
|
|
2
|
-
|
|
3
|
-
import transformer, { packageName } from '../21.2.0-metadata-entry';
|
|
4
|
-
|
|
5
|
-
const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
|
|
6
|
-
|
|
7
|
-
describe('Update imports', () => {
|
|
8
|
-
defineInlineTest(
|
|
9
|
-
{ default: transformer, parser: 'tsx' },
|
|
10
|
-
{},
|
|
11
|
-
`
|
|
12
|
-
import { metadata } from '${packageName}';
|
|
13
|
-
console.log(metadata);
|
|
14
|
-
`,
|
|
15
|
-
`
|
|
16
|
-
import metadata from '${packageName}/metadata';
|
|
17
|
-
console.log(metadata);
|
|
18
|
-
`,
|
|
19
|
-
'should replace named metadata import from main entry point with default import from dedicated entry point',
|
|
20
|
-
);
|
|
21
|
-
defineInlineTest(
|
|
22
|
-
{ default: transformer, parser: 'tsx' },
|
|
23
|
-
{},
|
|
24
|
-
`
|
|
25
|
-
import { metadata as data } from '${packageName}';
|
|
26
|
-
console.log(data);
|
|
27
|
-
`,
|
|
28
|
-
`
|
|
29
|
-
import data from '${packageName}/metadata';
|
|
30
|
-
console.log(data);
|
|
31
|
-
`,
|
|
32
|
-
'should preserve renaming when converting from named import to default import',
|
|
33
|
-
);
|
|
34
|
-
defineInlineTest(
|
|
35
|
-
{ default: transformer, parser: 'tsx' },
|
|
36
|
-
{},
|
|
37
|
-
`
|
|
38
|
-
import { a, metadata, b } from '${packageName}';
|
|
39
|
-
console.log(metadata);
|
|
40
|
-
`,
|
|
41
|
-
`
|
|
42
|
-
import metadata from '${packageName}/metadata';
|
|
43
|
-
import { a, b } from '${packageName}';
|
|
44
|
-
console.log(metadata);
|
|
45
|
-
`,
|
|
46
|
-
'should preserve other named imports',
|
|
47
|
-
);
|
|
48
|
-
defineInlineTest(
|
|
49
|
-
{ default: transformer, parser: 'tsx' },
|
|
50
|
-
{},
|
|
51
|
-
`
|
|
52
|
-
import { a, metadata as data, b } from '${packageName}';
|
|
53
|
-
console.log(data);
|
|
54
|
-
`,
|
|
55
|
-
`
|
|
56
|
-
import data from '${packageName}/metadata';
|
|
57
|
-
import { a, b } from '${packageName}';
|
|
58
|
-
console.log(data);
|
|
59
|
-
`,
|
|
60
|
-
'should preserve other named imports, as well as metadata renaming',
|
|
61
|
-
);
|
|
62
|
-
defineInlineTest(
|
|
63
|
-
{ default: transformer, parser: 'tsx' },
|
|
64
|
-
{},
|
|
65
|
-
`
|
|
66
|
-
import Icon, { a, metadata as data, b } from '${packageName}';
|
|
67
|
-
console.log(a, data, b);
|
|
68
|
-
`,
|
|
69
|
-
`
|
|
70
|
-
import data from '${packageName}/metadata';
|
|
71
|
-
import Icon, { a, b } from '${packageName}';
|
|
72
|
-
console.log(a, data, b);
|
|
73
|
-
`,
|
|
74
|
-
'should preserve other named imports and default import, as well as metadata renaming',
|
|
75
|
-
);
|
|
76
|
-
defineInlineTest(
|
|
77
|
-
{ default: transformer, parser: 'tsx' },
|
|
78
|
-
{},
|
|
79
|
-
`
|
|
80
|
-
import metadata from '${packageName}/metadata';
|
|
81
|
-
console.log(metadata);
|
|
82
|
-
`,
|
|
83
|
-
`
|
|
84
|
-
import metadata from '${packageName}/metadata';
|
|
85
|
-
console.log(metadata);
|
|
86
|
-
`,
|
|
87
|
-
'should not affect existing good imports',
|
|
88
|
-
);
|
|
89
|
-
defineInlineTest(
|
|
90
|
-
{ default: transformer, parser: 'tsx' },
|
|
91
|
-
{},
|
|
92
|
-
`
|
|
93
|
-
import { metadata } from 'not-${packageName}';
|
|
94
|
-
`,
|
|
95
|
-
`
|
|
96
|
-
import { metadata } from 'not-${packageName}';
|
|
97
|
-
`,
|
|
98
|
-
'should not affect other packages',
|
|
99
|
-
);
|
|
100
|
-
defineInlineTest(
|
|
101
|
-
{ default: transformer, parser: 'tsx' },
|
|
102
|
-
{},
|
|
103
|
-
`
|
|
104
|
-
import { metadata } from '${packageName}/foo';
|
|
105
|
-
`,
|
|
106
|
-
`
|
|
107
|
-
import { metadata } from '${packageName}/foo';
|
|
108
|
-
`,
|
|
109
|
-
'should not affect other entrypoints',
|
|
110
|
-
);
|
|
111
|
-
defineInlineTest(
|
|
112
|
-
{ default: transformer, parser: 'tsx' },
|
|
113
|
-
{},
|
|
114
|
-
`
|
|
115
|
-
import { metadata } from '@atlaskit/icon';
|
|
116
|
-
import { metadata as objectIconMetadata } from '@atlaskit/icon-object';
|
|
117
|
-
import { metadata as fileTypeIconMetadata } from '@atlaskit/icon-file-type';
|
|
118
|
-
`,
|
|
119
|
-
`
|
|
120
|
-
import metadata from '@atlaskit/icon/metadata';
|
|
121
|
-
import { metadata as objectIconMetadata } from '@atlaskit/icon-object';
|
|
122
|
-
import { metadata as fileTypeIconMetadata } from '@atlaskit/icon-file-type';
|
|
123
|
-
`,
|
|
124
|
-
'should work as expected on a real-world case',
|
|
125
|
-
);
|
|
126
|
-
});
|