@anansi/cli 1.2.0 → 1.4.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,33 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ### [1.4.1](https://github.com/ntucker/anansi/compare/@anansi/cli@1.4.0...@anansi/cli@1.4.1) (2022-06-12)
7
+
8
+ **Note:** Version bump only for package @anansi/cli
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.4.0](https://github.com/ntucker/anansi/compare/@anansi/cli@1.3.0...@anansi/cli@1.4.0) (2022-06-09)
15
+
16
+
17
+ ### 🚀 Features
18
+
19
+ * SSR feature to codegen ([#1528](https://github.com/ntucker/anansi/issues/1528)) ([ad4e886](https://github.com/ntucker/anansi/commit/ad4e886e073ca17b26d6c33828836a06304c1cee))
20
+
21
+
22
+
23
+ ## [1.3.0](https://github.com/ntucker/anansi/compare/@anansi/cli@1.2.0...@anansi/cli@1.3.0) (2022-05-29)
24
+
25
+
26
+ ### 🚀 Features
27
+
28
+ * --serveProxy: [non-dev] uses webpack proxy config ([774f826](https://github.com/ntucker/anansi/commit/774f82646542d8acfcb0ddceb6fc75fcc2851a01))
29
+ * Add option to serve assets with production server ([bfb20eb](https://github.com/ntucker/anansi/commit/bfb20eb1564fc2c6b72fea79d0722ac6186797fe))
30
+
31
+
32
+
6
33
  ## [1.2.0](https://github.com/ntucker/anansi/compare/@anansi/cli@1.1.70...@anansi/cli@1.2.0) (2022-05-29)
7
34
 
8
35
 
package/README.md CHANGED
@@ -67,17 +67,19 @@ Usage: anansi serve [options] <entrypath>
67
67
  runs server for SSR projects
68
68
 
69
69
  Arguments:
70
- entrypath Path to entrypoint
70
+ entrypath Path to entrypoint
71
71
 
72
72
  Options:
73
- -p, --pubPath <path> Where to serve assets from
74
- -d, --dev Run devserver rather than using previously compiled output
75
- -h, --help display help for command
73
+ --pubPath <path> Where to serve assets from
74
+ -d, --dev Run devserver rather than using previously compiled output
75
+ -a, --serveAssets [non-dev] also serves client assets
76
+ -p, --serveProxy [non-dev] uses webpack proxy config
77
+ -h, --help display help for command
76
78
  ```
77
79
 
78
80
  ```json
79
81
  {
80
82
  "start": "anansi serve --dev ./src/index.tsx",
81
- "start:prod": "anansi serve --pubPath=/assets/ ./dist-server/App.js",
83
+ "start:server": "anansi serve ./dist-server/App.js",
82
84
  }
83
85
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anansi/cli",
3
- "version": "1.2.0",
3
+ "version": "1.4.1",
4
4
  "description": "Fast React Web Apps",
5
5
  "homepage": "https://github.com/ntucker/anansi/tree/master/packages/cli#readme",
6
6
  "repository": {
@@ -51,7 +51,7 @@
51
51
  "npm": ">= 6.0.0"
52
52
  },
53
53
  "dependencies": {
54
- "@anansi/generator-js": "^8.0.7",
54
+ "@anansi/generator-js": "^8.2.0",
55
55
  "bin-version-check": "^4.0.0",
56
56
  "chalk": "^4.1.2",
57
57
  "commander": "^9.3.0",
package/run.js CHANGED
@@ -106,23 +106,25 @@ program
106
106
  .command('serve')
107
107
  .description('runs server for SSR projects')
108
108
  .argument('<entrypath>', 'Path to entrypoint')
109
- .option('-p, --pubPath <path>', 'Where to serve assets from')
109
+ .option('--pubPath <path>', 'Where to serve assets from')
110
110
  .option(
111
111
  '-d, --dev',
112
112
  'Run devserver rather than using previously compiled output',
113
113
  )
114
+ .option('-a, --serveAssets', '[non-dev] also serves client assets')
115
+ .option('-p, --serveProxy', '[non-dev] uses webpack proxy config')
114
116
  .action(async (entrypath, options) => {
115
117
  try {
116
118
  const { serve, devServe } = await import('@anansi/core/scripts');
117
119
 
118
120
  if (options.pubPath) process.env.WEBPACK_PUBLIC_PATH = options.pubPath;
119
121
  else if (!process.env.WEBPACK_PUBLIC_PATH)
120
- process.env.WEBPACK_PUBLIC_PATH = '/assets/';
122
+ process.env.WEBPACK_PUBLIC_PATH = options.dev ? '/assets/' : '/';
121
123
 
122
124
  if (options.dev) {
123
125
  devServe(entrypath);
124
126
  } else {
125
- serve(entrypath);
127
+ serve(entrypath, options);
126
128
  }
127
129
  } catch (error) {
128
130
  if (error.code === 'ERR_MODULE_NOT_FOUND') {