@octaviaflow/upgrade 1.0.0 → 2.0.0
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/bin/{carbon-upgrade.js → octaviaflow-upgrade.js} +8 -15
- package/package.json +1 -1
- package/transforms/__testfixtures__/update-carbon-components-react-import-to-scoped.input.js +6 -6
- package/transforms/__tests__/update-carbon-components-react-import-to-scoped.js +4 -5
- package/transforms/__tests__/update-carbon-icons-react-import-to-carbon-react.js +4 -5
- package/transforms/{update-carbon-components-react-import-to-scoped.js → update-octaviaflow-components-react-import-to-scoped.js} +5 -5
- package/transforms/{update-carbon-icons-react-import-to-carbon-react.js → update-octaviaflow-icons-react-import-to-octaviaflow-react.js} +3 -3
|
@@ -1,46 +1,39 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright OctaviaFlow
|
|
3
|
-
* Author: Vishal Kumar
|
|
4
|
-
* Created: 11/November/2025
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
|
-
* LICENSE file in the root directory of this source tree.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
1
|
#!/usr/bin/env node
|
|
11
2
|
|
|
12
3
|
/**
|
|
13
4
|
* Copyright OctaviaFlow
|
|
14
5
|
* Author: Vishal Kumar
|
|
15
6
|
* Created: 11/November/2025
|
|
16
|
-
*
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
10
|
*/
|
|
18
11
|
|
|
19
12
|
/* eslint-disable no-console */
|
|
20
13
|
|
|
21
|
-
|
|
14
|
+
"use strict";
|
|
22
15
|
|
|
23
16
|
// Makes the script crash on unhandled rejections instead of silently
|
|
24
17
|
// ignoring them. In the future, promise rejections that are not handled will
|
|
25
18
|
// terminate the Node.js process with a non-zero exit code.
|
|
26
|
-
process.on(
|
|
19
|
+
process.on("unhandledRejection", (error) => {
|
|
27
20
|
console.error(error);
|
|
28
21
|
});
|
|
29
22
|
|
|
30
23
|
var currentNodeVersion = process.versions.node;
|
|
31
|
-
var semver = currentNodeVersion.split(
|
|
24
|
+
var semver = currentNodeVersion.split(".");
|
|
32
25
|
var major = semver[0];
|
|
33
26
|
|
|
34
27
|
if (major < 14) {
|
|
35
28
|
console.error(
|
|
36
29
|
`You are running Node ${currentNodeVersion}.\n` +
|
|
37
30
|
`octaviaflow-upgrade requires Node 14 or higher, please update your ` +
|
|
38
|
-
`version of Node
|
|
31
|
+
`version of Node.`,
|
|
39
32
|
);
|
|
40
33
|
process.exit(1);
|
|
41
34
|
}
|
|
42
35
|
|
|
43
|
-
var { main } = require(
|
|
36
|
+
var { main } = require("../cli");
|
|
44
37
|
|
|
45
38
|
main(process).catch((error) => {
|
|
46
39
|
console.error(error);
|
package/package.json
CHANGED
package/transforms/__testfixtures__/update-carbon-components-react-import-to-scoped.input.js
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
* Copyright OctaviaFlow
|
|
3
3
|
* Author: Vishal Kumar
|
|
4
4
|
* Created: 11/November/2025
|
|
5
|
-
*
|
|
5
|
+
*
|
|
6
6
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
//prettier-ignore
|
|
11
|
-
import { Button } from '
|
|
11
|
+
import { Button } from 'octaviaflow-components-react';
|
|
12
12
|
//prettier-ignore
|
|
13
|
-
import { Tile, Tooltip } from '
|
|
13
|
+
import { Tile, Tooltip } from 'octaviaflow-components-react';
|
|
14
14
|
//prettier-ignore
|
|
15
|
-
import CodeSnippet from '
|
|
16
|
-
import Something from
|
|
17
|
-
import { SomethingElse } from
|
|
15
|
+
import CodeSnippet from 'octaviaflow-components-react';
|
|
16
|
+
import Something from "somewhere-else";
|
|
17
|
+
import { SomethingElse } from "somewhere-else";
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
* Copyright OctaviaFlow
|
|
3
3
|
* Author: Vishal Kumar
|
|
4
4
|
* Created: 11/November/2025
|
|
5
|
-
*
|
|
5
|
+
*
|
|
6
6
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
"use strict";
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
const { defineTest } = require("jscodeshift/dist/testUtils");
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
defineTest(__dirname, 'update-carbon-components-react-import-to-scoped');
|
|
14
|
+
defineTest(__dirname, "update-octaviaflow-components-react-import-to-scoped");
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
* Copyright OctaviaFlow
|
|
3
3
|
* Author: Vishal Kumar
|
|
4
4
|
* Created: 11/November/2025
|
|
5
|
-
*
|
|
5
|
+
*
|
|
6
6
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
"use strict";
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
const { defineTest } = require("jscodeshift/dist/testUtils");
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
defineTest(__dirname, 'update-carbon-icons-react-import-to-carbon-react');
|
|
14
|
+
defineTest(__dirname, "update-octaviaflow-icons-react-import-to-carbon-react");
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright OctaviaFlow
|
|
3
3
|
* Author: Vishal Kumar
|
|
4
4
|
* Created: 11/November/2025
|
|
5
|
-
*
|
|
5
|
+
*
|
|
6
6
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*
|
|
16
|
-
* Rewrites imports from '
|
|
16
|
+
* Rewrites imports from 'octaviaflow-components-react' to '@octaviaflow/react'
|
|
17
17
|
*
|
|
18
18
|
* Transforms:
|
|
19
19
|
*
|
|
20
|
-
* import { Button } from '
|
|
20
|
+
* import { Button } from 'octaviaflow-components-react';
|
|
21
21
|
*
|
|
22
22
|
* Into:
|
|
23
23
|
*
|
|
@@ -30,11 +30,11 @@ function transformer(file, api) {
|
|
|
30
30
|
return j(file.source)
|
|
31
31
|
.find(j.ImportDeclaration, {
|
|
32
32
|
source: {
|
|
33
|
-
value:
|
|
33
|
+
value: "octaviaflow-components-react",
|
|
34
34
|
},
|
|
35
35
|
})
|
|
36
36
|
.forEach((path) => {
|
|
37
|
-
path.get(
|
|
37
|
+
path.get("source").replace(j.stringLiteral("@octaviaflow/react"));
|
|
38
38
|
})
|
|
39
39
|
.toSource();
|
|
40
40
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright OctaviaFlow
|
|
3
3
|
* Author: Vishal Kumar
|
|
4
4
|
* Created: 11/November/2025
|
|
5
|
-
*
|
|
5
|
+
*
|
|
6
6
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
@@ -30,11 +30,11 @@ function transformer(file, api) {
|
|
|
30
30
|
return j(file.source)
|
|
31
31
|
.find(j.ImportDeclaration, {
|
|
32
32
|
source: {
|
|
33
|
-
value:
|
|
33
|
+
value: "@octaviaflow/icons-react",
|
|
34
34
|
},
|
|
35
35
|
})
|
|
36
36
|
.forEach((path) => {
|
|
37
|
-
path.get(
|
|
37
|
+
path.get("source").replace(j.stringLiteral("@octaviaflow/react/icons"));
|
|
38
38
|
})
|
|
39
39
|
.toSource();
|
|
40
40
|
}
|