@react-spectrum/codemods 0.6.2 → 0.7.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/dist/index.js +0 -0
- package/dist/s1-to-s2/src/codemods/components/DateField/transform.js +23 -0
- package/dist/s1-to-s2/src/codemods/components/DatePicker/transform.js +23 -0
- package/dist/s1-to-s2/src/codemods/components/DateRangePicker/transform.js +23 -0
- package/dist/s1-to-s2/src/codemods/components/TimeField/transform.js +23 -0
- package/dist/use-monopackages/src/codemod.js +3 -3
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = transformDateField;
|
|
4
|
+
const transforms_1 = require("../../shared/transforms");
|
|
5
|
+
/**
|
|
6
|
+
* Transforms DateField:
|
|
7
|
+
* - Remove isQuiet (it is no longer supported in Spectrum 2).
|
|
8
|
+
* - Change validationState="invalid" to isInvalid.
|
|
9
|
+
* - Remove validationState="valid" (it is no longer supported in Spectrum 2).
|
|
10
|
+
*/
|
|
11
|
+
function transformDateField(path) {
|
|
12
|
+
// Change validationState="invalid" to isInvalid
|
|
13
|
+
(0, transforms_1.updatePropNameAndValue)(path, {
|
|
14
|
+
oldPropName: 'validationState',
|
|
15
|
+
oldPropValue: 'invalid',
|
|
16
|
+
newPropName: 'isInvalid',
|
|
17
|
+
newPropValue: true
|
|
18
|
+
});
|
|
19
|
+
// Remove validationState="valid"
|
|
20
|
+
(0, transforms_1.removeProp)(path, { propName: 'validationState', propValue: 'valid' });
|
|
21
|
+
// Remove isQuiet
|
|
22
|
+
(0, transforms_1.removeProp)(path, { propName: 'isQuiet' });
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = transformDatePicker;
|
|
4
|
+
const transforms_1 = require("../../shared/transforms");
|
|
5
|
+
/**
|
|
6
|
+
* Transforms DatePicker:
|
|
7
|
+
* - Remove isQuiet (it is no longer supported in Spectrum 2).
|
|
8
|
+
* - Change validationState="invalid" to isInvalid.
|
|
9
|
+
* - Remove validationState="valid" (it is no longer supported in Spectrum 2).
|
|
10
|
+
*/
|
|
11
|
+
function transformDatePicker(path) {
|
|
12
|
+
// Change validationState="invalid" to isInvalid
|
|
13
|
+
(0, transforms_1.updatePropNameAndValue)(path, {
|
|
14
|
+
oldPropName: 'validationState',
|
|
15
|
+
oldPropValue: 'invalid',
|
|
16
|
+
newPropName: 'isInvalid',
|
|
17
|
+
newPropValue: true
|
|
18
|
+
});
|
|
19
|
+
// Remove validationState="valid"
|
|
20
|
+
(0, transforms_1.removeProp)(path, { propName: 'validationState', propValue: 'valid' });
|
|
21
|
+
// Remove isQuiet
|
|
22
|
+
(0, transforms_1.removeProp)(path, { propName: 'isQuiet' });
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = transformDateRangePicker;
|
|
4
|
+
const transforms_1 = require("../../shared/transforms");
|
|
5
|
+
/**
|
|
6
|
+
* Transforms DateRangePicker:
|
|
7
|
+
* - Remove isQuiet (it is no longer supported in Spectrum 2).
|
|
8
|
+
* - Change validationState="invalid" to isInvalid.
|
|
9
|
+
* - Remove validationState="valid" (it is no longer supported in Spectrum 2).
|
|
10
|
+
*/
|
|
11
|
+
function transformDateRangePicker(path) {
|
|
12
|
+
// Change validationState="invalid" to isInvalid
|
|
13
|
+
(0, transforms_1.updatePropNameAndValue)(path, {
|
|
14
|
+
oldPropName: 'validationState',
|
|
15
|
+
oldPropValue: 'invalid',
|
|
16
|
+
newPropName: 'isInvalid',
|
|
17
|
+
newPropValue: true
|
|
18
|
+
});
|
|
19
|
+
// Remove validationState="valid"
|
|
20
|
+
(0, transforms_1.removeProp)(path, { propName: 'validationState', propValue: 'valid' });
|
|
21
|
+
// Remove isQuiet
|
|
22
|
+
(0, transforms_1.removeProp)(path, { propName: 'isQuiet' });
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = transformTimeField;
|
|
4
|
+
const transforms_1 = require("../../shared/transforms");
|
|
5
|
+
/**
|
|
6
|
+
* Transforms TimeField:
|
|
7
|
+
* - Remove isQuiet (it is no longer supported in Spectrum 2).
|
|
8
|
+
* - Change validationState="invalid" to isInvalid.
|
|
9
|
+
* - Remove validationState="valid" (it is no longer supported in Spectrum 2).
|
|
10
|
+
*/
|
|
11
|
+
function transformTimeField(path) {
|
|
12
|
+
// Change validationState="invalid" to isInvalid
|
|
13
|
+
(0, transforms_1.updatePropNameAndValue)(path, {
|
|
14
|
+
oldPropName: 'validationState',
|
|
15
|
+
oldPropValue: 'invalid',
|
|
16
|
+
newPropName: 'isInvalid',
|
|
17
|
+
newPropValue: true
|
|
18
|
+
});
|
|
19
|
+
// Remove validationState="valid"
|
|
20
|
+
(0, transforms_1.removeProp)(path, { propName: 'validationState', propValue: 'valid' });
|
|
21
|
+
// Remove isQuiet
|
|
22
|
+
(0, transforms_1.removeProp)(path, { propName: 'isQuiet' });
|
|
23
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = transformer;
|
|
4
3
|
const fs = require('fs');
|
|
5
4
|
const path = require('path');
|
|
6
5
|
function areSpecifiersAlphabetized(specifiers) {
|
|
@@ -20,7 +19,7 @@ function areSpecifiersAlphabetized(specifiers) {
|
|
|
20
19
|
*
|
|
21
20
|
* Run this from a directory where the relevant packages are installed in node_modules so it knows which monopackage exports are available to use (since exports may vary by version).
|
|
22
21
|
*/
|
|
23
|
-
function transformer(file, api, options) {
|
|
22
|
+
const transformer = function transformer(file, api, options) {
|
|
24
23
|
const j = api.jscodeshift;
|
|
25
24
|
const root = j(file.source);
|
|
26
25
|
const packages = {
|
|
@@ -142,5 +141,6 @@ function transformer(file, api, options) {
|
|
|
142
141
|
}
|
|
143
142
|
});
|
|
144
143
|
return root.toSource();
|
|
145
|
-
}
|
|
144
|
+
};
|
|
146
145
|
transformer.parser = 'tsx';
|
|
146
|
+
exports.default = transformer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/codemods",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"bin": "dist/index.js",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"@babel/parser": "^7.24.5",
|
|
25
25
|
"@babel/traverse": "^7.24.5",
|
|
26
26
|
"@babel/types": "^7.24.5",
|
|
27
|
-
"@react-spectrum/s2": "^0.
|
|
28
|
-
"@react-types/shared": "^3.
|
|
27
|
+
"@react-spectrum/s2": "^0.10.1",
|
|
28
|
+
"@react-types/shared": "^3.31.0",
|
|
29
29
|
"@types/node": "^22",
|
|
30
30
|
"boxen": "^5.1.2",
|
|
31
31
|
"build": "^0.1.4",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "da09a6d39294e614822f35b9e7910e1b8a71ce9b"
|
|
54
54
|
}
|