create-liferay-react-cx 1.0.1 → 1.0.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/LICENSE +2 -2
- package/README.md +80 -288
- package/bin/index.js +10 -10
- package/package.json +11 -8
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2026 Laxit Khanpara
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,288 +1,80 @@
|
|
|
1
|
-
# create-liferay-react-cx
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[ first to discuss any significant changes.
|
|
274
|
-
|
|
275
|
-
---
|
|
276
|
-
|
|
277
|
-
## License
|
|
278
|
-
|
|
279
|
-
[MIT](./LICENSE) © [Laxit Khanpara](https://github.com/laxitkhanpara)
|
|
280
|
-
|
|
281
|
-
---
|
|
282
|
-
|
|
283
|
-
## Links
|
|
284
|
-
|
|
285
|
-
- 📦 [npm package](https://www.npmjs.com/package/create-liferay-react-cx)
|
|
286
|
-
- 🐛 [Report a bug](https://github.com/laxitkhanpara/liferay-react-ce/issues)
|
|
287
|
-
- 📖 [Liferay Client Extensions docs](https://learn.liferay.com/dxp/latest/en/building-applications/client-extensions.html)
|
|
288
|
-
- 🏗️ [Liferay Workspace docs](https://learn.liferay.com/dxp/latest/en/building-applications/tooling/liferay-workspace/what-is-liferay-workspace.html)
|
|
1
|
+
# create-liferay-react-cx
|
|
2
|
+
|
|
3
|
+
⚡ **Zero-config CLI** to scaffold **Liferay React Client Extensions** in seconds.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/create-liferay-react-cx)
|
|
6
|
+
[](https://github.com/laxitkhanpara/create-liferay-react-cx/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Quick Start
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npx create-liferay-react-cx my-widget
|
|
14
|
+
cd my-widget
|
|
15
|
+
../../gradlew deploy
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## What You Get
|
|
19
|
+
|
|
20
|
+
- ✅ **Vite-powered** React project (fast builds, HMR)
|
|
21
|
+
- ✅ **client-extension.yaml** pre-configured
|
|
22
|
+
- ✅ **Shadow DOM** isolated styles
|
|
23
|
+
- ✅ **Ready to deploy** to Liferay 7.4+ / DXP
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
### Interactive Mode
|
|
28
|
+
```bash
|
|
29
|
+
npx create-liferay-react-cx
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### With Arguments
|
|
33
|
+
```bash
|
|
34
|
+
npx create-liferay-react-cx my-widget --react-version 18.2.0
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Using npm create
|
|
38
|
+
```bash
|
|
39
|
+
npm create liferay-react-cx my-widget
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Options
|
|
43
|
+
|
|
44
|
+
| Flag | Description | Default |
|
|
45
|
+
|------|-------------|---------|
|
|
46
|
+
| `--name, -n` | App name (kebab-case) | _(prompted)_ |
|
|
47
|
+
| `--react-version, -r` | React version | `16.12.0` |
|
|
48
|
+
| `--help, -h` | Show help | — |
|
|
49
|
+
| `--version, -v` | Show version | — |
|
|
50
|
+
|
|
51
|
+
## Requirements
|
|
52
|
+
|
|
53
|
+
- **Node.js** ≥ 18.0.0
|
|
54
|
+
- **npm** ≥ 9.0.0
|
|
55
|
+
- **Liferay Workspace** (for deployment)
|
|
56
|
+
|
|
57
|
+
## React Version Guide
|
|
58
|
+
|
|
59
|
+
- **16.12.0** → Liferay 7.4 GA / DXP classic
|
|
60
|
+
- **18.2.0** → Liferay 7.4 U45+ / DXP 2024.Q1+
|
|
61
|
+
|
|
62
|
+
## After Scaffolding
|
|
63
|
+
|
|
64
|
+
1. Navigate into your project: `cd my-widget`
|
|
65
|
+
2. Deploy to Liferay: `../../gradlew deploy`
|
|
66
|
+
3. Add widget to a page in **Liferay Admin → Client Extensions**
|
|
67
|
+
|
|
68
|
+
## Documentation
|
|
69
|
+
|
|
70
|
+
📖 Full documentation: [GitHub Repository](https://github.com/laxitkhanpara/create-liferay-react-cx)
|
|
71
|
+
|
|
72
|
+
## Links
|
|
73
|
+
|
|
74
|
+
- [GitHub](https://github.com/laxitkhanpara/create-liferay-react-cx)
|
|
75
|
+
- [Issues](https://github.com/laxitkhanpara/create-liferay-react-cx/issues)
|
|
76
|
+
- [Liferay Docs](https://learn.liferay.com/dxp/latest/en/building-applications/client-extensions.html)
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
MIT © [Laxit Khanpara](https://github.com/laxitkhanpara)
|
package/bin/index.js
CHANGED
|
@@ -10,9 +10,9 @@ import { execa } from 'execa';
|
|
|
10
10
|
const __filename = fileURLToPath(import.meta.url);
|
|
11
11
|
const __dirname = path.dirname(__filename);
|
|
12
12
|
|
|
13
|
-
const commandName = 'liferay-react-cx';
|
|
13
|
+
const commandName = 'create-liferay-react-cx';
|
|
14
14
|
|
|
15
|
-
const PKG_VERSION = '1.0.
|
|
15
|
+
const PKG_VERSION = '1.0.3';
|
|
16
16
|
|
|
17
17
|
// ─── Helpers ────────────────────────────────────────────────────────────────
|
|
18
18
|
|
|
@@ -87,32 +87,32 @@ function printBanner() {
|
|
|
87
87
|
// ─── Version / Help ──────────────────────────────────────────────────────────
|
|
88
88
|
|
|
89
89
|
if (hasFlag(['--version', '-v'])) {
|
|
90
|
-
console.log(`liferay-react-cx v${PKG_VERSION}`);
|
|
90
|
+
console.log(`create-liferay-react-cx v${PKG_VERSION}`);
|
|
91
91
|
process.exit(0);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
if (hasFlag(['--help', '-h'])) {
|
|
95
95
|
console.log(`
|
|
96
|
-
${chalk.bold('liferay-react-cx')} — Scaffold a Liferay React Client Extension
|
|
96
|
+
${chalk.bold('create-liferay-react-cx')} — Scaffold a Liferay React Client Extension
|
|
97
97
|
|
|
98
98
|
${chalk.bold('USAGE')}
|
|
99
|
-
liferay-react-cx [app-name] [react-version]
|
|
100
|
-
liferay-react-cx --name <app-name> [--react-version <version>]
|
|
99
|
+
create-liferay-react-cx [app-name] [react-version]
|
|
100
|
+
create-liferay-react-cx --name <app-name> [--react-version <version>]
|
|
101
101
|
-n, --name App name in kebab-case (e.g. my-widget)
|
|
102
102
|
-r, --react-version React version to use (default: 16.12.0)
|
|
103
103
|
-v, --version Print version
|
|
104
104
|
-h, --help Show this help
|
|
105
105
|
|
|
106
106
|
${chalk.bold('EXAMPLES')}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
npx create-liferay-react-cx my-widget
|
|
108
|
+
npx create-liferay-react-cx --name my-widget --react-version 18.2.0
|
|
109
|
+
npx create-liferay-react-cx # interactive mode
|
|
110
110
|
|
|
111
111
|
${chalk.bold('AFTER SCAFFOLDING')}
|
|
112
112
|
cd <app-name>
|
|
113
113
|
../../gradlew deploy # deploy to Liferay
|
|
114
114
|
|
|
115
|
-
${chalk.dim('https://github.com/laxitkhanpara/liferay-react-
|
|
115
|
+
${chalk.dim('https://github.com/laxitkhanpara/create-liferay-react-cx')}
|
|
116
116
|
`);
|
|
117
117
|
process.exit(0);
|
|
118
118
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-liferay-react-cx",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "CLI
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "Zero-config CLI to scaffold Liferay React Client Extensions (custom element) — Vite-powered, shadow DOM isolated, ready to deploy.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./bin/index.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"create-liferay-react-cx": "
|
|
9
|
-
"liferay-react-cx": "./bin/index.js"
|
|
8
|
+
"create-liferay-react-cx": "bin/index.js"
|
|
10
9
|
},
|
|
10
|
+
"preferGlobal": false,
|
|
11
11
|
"keywords": [
|
|
12
12
|
"liferay",
|
|
13
13
|
"client-extension",
|
|
@@ -16,9 +16,12 @@
|
|
|
16
16
|
"vite",
|
|
17
17
|
"scaffold",
|
|
18
18
|
"cli",
|
|
19
|
+
"generator",
|
|
19
20
|
"liferay-dxp",
|
|
20
21
|
"liferay-portal",
|
|
21
|
-
"web-component"
|
|
22
|
+
"web-component",
|
|
23
|
+
"create",
|
|
24
|
+
"boilerplate"
|
|
22
25
|
],
|
|
23
26
|
"author": {
|
|
24
27
|
"name": "Laxit Khanpara",
|
|
@@ -28,12 +31,12 @@
|
|
|
28
31
|
"license": "MIT",
|
|
29
32
|
"repository": {
|
|
30
33
|
"type": "git",
|
|
31
|
-
"url": "git+https://github.com/laxitkhanpara/liferay-react-
|
|
34
|
+
"url": "git+https://github.com/laxitkhanpara/create-liferay-react-cx.git"
|
|
32
35
|
},
|
|
33
36
|
"bugs": {
|
|
34
|
-
"url": "https://github.com/laxitkhanpara/liferay-react-
|
|
37
|
+
"url": "https://github.com/laxitkhanpara/create-liferay-react-cx/issues"
|
|
35
38
|
},
|
|
36
|
-
"homepage": "https://github.com/laxitkhanpara/liferay-react-
|
|
39
|
+
"homepage": "https://github.com/laxitkhanpara/create-liferay-react-cx#readme",
|
|
37
40
|
"engines": {
|
|
38
41
|
"node": ">=18.0.0",
|
|
39
42
|
"npm": ">=9.0.0"
|