Skip to content

Commit 49d3089

Browse files
authored
Merge pull request #129 from ia-ngomez/IGN-13791
IGN-13791: 8.3: Webpage SDK Example update
2 parents ca197e9 + 5ed6200 commit 49d3089

File tree

7 files changed

+3589
-2187
lines changed

7 files changed

+3589
-2187
lines changed

webui-webpage/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ To run the build, clone this repo and open a command line in the `webui-webpage`
2121
// on Windows
2222
gradlew build
2323
24-
// on linux/osx
24+
// on linux/macOS
2525
./gradlew build
2626
```
2727

@@ -31,23 +31,23 @@ This will produce a `.modl` file in the `build` directory, which can be installe
3131

3232
This project uses a number of build tools in order to complete the various parts of its assembly. It's important to note that these tools are just some example options. You may use any tool you want (or no tool at all). These examples use:
3333

34-
* [Gradle](https://gradle.org/) - the primary build tool. Most tasks executed in a typical workflow are gradle tasks.
34+
* [Gradle](https://gradle.org/) the primary build tool. Most tasks executed in a typical workflow are gradle tasks.
3535
and 'packages' in the same git/hg repository without having to do a lot of complicated symlinking/publishing to pull in changes from one project to another. It's mostly useful from the commandline, outside of Gradle.
36-
* [yarn](https://yarnpkg.com/) - is a JavaScript dependency (package) manager that provides a number of improvements
36+
* [yarn](https://yarnpkg.com/) is a JavaScript dependency (package) manager that provides a number of improvements
3737
over npm, though it shares many of the same commands and api. Much like Ivy or Maven, yarn is used to resolve and download dependencies hosted on remotely hosted repositories. Inductive Automation publishes our own dependencies through the
3838
same nexus repository system we use for other sdk artifacts. To correctly resolve the Inductive Automation node packages,
3939
an `.npmrc` file needs to be added to the front end projects to tell yarn/npm where to find packages in the `@inductiveautomation` namespace. You will find examples of these in the `web-ui/` directory.
40-
* [Typescript](https://www.typescriptlang.org/) - the language used to write the front end parts. TypeScript is not required but is strongly recommended. TypeScript can be thought of as modern JavaScript with types added (though this is a simplification). The addition of types to JS results in a far better developer experience through much better tooling
40+
* [TypeScript](https://www.typescriptlang.org/) the language used to write the front end parts. TypeScript is not required but is strongly recommended. TypeScript can be thought of as modern JavaScript with types added (though this is a simplification). The addition of types to JS results in a far better developer experience through much better tooling
4141
support. This can improve maintainability, refactoring, code navigation, bug discovery, etc. TypeScript has its own compiler which emits JavaScript. This compiler is frequently paired with other build tools in a way that it emits the JavaScript, but
4242
other tools handle the actual bundling of assets, CSS, and other supporting dependencies. Think of TypeScript as the
4343
java compiler without jars or resources. It just takes TypeScript files in, and emits the JavaScript files.
44-
* [Webpack](https://webpack.js.org/) - the 'bundler' that we use to take the JavaScript emitted by the TypeScript compiler and turn it into an actual package that includes the necessary assets, dependencies, generates sourcemaps, etc.
44+
* [Webpack](https://webpack.js.org/) the 'bundler' that we use to take the JavaScript emitted by the TypeScript compiler and turn it into an actual package that includes the necessary assets, dependencies, generates sourcemaps, etc.
4545

4646

4747
## How it works
4848
1. The React component that represents your page will need to be bundled into a single UMD JS file.
4949
- We use webpack in this example.
50-
- This example uses Gradle to download tools necessary to build the project (node, yarn and NPM) and then runs a yarn install to install all of the dependencies listed in the package.json. After this is complete, it will use the webpack.config.js file to build the JS bundle and place it in proper location.
50+
- This example uses Gradle to download tools necessary to build the project (node, yarn and NPM) and then runs a yarn install to install all the dependencies listed in the package.json. After this is complete, it will use the webpack.config.js file to build the JS bundle and place it in proper location.
5151

5252

5353
2. The file will need to be served on the gateway using the Module Resource API.

webui-webpage/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ plugins {
1111
id("io.ia.sdk.modl") version("0.1.1")
1212
}
1313

14-
val sdk_version by extra("8.3.0-SNAPSHOT")
14+
val sdk_version by extra("8.3.0-beta1")
1515

1616
allprojects {
17-
version = "0.0.1-SNAPSHOT"
17+
version = "0.0.1-beta1"
1818
}
1919

2020
ignitionModule {

webui-webpage/settings.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ pluginManagement {
33
gradlePluginPortal()
44
mavenCentral()
55
mavenLocal()
6+
maven {
7+
name = "inductiveautomation-releases"
8+
url = uri(
9+
"https://nexus.inductiveautomation.com/repository/inductiveautomation-releases/"
10+
)
11+
}
612
maven {
713
url "https://nexus.inductiveautomation.com/repository/inductiveautomation-beta"
814
}
@@ -16,6 +22,13 @@ rootProject.name = "webui-webpage"
1622

1723
dependencyResolutionManagement {
1824
repositories {
25+
maven {
26+
name = "inductiveautomation-releases"
27+
url = uri(
28+
"https://nexus.inductiveautomation.com/repository/inductiveautomation-releases/"
29+
)
30+
}
31+
1932
// enable resolving dependencies from the inductive automation artifact repository
2033
maven {
2134
url "https://nexus.inductiveautomation.com/repository/inductiveautomation-beta"

webui-webpage/web-ui/.yarnrc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
strict-ssl false
2-
3-
registry "https://nexus.ia.local/repository/npm-package-group/"
4-
"@inductiveautomation:registry" "https://nexus.ia.local/repository/beta-node-packages/"
1+
"@inductiveautomation:registry" "https://nexus.inductiveautomation.com/repository/node-packages/"

webui-webpage/web-ui/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ node {
2323
// define a gradle task that will install our npm dependencies, extends the YarnTask provided by the node gradle plugin
2424
val yarnPackages by tasks.registering(YarnTask::class) {
2525

26-
description = "Executes 'yarn' at the root of the web/ directory to install npm dependencies for the yarn workspace."
26+
description = "Executes 'yarn' at the root of the web-ui/ directory to install npm dependencies for the yarn workspace."
2727
// which yarn command to execute
2828
args.set(listOf("install", "--verbose"))
2929

@@ -48,10 +48,10 @@ val yarnPackages by tasks.registering(YarnTask::class) {
4848
// define a gradle task that executes an npm script (defined in the package.json).
4949
val webpack by tasks.registering(NpmTask::class) {
5050
group = "Ignition Module"
51-
description = "Runs 'npm run build', executing the build script of the web project's root package.json"
51+
description = "Runs 'npm run-build', executing the build script of the web project's root package.json"
5252

5353
// same as running "npm run build" in the ./web-ui/ directory.
54-
args.set(listOf("run", "build"))
54+
args.set(listOf("run", "build-dev"))
5555

5656
// we require the installPackages to be done before the npm build (which calls webpack) can run, as we need our dependencies!
5757
dependsOn(yarnPackages)

webui-webpage/web-ui/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"react-dom": "18.2.0",
2323
"react-hook-form": "^7.44.3",
2424
"react-redux": "^8.0.5",
25-
"@inductiveautomation/ignition-icons": "^1.3.0-SNAPSHOT",
26-
"@inductiveautomation/ignition-web-ui": "^1.3.0-SNAPSHOT"
25+
"@inductiveautomation/ignition-icons": "^1.3.0-beta1",
26+
"@inductiveautomation/ignition-web-ui": "^1.3.0-beta1"
2727
},
2828
"devDependencies": {
2929
"@babel/core": "^7.17.8",
@@ -63,6 +63,6 @@
6363
"webpack-dev-server": "^4.11.1"
6464
},
6565
"resolutions": {
66-
"@inductiveautomation/ignition-icons": "^1.3.0-SNAPSHOT"
66+
"@inductiveautomation/ignition-icons": "^1.3.0-beta1"
6767
}
6868
}

0 commit comments

Comments
 (0)