app-studio 0.1.32 → 0.1.36
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/README.md +1 -1
- package/codemod/README.md +19 -16
- package/codemod/package-lock.json +8513 -0
- package/codemod/package.json +28 -7
- package/codemod/transforms/__tests__/to-app-studio.test.js +46 -228
- package/codemod/transforms/to-app-studio.ts +258 -100
- package/codemod/tsconfig.json +6 -6
- package/dist/app-studio.cjs.development.js +1 -18
- package/dist/app-studio.cjs.development.js.map +1 -1
- package/dist/app-studio.cjs.production.min.js +3 -3
- package/dist/app-studio.cjs.production.min.js.map +1 -1
- package/dist/app-studio.esm.js +1 -18
- package/dist/app-studio.esm.js.map +1 -1
- package/package.json +2 -2
- package/codemod/transforms/utils.ts +0 -267
package/README.md
CHANGED
|
@@ -139,7 +139,7 @@ function Example() {
|
|
|
139
139
|
- Use `jscodeshift` to run the transformation:
|
|
140
140
|
|
|
141
141
|
```bash
|
|
142
|
-
npx
|
|
142
|
+
npx @app-studio/codemod to-app-studio <path_to_your_js_or_tsx_files> --assetsDir=src/assets --assetsUrl=/assets
|
|
143
143
|
```
|
|
144
144
|
|
|
145
145
|
Replace `<path_to_your_js_or_tsx_files>` with the actual path to your JavaScript/TypeScript files.
|
package/codemod/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Provides Codemod transformations to help with code upgrade and migration.
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
npx @app-studio/codemod <transform> <path
|
|
8
|
+
npx @app-studio/codemod <transform> <path>
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
- `transform` - name of the transform
|
|
@@ -15,38 +15,41 @@ npx @app-studio/codemod <transform> <path
|
|
|
15
15
|
|
|
16
16
|
## Codemods
|
|
17
17
|
|
|
18
|
-
### `to-
|
|
18
|
+
### `to-app-studio`
|
|
19
19
|
|
|
20
|
-
This Codemod migrates your
|
|
20
|
+
This Codemod migrates your components code to `app-studio` code.
|
|
21
21
|
|
|
22
22
|
```js
|
|
23
|
-
npx @
|
|
23
|
+
npx @app-studio/codemod to-app-studio
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
Example:
|
|
27
27
|
|
|
28
|
-
```jsx
|
|
29
|
-
import { Div, H1, Button } from "@app-studio/components"
|
|
30
28
|
|
|
29
|
+
```jsx
|
|
31
30
|
export default function () {
|
|
32
31
|
return (
|
|
33
|
-
<
|
|
34
|
-
<
|
|
35
|
-
<
|
|
36
|
-
</
|
|
32
|
+
<div style={{display:"flex"}}>
|
|
33
|
+
<h1 >This is a heading</h1>
|
|
34
|
+
<button>Button</button>
|
|
35
|
+
</div>
|
|
37
36
|
)
|
|
38
37
|
}
|
|
39
38
|
```
|
|
40
39
|
|
|
40
|
+
|
|
41
41
|
Will be transformed to:
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { Div, H1, Button } from "@app-studio/web"
|
|
46
|
+
|
|
44
47
|
export default function () {
|
|
45
48
|
return (
|
|
46
|
-
<
|
|
47
|
-
<
|
|
48
|
-
<
|
|
49
|
-
</
|
|
49
|
+
<Div display="flex">
|
|
50
|
+
<H1>This is a heading</H1>
|
|
51
|
+
<Button>Button</Button>
|
|
52
|
+
</Div>
|
|
50
53
|
)
|
|
51
54
|
}
|
|
52
|
-
```
|
|
55
|
+
```
|