tungsten 0.3.8 → 0.3.9

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.
@@ -1 +1 @@
1
- 1786136431615
1
+ 1786138356533
@@ -3,7 +3,6 @@ import express from 'express';
3
3
  import { FrameworkConfigComplete } from 'tungsten/FrameworkConfig.js';
4
4
  export declare class StaticSiteServer {
5
5
  config: FrameworkConfigComplete;
6
- port: number;
7
6
  location?: string;
8
7
  app: express.Application;
9
8
  server?: Server;
@@ -1 +1 @@
1
- {"version":3,"file":"StaticSiteServer.d.ts","sourceRoot":"","sources":["../../src/Servers/StaticSiteServer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AAErE,qBAAa,gBAAgB;IACzB,MAAM,EAAE,uBAAuB,CAAA;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,EAAE,OAAO,CAAC,WAAW,CAAA;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,kBAAkB,EAAE,MAAM,CAAA;gBAEd,MAAM,EAAE,uBAAuB;IAa3C,KAAK,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAQ3B;IACD,IAAI,aAEH;CACJ"}
1
+ {"version":3,"file":"StaticSiteServer.d.ts","sourceRoot":"","sources":["../../src/Servers/StaticSiteServer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AAGrE,qBAAa,gBAAgB;IACzB,MAAM,EAAE,uBAAuB,CAAA;IAE/B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,EAAE,OAAO,CAAC,WAAW,CAAA;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,kBAAkB,EAAE,MAAM,CAAA;gBAEd,MAAM,EAAE,uBAAuB;IAa3C,KAAK,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAW3B;IACD,IAAI,aAEH;CACJ"}
@@ -9,16 +9,18 @@ export class StaticSiteServer {
9
9
  // to do
10
10
  constructor(config) {
11
11
  _defineProperty(this, "config", void 0);
12
- _defineProperty(this, "port", void 0);
12
+ //port: number
13
13
  _defineProperty(this, "location", void 0);
14
14
  _defineProperty(this, "app", void 0);
15
15
  _defineProperty(this, "server", void 0);
16
16
  _defineProperty(this, "staticSiteLocation", void 0);
17
17
  _defineProperty(this, "start", () => {
18
- const location = this.location = `http://localhost:${this.port}${this.config.siteBasePath}`;
19
18
  return new Promise(resolve => {
20
- this.server = this.app.listen(this.port, () => {
21
- cliNews(`Static preview ready at ${this.location}`);
19
+ const staticSiteServer = this; // eslint-disable-line @typescript-eslint/no-this-alias
20
+ this.server = this.app.listen(0, function () {
21
+ const port = this.address().port; // eslint-disable-line no-type-assertion/no-type-assertion
22
+ const location = staticSiteServer.location = `http://localhost:${port}${staticSiteServer.config.siteBasePath}`;
23
+ cliNews(`Static preview ready at ${location}`);
22
24
  resolve(location);
23
25
  });
24
26
  });
@@ -27,7 +29,7 @@ export class StaticSiteServer {
27
29
  if (this.server !== undefined) this.server.close();
28
30
  });
29
31
  this.config = config;
30
- this.port = 3001;
32
+ //this.port = 3001
31
33
  this.app = express();
32
34
  this.staticSiteLocation = join(process.cwd(), staticSiteFolder);
33
35
  this.app.use(this.config.siteBasePath, express.static(this.staticSiteLocation));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tungsten",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "bin": {