create-lwr 0.16.2 → 0.16.4

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/package.json CHANGED
@@ -22,14 +22,14 @@
22
22
  },
23
23
  "type": "module",
24
24
  "types": "build/es/index.d.ts",
25
- "version": "0.16.2",
25
+ "version": "0.16.4",
26
26
  "module": "build/es/index.js",
27
27
  "main": "build/cjs/index.cjs",
28
28
  "files": [
29
29
  "build/**/*.js",
30
30
  "build/**/*.cjs",
31
31
  "build/**/*.d.ts",
32
- "template-*"
32
+ "template-*/**"
33
33
  ],
34
34
  "exports": {
35
35
  "import": "./build/es/index.js",
@@ -46,5 +46,5 @@
46
46
  "volta": {
47
47
  "extends": "../../package.json"
48
48
  },
49
- "gitHead": "062cc0e7d23b70b1c97cdd8acde90caee4e644f8"
49
+ "gitHead": "66c3fb551a00f76bd5d7cfa176ff7b72fa20d0f2"
50
50
  }
@@ -0,0 +1,70 @@
1
+ # LWC Boilerplate Example
2
+
3
+ The **LWC Boilerplate** example contains the minimum code needed to get a simple Single Page Application (SPA) on LWR running.
4
+
5
+ ## Project Setup
6
+
7
+ The directory structure looks like this:
8
+
9
+ ```fs
10
+ src/
11
+ ├── assets/ // static assets
12
+ │ └── recipes-logo.png
13
+ | └── favicon.ico
14
+ └── modules/ // lwc modules
15
+ └── example/
16
+ └── app/
17
+ ├── app.css
18
+ ├── app.html
19
+ └── app.js
20
+ lwr.config.json // lwr configuration
21
+ package.json // npm packaging configuration
22
+ ```
23
+
24
+ ## Configuration
25
+
26
+ The LWR server is configured in `lwr.config.json`, at the root of the project. The **LWC Boilerplate** example has one LWC module and one server-side route.
27
+
28
+ ```json
29
+ // lwr.config.json
30
+ {
31
+ "lwc": { "modules": [{ "dir": "$rootDir/src/modules" }] },
32
+ "routes": [
33
+ {
34
+ "id": "example",
35
+ "path": "/",
36
+ "rootComponent": "example/app"
37
+ }
38
+ ],
39
+ "assets": [
40
+ {
41
+ "alias": "assetsDir",
42
+ "dir": "$rootDir/src/assets",
43
+ "urlPath": "/public/assets"
44
+ },
45
+ {
46
+ "alias": "favicon",
47
+ "file": "$rootDir/src/assets/favicon.ico",
48
+ "urlPath": "/favicon.ico"
49
+ }
50
+ ]
51
+ }
52
+ ```
53
+
54
+ ## Running the Project in dev Mode
55
+
56
+ ```bash
57
+ yarn install
58
+ yarn dev # dev:compat for AMD format
59
+ ```
60
+
61
+ Open the site at [http://localhost:3000](http://localhost:3000)
62
+
63
+ ## Statically Generate and Preview the Site
64
+
65
+ ```bash
66
+ yarn build # dev:prod-compat for AMD format
67
+ yarn start
68
+ ```
69
+
70
+ Open the site at [http://localhost:3000](http://localhost:3000)
@@ -0,0 +1,22 @@
1
+ {
2
+ "lwc": { "modules": [{ "dir": "$rootDir/src/modules" }] },
3
+ "routes": [
4
+ {
5
+ "id": "example",
6
+ "path": "/",
7
+ "rootComponent": "example/app"
8
+ }
9
+ ],
10
+ "assets": [
11
+ {
12
+ "alias": "assetsDir",
13
+ "dir": "$rootDir/src/assets",
14
+ "urlPath": "/public/assets"
15
+ },
16
+ {
17
+ "alias": "favicon",
18
+ "file": "$rootDir/src/assets/favicon.ico",
19
+ "urlPath": "/favicon.ico"
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "lwr-lwc",
3
+ "version": "0.0.1",
4
+ "license": "MIT",
5
+ "private": true,
6
+ "type": "module",
7
+ "scripts": {
8
+ "clean": "rimraf node_modules __lwr_cache__ site",
9
+ "dev": "lwr dev",
10
+ "dev:compat": "lwr dev --mode compat",
11
+ "build": "lwr build --clean",
12
+ "build:prod-compat": "lwr build --clean --mode prod-compat",
13
+ "start": "lwr start",
14
+ "stage": "yarn build && yarn start",
15
+ "stage:prod-compat": "yarn build:prod-compat && yarn start"
16
+ },
17
+ "dependencies": {
18
+ "lwc": "latest",
19
+ "lwr": "latest"
20
+ },
21
+ "engines": {
22
+ "node": ">=18.0.0"
23
+ },
24
+ "volta": {
25
+ "node": "20.16.0"
26
+ }
27
+ }
@@ -0,0 +1,10 @@
1
+ main {
2
+ margin: 30px;
3
+ display: flex;
4
+ flex-direction: column;
5
+ align-items: center;
6
+ }
7
+
8
+ h1 {
9
+ color: #1798c1;
10
+ }
@@ -0,0 +1,6 @@
1
+ <template>
2
+ <main>
3
+ <img src="/public/assets/recipes-logo.png" alt="logo" />
4
+ <h1>Hello World!</h1>
5
+ </main>
6
+ </template>
@@ -0,0 +1,3 @@
1
+ import { LightningElement } from 'lwc';
2
+
3
+ export default class HelloWorldApp extends LightningElement {}
@@ -0,0 +1,70 @@
1
+ # LWC-TS Boilerplate Example
2
+
3
+ The **LWC TS Boilerplate** example contains the minimum code needed to get a simple Single Page Application (SPA) on LWR running in Typescript.
4
+
5
+ ## Project Setup
6
+
7
+ The directory structure looks like this:
8
+
9
+ ```fs
10
+ src/
11
+ ├── assets/ // static assets
12
+ │ └── recipes-logo.png
13
+ | └── favicon.ico
14
+ └── modules/ // lwc modules
15
+ └── example/
16
+ └── app/
17
+ ├── app.css
18
+ ├── app.html
19
+ └── app.ts
20
+ lwr.config.json // lwr configuration
21
+ package.json // npm packaging configuration
22
+ ```
23
+
24
+ ## Configuration
25
+
26
+ The LWR server is configured in `lwr.config.json`, at the root of the project. The **LWC TS Boilerplate** example has one LWC module and one server-side route.
27
+
28
+ ```json
29
+ // lwr.config.json
30
+ {
31
+ "lwc": { "modules": [{ "dir": "$rootDir/src/modules" }] },
32
+ "routes": [
33
+ {
34
+ "id": "example",
35
+ "path": "/",
36
+ "rootComponent": "example/app"
37
+ }
38
+ ],
39
+ "assets": [
40
+ {
41
+ "alias": "assetsDir",
42
+ "dir": "$rootDir/src/assets",
43
+ "urlPath": "/public/assets"
44
+ },
45
+ {
46
+ "alias": "favicon",
47
+ "file": "$rootDir/src/assets/favicon.ico",
48
+ "urlPath": "/favicon.ico"
49
+ }
50
+ ]
51
+ }
52
+ ```
53
+
54
+ ## Running the Project in dev Mode
55
+
56
+ ```bash
57
+ yarn install
58
+ yarn dev # dev:compat for AMD format
59
+ ```
60
+
61
+ Open the site at [http://localhost:3000](http://localhost:3000)
62
+
63
+ ## Statically Generate and Preview the Site
64
+
65
+ ```bash
66
+ yarn build # dev:prod-compat for AMD format
67
+ yarn start
68
+ ```
69
+
70
+ Open the site at [http://localhost:3000](http://localhost:3000)
@@ -0,0 +1,22 @@
1
+ {
2
+ "lwc": { "modules": [{ "dir": "$rootDir/src/modules" }] },
3
+ "routes": [
4
+ {
5
+ "id": "example",
6
+ "path": "/",
7
+ "rootComponent": "example/app"
8
+ }
9
+ ],
10
+ "assets": [
11
+ {
12
+ "alias": "assetsDir",
13
+ "dir": "$rootDir/src/assets",
14
+ "urlPath": "/public/assets"
15
+ },
16
+ {
17
+ "alias": "favicon",
18
+ "file": "$rootDir/src/assets/favicon.ico",
19
+ "urlPath": "/favicon.ico"
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "lwr-lwc-ts",
3
+ "version": "0.0.1",
4
+ "license": "MIT",
5
+ "private": true,
6
+ "type": "module",
7
+ "scripts": {
8
+ "clean": "rimraf node_modules __lwr_cache__ site",
9
+ "dev": "lwr dev",
10
+ "dev:compat": "lwr dev --mode compat",
11
+ "build": "lwr build --clean",
12
+ "build:prod-compat": "lwr build --clean --mode prod-compat",
13
+ "start": "lwr start",
14
+ "stage": "yarn build && yarn start",
15
+ "stage:prod-compat": "yarn build:prod-compat && yarn start"
16
+ },
17
+ "dependencies": {
18
+ "lwc": "latest",
19
+ "lwr": "latest"
20
+ },
21
+ "engines": {
22
+ "node": ">=18.0.0"
23
+ },
24
+ "volta": {
25
+ "node": "20.16.0"
26
+ }
27
+ }
@@ -0,0 +1,10 @@
1
+ main {
2
+ margin: 30px;
3
+ display: flex;
4
+ flex-direction: column;
5
+ align-items: center;
6
+ }
7
+
8
+ h1 {
9
+ color: #1798c1;
10
+ }
@@ -0,0 +1,6 @@
1
+ <template>
2
+ <main>
3
+ <img src="/public/assets/recipes-logo.png" alt="logo" />
4
+ <h1>Hello World!</h1>
5
+ </main>
6
+ </template>
@@ -0,0 +1,3 @@
1
+ import { LightningElement } from 'lwc';
2
+
3
+ export default class HelloWorldApp extends LightningElement {}
@@ -0,0 +1 @@
1
+ nodeLinker: node-modules
@@ -0,0 +1,77 @@
1
+ # Static Site Boilerplate Example
2
+
3
+ The **Static Site** example contains the minimum code needed to get up and running with a LWR website.
4
+
5
+ ## Project Setup
6
+
7
+ The directory structure looks like this:
8
+
9
+ ```fs
10
+ src/
11
+ ├── assets/ // static assets
12
+ | └── favicon.ico
13
+ │ └── css/
14
+ │ └── main.css
15
+ └── content/ // site pages
16
+ │ ├── about.md
17
+ │ └── home.md
18
+ └── layouts/ // site page layouts
19
+ └── main_layout.njk
20
+ lwr.config.json // lwr configuration
21
+ package.json // npm packaging configuration
22
+ ```
23
+
24
+ ## Configuration
25
+
26
+ The LWR server is configured in `lwr.config.json`, at the root of the project. The **Static Site** example has two routes/pages.
27
+
28
+ ```json
29
+ // lwr.config.json
30
+ {
31
+ "lwc": { "modules": [{ "dir": "$rootDir/src/modules" }] },
32
+ "routes": [
33
+ {
34
+ "id": "Home",
35
+ "path": "/",
36
+ "contentTemplate": "$contentDir/home.md",
37
+ "layoutTemplate": "$layoutsDir/main_layout.njk"
38
+ },
39
+ {
40
+ "id": "About",
41
+ "path": "/about",
42
+ "contentTemplate": "$contentDir/about.md",
43
+ "layoutTemplate": "$layoutsDir/main_layout.njk"
44
+ }
45
+ ],
46
+ "assets": [
47
+ {
48
+ "alias": "assetsDir",
49
+ "dir": "$rootDir/src/assets",
50
+ "urlPath": "/public/assets"
51
+ },
52
+ {
53
+ "alias": "favicon",
54
+ "file": "$rootDir/src/assets/favicon.ico",
55
+ "urlPath": "/favicon.ico"
56
+ }
57
+ ]
58
+ }
59
+ ```
60
+
61
+ ## Running the Project in dev Mode
62
+
63
+ ```bash
64
+ yarn install
65
+ yarn dev
66
+ ```
67
+
68
+ Open the site at [http://localhost:3000](http://localhost:3000)
69
+
70
+ ## Statically Generate and Preview the Site
71
+
72
+ ```bash
73
+ yarn build
74
+ yarn start
75
+ ```
76
+
77
+ Open the site at [http://localhost:3000](http://localhost:3000)
@@ -0,0 +1,30 @@
1
+ {
2
+ "lwc": { "modules": [{ "dir": "$rootDir/src/modules" }] },
3
+ "routes": [
4
+ {
5
+ "id": "Home",
6
+ "path": "/",
7
+ "contentTemplate": "$contentDir/home.md",
8
+ "layoutTemplate": "$layoutsDir/main_layout.njk"
9
+ },
10
+ {
11
+ "id": "About",
12
+ "path": "/about",
13
+ "contentTemplate": "$contentDir/about.md",
14
+ "layoutTemplate": "$layoutsDir/main_layout.njk"
15
+ }
16
+ ],
17
+ "assets": [
18
+ {
19
+ "alias": "assetsDir",
20
+ "dir": "$rootDir/src/assets",
21
+ "urlPath": "/public/assets"
22
+ },
23
+ {
24
+ "alias": "favicon",
25
+ "file": "$rootDir/src/assets/favicon.ico",
26
+ "urlPath": "/favicon.ico"
27
+ }
28
+ ],
29
+ "moduleProviders": []
30
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "lwr-markdown-static-site",
3
+ "version": "0.0.1",
4
+ "license": "MIT",
5
+ "private": true,
6
+ "type": "module",
7
+ "scripts": {
8
+ "clean": "rimraf node_modules __lwr_cache__ site",
9
+ "dev": "lwr dev",
10
+ "build": "lwr build --clean",
11
+ "start": "lwr start",
12
+ "stage": "yarn build && yarn start"
13
+ },
14
+ "dependencies": {
15
+ "lwr": "latest"
16
+ },
17
+ "engines": {
18
+ "node": ">=18.0.0"
19
+ },
20
+ "volta": {
21
+ "node": "20.16.0"
22
+ }
23
+ }
@@ -0,0 +1,95 @@
1
+ :root {
2
+ --color-bg-hero: #e4f2f8;
3
+ --color-bg-hero-dark: #d5e8f0;
4
+ --color-bg-section: #ffffff;
5
+ --color-bg-section-shade: #f4f5f6;
6
+ --color-bg-footer: #f7f7f7;
7
+ --color-bg-card: #e4f2f8;
8
+ --color-bg-search: #f4f5f6;
9
+ --color-text-link-footer: #707070;
10
+ --primary-color-blue: #02a0e0;
11
+ --primary-color-darkblue: #16325c;
12
+ --primary-color-blue-highlight: #def1fa;
13
+ --spotlight-bg: #ffffff;
14
+ --sidebar-width: 250px;
15
+ --sidebar-width-full: 300px;
16
+ --border-gray: #eee solid 2px;
17
+ --card-box-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14),
18
+ 0 1px 3px 0 rgba(0, 0, 0, 0.12);
19
+ --trigger-box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
20
+ --nav-box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
21
+
22
+ /* button colors */
23
+ --button-color: #ffffff;
24
+ --button-color-bg: #02a0e0;
25
+ --button-color-bg-active: #007aac;
26
+ --button-brand-color-bg: #ff6000;
27
+ --button-brand-color-bg-active: #df5400;
28
+ }
29
+
30
+ body {
31
+ display: grid;
32
+ justify-content: center;
33
+ margin: 20px;
34
+ }
35
+
36
+ .wrapper {
37
+ width: 900px;
38
+ display: grid;
39
+ grid-template-columns: 100%;
40
+ gap: 3em;
41
+ }
42
+
43
+ header {
44
+ width: 200px;
45
+ justify-self: center;
46
+ }
47
+
48
+ nav {
49
+ justify-self: center;
50
+ }
51
+
52
+ nav ul {
53
+ display: flex;
54
+ gap: 2em;
55
+ }
56
+
57
+ nav ul li a {
58
+ padding: 12px 20px;
59
+ font-size: 1.5em;
60
+ background-color: var(--primary-color-blue-highlight);
61
+ border-radius: 7px;
62
+ color: var(--primary-color-blue);
63
+ text-decoration: none;
64
+ }
65
+
66
+ html {
67
+ font-family: 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial,
68
+ 'Lucida Grande', sans-serif;
69
+ font-weight: 300;
70
+ font-size: 16px;
71
+ line-height: 1.6;
72
+ box-sizing: border-box;
73
+ }
74
+
75
+ nav ul li a:hover {
76
+ background-color: var(--primary-color-darkblue);
77
+ color: white;
78
+ transition: background-color .25s;
79
+ }
80
+
81
+ main {
82
+ min-width: 100%;
83
+ justify-self: start;
84
+ }
85
+
86
+ ul {
87
+ list-style: none;
88
+ margin-top: 0;
89
+ padding-left: 0;
90
+ }
91
+
92
+ h1 {
93
+ font-size: 2rem;
94
+ font-weight: 300;
95
+ }
@@ -0,0 +1,5 @@
1
+ # About LWR
2
+
3
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Amet facilisis magna etiam tempor. Lobortis elementum nibh tellus molestie nunc non blandit massa. In ornare quam viverra orci sagittis eu volutpat odio. Ultricies mi eget mauris pharetra et. Mi tempus imperdiet nulla malesuada pellentesque. Cras sed felis eget velit aliquet. Hendrerit gravida rutrum quisque non tellus orci ac auctor augue. Arcu non odio euismod lacinia at quis risus sed. Enim tortor at auctor urna. Risus sed vulputate odio ut enim blandit. Netus et malesuada fames ac turpis egestas sed. Orci dapibus ultrices in iaculis nunc. Arcu bibendum at varius vel pharetra vel turpis nunc eget. Duis at consectetur lorem donec massa. Lorem ipsum dolor sit amet consectetur adipiscing elit. Egestas congue quisque egestas diam in arcu cursus. Pulvinar mattis nunc sed blandit libero volutpat. At tempor commodo ullamcorper a lacus vestibulum sed arcu non. Viverra tellus in hac habitasse platea dictumst vestibulum rhoncus.
4
+
5
+ Ullamcorper a lacus vestibulum sed arcu non odio. Tortor dignissim convallis aenean et tortor. Faucibus purus in massa tempor nec feugiat nisl. In hendrerit gravida rutrum quisque non tellus. Blandit massa enim nec dui nunc mattis enim ut. Neque sodales ut etiam sit amet nisl purus in mollis. Odio pellentesque diam volutpat commodo sed egestas egestas fringilla. Metus vulputate eu scelerisque felis imperdiet. Interdum posuere lorem ipsum dolor. Ultrices in iaculis nunc sed augue lacus viverra vitae. Velit euismod in pellentesque massa placerat duis ultricies. Et ultrices neque ornare aenean euismod elementum nisi quis.
@@ -0,0 +1,5 @@
1
+ # Welcome to your LWR powered website
2
+
3
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Amet facilisis magna etiam tempor. Lobortis elementum nibh tellus molestie nunc non blandit massa. In ornare quam viverra orci sagittis eu volutpat odio. Ultricies mi eget mauris pharetra et. Mi tempus imperdiet nulla malesuada pellentesque. Cras sed felis eget velit aliquet. Hendrerit gravida rutrum quisque non tellus orci ac auctor augue. Arcu non odio euismod lacinia at quis risus sed. Enim tortor at auctor urna. Risus sed vulputate odio ut enim blandit. Netus et malesuada fames ac turpis egestas sed. Orci dapibus ultrices in iaculis nunc. Arcu bibendum at varius vel pharetra vel turpis nunc eget. Duis at consectetur lorem donec massa. Lorem ipsum dolor sit amet consectetur adipiscing elit. Egestas congue quisque egestas diam in arcu cursus. Pulvinar mattis nunc sed blandit libero volutpat. At tempor commodo ullamcorper a lacus vestibulum sed arcu non. Viverra tellus in hac habitasse platea dictumst vestibulum rhoncus.
4
+
5
+ Ullamcorper a lacus vestibulum sed arcu non odio. Tortor dignissim convallis aenean et tortor. Faucibus purus in massa tempor nec feugiat nisl. In hendrerit gravida rutrum quisque non tellus. Blandit massa enim nec dui nunc mattis enim ut. Neque sodales ut etiam sit amet nisl purus in mollis. Odio pellentesque diam volutpat commodo sed egestas egestas fringilla. Metus vulputate eu scelerisque felis imperdiet. Interdum posuere lorem ipsum dolor. Ultrices in iaculis nunc sed augue lacus viverra vitae. Velit euismod in pellentesque massa placerat duis ultricies. Et ultrices neque ornare aenean euismod elementum nisi quis.
@@ -0,0 +1,27 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
6
+ <title></title>
7
+ <link rel="stylesheet" href="$assetsDir/css/main.css" />
8
+ </head>
9
+
10
+ <body>
11
+ <div class="wrapper">
12
+ <header>
13
+ <svg class="logo" viewBox="0 0 64 64"><path fill="#00a1e0" d="M23 6h22l-8 18h11L20 58l6-26H16l7-26z"></path><path fill="#032e61" d="M20 60a2 2 0 0 1-1.95-2.45L23.5 34H16a2 2 0 0 1-1.93-2.52l7-26A2 2 0 0 1 23 4h22a2 2 0 0 1 1.83 2.81L40.08 22H48a2 2 0 0 1 1.54 3.27l-28 34A2 2 0 0 1 20 60zm-1.4-30H26a2 2 0 0 1 1.95 2.45l-4.1 17.72L43.76 26H37a2 2 0 0 1-1.83-2.81L41.92 8h-17.4z"></path><path fill="#fff" d="M26 26a2 2 0 0 1-1.93-2.53l3-11a2 2 0 1 1 3.86 1.05l-3 11A2 2 0 0 1 26 26z"></path></svg>
14
+ </header>
15
+ <nav>
16
+ <ul>
17
+ <li><a href="/">Home</a>
18
+ <li><a href="/about">About</a>
19
+ <li><a href="//developer.salesforce.com/docs/platform/lwr/overview">Learn LWR</a>
20
+ </ul>
21
+ </nav>
22
+ <main>
23
+ {{ body | safe }}
24
+ </main>
25
+ </div>
26
+ </body>
27
+ </html>