create-pb-tririga-react-app 1.0.3 → 1.0.5

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 CHANGED
@@ -23,6 +23,7 @@ npx create-pb-tririga-react-app my-tririga-app
23
23
  Once created:
24
24
 
25
25
  1. `cd my-tririga-app`
26
- 2. `npm install`
27
- 3. Update configuration files (see `README.md`)
28
- 4. `npm run build:deploy`
26
+ 2. `npm install -g pnpm`
27
+ 2. `pnpm install`
28
+ 3. Update configuration files (see `README.md`)
29
+ 4. `pnpm run build:deploy`
package/index.js CHANGED
@@ -49,4 +49,6 @@ pkgJson.name = projectName;
49
49
  fs.writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2));
50
50
 
51
51
  console.log(`Success! Created ${projectName}.`);
52
- console.log(`See Readme.md in the project folder for instructions on how to get started.`);
52
+ console.log(`cd ${projectName}`);
53
+ console.log(`pnpm install`);
54
+ console.log(`pnpm run dev`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pb-tririga-react-app",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Scaffold a TRIRIGA React app with Vite and TypeScript",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -11,7 +11,12 @@
11
11
  "template",
12
12
  "README.md"
13
13
  ],
14
- "keywords": ["tririga", "react", "vite", "scaffold"],
14
+ "keywords": [
15
+ "tririga",
16
+ "react",
17
+ "vite",
18
+ "scaffold"
19
+ ],
15
20
  "author": "Your Name",
16
21
  "license": "ISC"
17
22
  }
@@ -4,22 +4,21 @@ This is a template for building IBM TRIRIGA UX applications using React, TypeScr
4
4
 
5
5
  ## Getting Started
6
6
 
7
- 1. **Install Dependencies**
7
+ 1. **Install pnpm** (If not already installed)
8
8
  ```
9
- npm install
9
+ npm install -g pnpm
10
10
  ```
11
11
 
12
- 2. **Configure Environment**
13
- Copy `.env.example` to `.env` and update the values for your local development and deployment settings.
12
+ 2. **Install Dependencies**
14
13
  ```
15
- cp .env.example .env
14
+ pnpm install
16
15
  ```
17
16
 
18
- 3. **Run Locally**
17
+ 3. **Configure Environment**
18
+ Copy `.env.example` to `.env` and update the values for your local development and deployment settings.
19
19
  ```
20
- npm run dev
20
+ cp .env.example .env
21
21
  ```
22
- Open [http://localhost:5173](http://localhost:5173) (or the port shown in terminal).
23
22
 
24
23
  ## Deployment
25
24
 
@@ -27,17 +26,20 @@ To deploy to a TRIRIGA environment:
27
26
 
28
27
  1. **Install Depoyment Tool** (If not already installed globally)
29
28
  ```
30
- npm install -g @tririga/tri-deploy
29
+ pnpm install -g @tririga/tri-deploy
31
30
  ```
32
31
  *Note: If you prefer not to install globally, you can add `@tririga/tri-deploy` to your devDependencies.*
33
32
 
34
33
  2. **Configure Credentials**
35
34
  Ensure your `.env` file has the correct `TRI_URL`, `TRI_USER`, and `TRI_PASSWORD`.
36
35
 
37
- 3. **Run Deployment**
36
+ 3. **Configure tririgaService.js file**
37
+ Update the TriAppConfig values (modelAndView, appExposedName) to match your application's configuration in TRIRIGA.
38
+
39
+ 4. **Run Deployment**
38
40
  The view name will be taken from the `name` field in `package.json`.
39
41
  ```
40
- npm run build:deploy
42
+ pnpm run build:deploy
41
43
  ```
42
44
 
43
45
  ## Browser Support & Polyfills
@@ -9,7 +9,7 @@
9
9
  "lint": "eslint .",
10
10
  "preview": "vite preview",
11
11
  "deploy": "dotenv -- cross-var tri-deploy -t %TRI_URL% -u %TRI_USER% -p %TRI_PASSWORD% -v \"$npm_package_name\" -d dist -w",
12
- "build:deploy": "npm run build && npm run deploy"
12
+ "build:deploy": "pnpm run build && pnpm run deploy"
13
13
  },
14
14
  "dependencies": {
15
15
  "@babel/runtime": "^7.26.0",
@@ -26,16 +26,14 @@ export async function initTriAppConfig(): Promise<TriAppConfig> {
26
26
  if (segments[0] === 'app' && segments[1]) {
27
27
  appPath = `/app/${segments[1]}/`;
28
28
  }
29
- // Assume view name matches exposed name valid for standard deployments
30
- const viewName = segments[1] || 'unknownView';
31
29
 
32
30
  const config: TriAppConfig = {
33
31
  instanceId: "-1",
34
32
  tririgaUrl: window.location.origin,
35
33
  contextPath: "/app",
36
- modelAndView: viewName,
34
+ modelAndView: "modelAndView", //update to match your TRIRIGA application
37
35
  appPath: appPath,
38
- appExposedName: viewName,
36
+ appExposedName: "appExposedName", //update to match your TRIRIGA application
39
37
  sso: false
40
38
  };
41
39