Skip to content

Commit 3df15a3

Browse files
committed
docs(target-platforms): update project's README
1 parent 077f4b4 commit 3df15a3

File tree

1 file changed

+63
-13
lines changed

1 file changed

+63
-13
lines changed

target-platforms/README.md

Lines changed: 63 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# liferay-target-platforms
1+
# target-platforms
22

33
This repository holds Target Platforms for the Liferay CE Portal and DXP
44
products.
@@ -9,21 +9,71 @@ A Target Platform is a single `npm` dependency that you may use in your
99
JavaScript projects to have all needed dependencies and tools to deploy it in a
1010
specific release of Liferay CE Portal or DXP.
1111

12-
The Target Platform dependencies takes care of all configuration details for
13-
you, so that you don't need to bother about dependency numbers or configuring
14-
the parts of the build that can be inferred from the target version of Liferay
15-
CE Portal/DXP.
12+
The Target Platform takes care of all configuration details for you you, so
13+
that you don't need to bother about dependency numbers or configuring the parts
14+
of the build that can be inferred from the target version of Liferay CE
15+
Portal/DXP.
1616

1717
## Supported Target Platforms
1818

19-
Right now we support the following platforms:
19+
To view the list of supported target platforms browse
20+
[the packages folder](./packages).
21+
22+
All platform names describe the target product and version (for instance:
23+
`portal-7.4-ga1` refers to Liferay CE Portal 7.4 GA1) except for some special
24+
ones that are listed here:
25+
26+
- `portal-adapt-angular-cli`: a special target platform that is used when
27+
adapting native Angular projects for deployment to Liferay.
28+
- `portal-adapt-create-react-app`: a special target platform that is used when
29+
adapting native React projects for deployment to Liferay.
30+
- `portal-adapt-vue-cli`: a special target platform that is used when adapting
31+
native Vue.js projects for deployment to Liferay.
32+
- `portal-agnostic`: a target platform to avoid coupling of the project with any
33+
specific Liferay version.
34+
- `portal-master`: an internal target platform used by this project to be able
35+
to target current development version of Liferay Portal.
2036

2137
## How to use Target Platforms
2238

23-
Even though you can use Target Platforms alone, they are intended to be
24-
pre-configured by tools like the
25-
[JS Toolkit Generator](https://github.com/liferay/liferay-frontend-projects/blob/master/maintenance/projects/js-toolkit/docs/How-to-use-generator-liferay-js.md)
26-
or
27-
[Liferay Workspace](https://learn.liferay.com/dxp/latest/en/developing-applications/tooling/liferay-workspace/what-is-liferay-workspace.html)
28-
so please refer to those tools' documentation on how to leverage Target
29-
Platforms.
39+
Target platforms are usually set as a npm dependency in projects created by the
40+
[`@liferay/cli` tool](https://github.com/izaera/liferay-frontend-projects/blob/doc-toolkit-3/projects/js-toolkit/packages/liferay-cli).
41+
They provide all dependencies needed to build, deploy and run the project when
42+
targeting the selected platform.
43+
44+
That means you don't need to do anything specific to use them. You just will
45+
because `@liferay/cli` will inject them in your projects.
46+
47+
### A note about contents of target platforms
48+
49+
Among other things, target platforms contain:
50+
51+
- The npm dependencies: for example
52+
[these ones](https://github.com/izaera/liferay-frontend-projects/blob/doc-toolkit-3/target-platforms/packages/portal-7.4-ga1/package.json#L5-L131).
53+
- The `liferay-npm-bundler` configuration used to build the project: for example
54+
[this one](https://github.com/izaera/liferay-frontend-projects/blob/doc-toolkit-3/target-platforms/packages/portal-7.4-ga1/config.json).
55+
- The `liferay.js` file that will be invoked by the `@liferay/cli` to delegate
56+
its tasks to the target platform: for example
57+
[this one](https://github.com/izaera/liferay-frontend-projects/blob/doc-toolkit-3/target-platforms/packages/portal-7.4-ga1/liferay.js).
58+
59+
Note that `@liferay/cli` delegates tasks like `build`, `deploy`, etc. to the
60+
aforementioned `liferay.js` scripts inside target platforms. This is a strategy
61+
to make evolution and support of `@liferay/cli` easier.
62+
63+
However, at the same time, most target platforms use the same code so, instead
64+
of replicating it for each platform, we
65+
["undo" the delegation referring to shared projects](https://github.com/izaera/liferay-frontend-projects/blob/doc-toolkit-3/target-platforms/packages/portal-7.4-ga1/liferay.js#L8)
66+
that implement the logic for platforms of the same kind.
67+
68+
Two examples of those shared projects are:
69+
70+
- [portal-base](https://github.com/izaera/liferay-frontend-projects/tree/doc-toolkit-3/projects/js-toolkit/packages/portal-base):
71+
contains logic to build projects targeting Liferay Portal.
72+
- [portal-adapt-base](https://github.com/izaera/liferay-frontend-projects/tree/doc-toolkit-3/projects/js-toolkit/packages/portal-adapt-base):
73+
contains logic to build adapted Angular, React and Vue.js projects.
74+
75+
We may add or refactor these shared projects in the future, depending on how
76+
the list of target platforms and types evolve but, thanks to the `@liferay/cli`
77+
delegation and the `liferay.js` files contained inside target platforms, nobody
78+
will ever be affected by those changes, as they will happen transparently to
79+
the projects using the target platforms.

0 commit comments

Comments
 (0)