Skip to content

Commit 32683dc

Browse files
author
drginm
committed
First version for the aem component using reactjs
0 parents  commit 32683dc

File tree

218 files changed

+7278
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+7278
-0
lines changed

.gitignore

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Created by https://www.gitignore.io/api/eclipse,java,maven
2+
3+
### Eclipse ###
4+
*.pydevproject
5+
.metadata
6+
.gradle
7+
bin/
8+
tmp/
9+
*.tmp
10+
*.bak
11+
*.swp
12+
*~.nib
13+
local.properties
14+
.settings/
15+
.loadpath
16+
17+
# Eclipse Core
18+
.project
19+
20+
# External tool builders
21+
.externalToolBuilders/
22+
23+
# Locally stored "Eclipse launch configurations"
24+
*.launch
25+
26+
# CDT-specific
27+
.cproject
28+
29+
# JDT-specific (Eclipse Java Development Tools)
30+
.classpath
31+
32+
# Java annotation processor (APT)
33+
.factorypath
34+
35+
# PDT-specific
36+
.buildpath
37+
38+
# sbteclipse plugin
39+
.target
40+
41+
# TeXlipse plugin
42+
.texlipse
43+
44+
45+
### Java ###
46+
*.class
47+
48+
# Mobile Tools for Java (J2ME)
49+
.mtj.tmp/
50+
51+
# Package Files #
52+
*.jar
53+
*.war
54+
*.ear
55+
56+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
57+
hs_err_pid*
58+
59+
60+
### Maven ###
61+
target/
62+
pom.xml.tag
63+
pom.xml.releaseBackup
64+
pom.xml.versionsBackup
65+
pom.xml.next
66+
release.properties
67+
dependency-reduced-pom.xml
68+
buildNumber.properties
69+
.mvn/timing.properties
70+
71+
72+
### Vault ###
73+
.vlt
74+
75+
76+
### IntelliJ ###
77+
.idea/
78+
*.iml
79+
80+
81+
### Node.js ###
82+
83+
# Log files
84+
*.log
85+
86+
# NPM
87+
node_modules/
88+
package-lock.json
89+
yarn.lock
90+
91+
# Webpack
92+
build/
93+
dist/
94+
95+
# Frontend Maven Plugin
96+
node/
97+
98+
# Tests
99+
coverage/

.yo-rc.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"generator-aem-application": {
3+
"promptValues": {
4+
"mavenAppsModuleName": "ui.apps",
5+
"mavenBundleModuleName": "core",
6+
"javaRootPackageName": "co.dlighthouse.aem.reactsimpleexample.core"
7+
}
8+
}
9+
}

README.md

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Sample AEM project template
2+
3+
This is a project template for AEM-based applications. It is intended as a best-practice set of examples as well as a potential starting point to develop your own functionality.
4+
5+
## Modules
6+
7+
The main parts of the template are:
8+
9+
* core: Java bundle containing all core functionality like OSGi services, listeners or schedulers, as well as component-related Java code such as servlets or request filters.
10+
* ui.apps: contains the /apps (and /etc) parts of the project, ie JS&CSS clientlibs, components, templates, runmode specific configs as well as Hobbes-tests
11+
* ui.content: contains sample content using the components from the ui.apps
12+
* ui.tests: Java bundle containing JUnit tests that are executed server-side. This bundle is not to be deployed onto production.
13+
* ui.launcher: contains glue code that deploys the ui.tests bundle (and dependent bundles) to the server and triggers the remote JUnit execution
14+
* ui.frontend: an optional dedicated front-end build mechanism (Angular, React or general Webpack project)
15+
16+
## How to build
17+
18+
To build all the modules run in the project root directory the following command with Maven 3:
19+
20+
mvn clean install
21+
22+
If you have a running AEM instance you can build and package the whole project and deploy into AEM with
23+
24+
mvn clean install -PautoInstallPackage
25+
26+
Or to deploy it to a publish instance, run
27+
28+
mvn clean install -PautoInstallPackagePublish
29+
30+
Or alternatively
31+
32+
mvn clean install -PautoInstallPackage -Daem.port=4503
33+
34+
Or to deploy only the bundle to the author, run
35+
36+
mvn clean install -PautoInstallBundle
37+
38+
## Testing
39+
40+
There are three levels of testing contained in the project:
41+
42+
* unit test in core: this show-cases classic unit testing of the code contained in the bundle. To test, execute:
43+
44+
mvn clean test
45+
46+
* server-side integration tests: this allows to run unit-like tests in the AEM-environment, ie on the AEM server. To test, execute:
47+
48+
mvn clean verify -PintegrationTests
49+
50+
* client-side Hobbes.js tests: JavaScript-based browser-side tests that verify browser-side behavior. To test:
51+
52+
in the browser, open the page in 'Developer mode', open the left panel and switch to the 'Tests' tab and find the generated 'MyName Tests' and run them.
53+
54+
## ClientLibs
55+
56+
The frontend module is made available using an [AEM ClientLib](https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/clientlibs.html). When executing the NPM build script, the app is built and the [`aem-clientlib-generator`](https://github.com/wcm-io-frontend/aem-clientlib-generator) package takes the resulting build output and transforms it into such a ClientLib.
57+
58+
A ClientLib will consist of the following files and directories:
59+
60+
- `css/`: CSS files which can be requested in the HTML
61+
- `css.txt` (tells AEM the order and names of files in `css/` so they can be merged)
62+
- `js/`: JavaScript files which can be requested in the HTML
63+
- `js.txt` (tells AEM the order and names of files in `js/` so they can be merged
64+
- `resources/`: Source maps, non-entrypoint code chunks (resulting from code splitting), static assets (e.g. icons), etc.
65+
66+
## Maven settings
67+
68+
The project comes with the auto-public repository configured. To setup the repository in your Maven settings, refer to:
69+
70+
http://helpx.adobe.com/experience-manager/kb/SetUpTheAdobeMavenRepository.html

0 commit comments

Comments
 (0)