@wwawing/page-generator 3.13.0-unstable.based-on.3.12.11.p.12 → 4.0.2

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2018-2023 WWA Wing
3
+ Copyright (c) 2018-2026 WWA Wing
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -17,6 +17,9 @@ export interface GameOption {
17
17
  controllerId?: string;
18
18
  };
19
19
  debugConsole?: {};
20
+ wwaScript?: {
21
+ userDefinedScriptsFile: string;
22
+ };
20
23
  }
21
24
  export interface Resources {
22
25
  mapData: string;
@@ -25,4 +28,5 @@ export interface Resources {
25
28
  wwaCss?: string;
26
29
  titleImage?: string;
27
30
  userVarNamesFile?: string;
31
+ pictureImageNamesFile?: string;
28
32
  }
@@ -1,4 +1,4 @@
1
1
  import * as DataTypes from "../data-types";
2
- export declare function generateOfficialCopyright(): DataTypes.Copyright;
2
+ export declare function generateOfficialCopyright(date?: Date): DataTypes.Copyright;
3
3
  export declare function generateWWAWingCopyright(date?: Date): DataTypes.Copyright;
4
4
  export declare function generateCopyrights(configCopyright: DataTypes.BuiltInCopyright | DataTypes.Copyright[] | undefined): DataTypes.Copyright[];
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateCopyrights = exports.generateWWAWingCopyright = exports.generateOfficialCopyright = void 0;
4
- function generateOfficialCopyright() {
3
+ exports.generateOfficialCopyright = generateOfficialCopyright;
4
+ exports.generateWWAWingCopyright = generateWWAWingCopyright;
5
+ exports.generateCopyrights = generateCopyrights;
6
+ function generateOfficialCopyright(date = new Date()) {
5
7
  return {
6
8
  range: {
7
9
  firstYear: 1996,
8
- lastYear: 2016,
10
+ lastYear: date.getFullYear(),
9
11
  },
10
12
  product: {
11
13
  genre: "Internet RPG",
@@ -15,7 +17,6 @@ function generateOfficialCopyright() {
15
17
  credit: "NAO",
16
18
  };
17
19
  }
18
- exports.generateOfficialCopyright = generateOfficialCopyright;
19
20
  function generateWWAWingCopyright(date = new Date()) {
20
21
  return {
21
22
  range: {
@@ -29,7 +30,6 @@ function generateWWAWingCopyright(date = new Date()) {
29
30
  credit: "WWA Wing Team",
30
31
  };
31
32
  }
32
- exports.generateWWAWingCopyright = generateWWAWingCopyright;
33
33
  function generateCopyrights(configCopyright) {
34
34
  switch (configCopyright) {
35
35
  case undefined:
@@ -42,4 +42,3 @@ function generateCopyrights(configCopyright) {
42
42
  return configCopyright;
43
43
  }
44
44
  }
45
- exports.generateCopyrights = generateCopyrights;
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toStringBooleanOptional = exports.toStringBoolean = void 0;
3
+ exports.toStringBoolean = toStringBoolean;
4
+ exports.toStringBooleanOptional = toStringBooleanOptional;
4
5
  function toStringBoolean(x) {
5
6
  return x ? "true" : "false";
6
7
  }
7
- exports.toStringBoolean = toStringBoolean;
8
8
  function toStringBooleanOptional(x) {
9
9
  return x === undefined ? undefined : toStringBoolean(x);
10
10
  }
11
- exports.toStringBooleanOptional = toStringBooleanOptional;
package/lib/index.d.ts CHANGED
@@ -33,6 +33,8 @@ export interface TemplateValues {
33
33
  "data-wwa-virtualpad-enable"?: string;
34
34
  "data-wwa-virtualpad-viewport-fit-enable"?: string;
35
35
  "data-wwa-virtualpad-controller-elm"?: string;
36
+ "data-wwa-user-defined-scripts-file"?: string;
37
+ "data-wwa-picture-image-names-file"?: string;
36
38
  };
37
39
  };
38
40
  debugConsoleElement?: {
package/lib/index.js CHANGED
@@ -15,20 +15,30 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.render = void 0;
36
+ exports.render = render;
27
37
  const pug = __importStar(require("pug"));
28
- const path = __importStar(require("path"));
38
+ const path = __importStar(require("node:path"));
29
39
  const Helper = __importStar(require("./helper"));
30
40
  function generateTemplateValues({ page, wwa, copyrights }) {
31
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
41
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
32
42
  return {
33
43
  head: {
34
44
  pageTitle: (page === null || page === void 0 ? void 0 : page.title) || "World Wide Adventure Wing",
@@ -54,11 +64,13 @@ function generateTemplateValues({ page, wwa, copyrights }) {
54
64
  "data-wwa-virtualpad-enable": Helper.toStringBooleanOptional((_p = (_o = wwa.gameOption) === null || _o === void 0 ? void 0 : _o.virtualPad) === null || _p === void 0 ? void 0 : _p.enable),
55
65
  "data-wwa-virtualpad-viewport-fit-enable": Helper.toStringBooleanOptional((_r = (_q = wwa.gameOption) === null || _q === void 0 ? void 0 : _q.virtualPad) === null || _r === void 0 ? void 0 : _r.viewportFitEnable),
56
66
  "data-wwa-virtualpad-controller-elm": ((_t = (_s = wwa.gameOption) === null || _s === void 0 ? void 0 : _s.virtualPad) === null || _t === void 0 ? void 0 : _t.controllerId) ? `#${wwa.gameOption.virtualPad.controllerId}` : undefined,
67
+ "data-wwa-user-defined-scripts-file": (_v = (_u = wwa.gameOption) === null || _u === void 0 ? void 0 : _u.wwaScript) === null || _v === void 0 ? void 0 : _v.userDefinedScriptsFile,
68
+ "data-wwa-picture-image-names-file": wwa.resources.pictureImageNamesFile,
57
69
  }
58
70
  },
59
- debugConsoleElement: ((_u = wwa.gameOption) === null || _u === void 0 ? void 0 : _u.debugConsole) ? { id: "wwa-debug-console-area" } : undefined,
60
- varDumpElement: ((_w = (_v = wwa.gameOption) === null || _v === void 0 ? void 0 : _v.userVars) === null || _w === void 0 ? void 0 : _w.dumpElementId) ? { id: wwa.gameOption.userVars.dumpElementId } : undefined,
61
- virtualPadController: ((_y = (_x = wwa.gameOption) === null || _x === void 0 ? void 0 : _x.virtualPad) === null || _y === void 0 ? void 0 : _y.controllerId) ? { id: wwa.gameOption.virtualPad.controllerId } : undefined,
71
+ debugConsoleElement: ((_w = wwa.gameOption) === null || _w === void 0 ? void 0 : _w.debugConsole) ? { id: "wwa-debug-console-area" } : undefined,
72
+ varDumpElement: ((_y = (_x = wwa.gameOption) === null || _x === void 0 ? void 0 : _x.userVars) === null || _y === void 0 ? void 0 : _y.dumpElementId) ? { id: wwa.gameOption.userVars.dumpElementId } : undefined,
73
+ virtualPadController: ((_0 = (_z = wwa.gameOption) === null || _z === void 0 ? void 0 : _z.virtualPad) === null || _0 === void 0 ? void 0 : _0.controllerId) ? { id: wwa.gameOption.virtualPad.controllerId } : undefined,
62
74
  footer: {
63
75
  copyrights: Helper.generateCopyrights(copyrights)
64
76
  }
@@ -70,4 +82,3 @@ function render(config) {
70
82
  const compileTemplate = pug.compileFile(pugFilePath, { pretty: true });
71
83
  return compileTemplate(templateValues) + "\n";
72
84
  }
73
- exports.render = render;
package/lib/wwa.pug CHANGED
@@ -29,6 +29,8 @@ html(lang="ja")
29
29
  data-wwa-virtualpad-enable=wwa.attributes["data-wwa-virtualpad-enable"]
30
30
  data-wwa-virtualpad-viewport-fit-enable=wwa.attributes["data-wwa-virtualpad-viewport-fit-enable"]
31
31
  data-wwa-virtualpad-controller-elm=wwa.attributes["data-wwa-virtualpad-controller-elm"]
32
+ data-wwa-user-defined-scripts-file=wwa.attributes["data-wwa-user-defined-scripts-file"]
33
+ data-wwa-picture-image-names-file=wwa.attributes["data-wwa-picture-image-names-file"]
32
34
  )
33
35
 
34
36
  if virtualPadController
@@ -17,6 +17,9 @@ export interface GameOption {
17
17
  controllerId?: string;
18
18
  };
19
19
  debugConsole?: {};
20
+ wwaScript?: {
21
+ userDefinedScriptsFile: string;
22
+ };
20
23
  }
21
24
  export interface Resources {
22
25
  mapData: string;
@@ -25,4 +28,5 @@ export interface Resources {
25
28
  wwaCss?: string;
26
29
  titleImage?: string;
27
30
  userVarNamesFile?: string;
31
+ pictureImageNamesFile?: string;
28
32
  }
@@ -1,4 +1,4 @@
1
1
  import * as DataTypes from "../data-types";
2
- export declare function generateOfficialCopyright(): DataTypes.Copyright;
2
+ export declare function generateOfficialCopyright(date?: Date): DataTypes.Copyright;
3
3
  export declare function generateWWAWingCopyright(date?: Date): DataTypes.Copyright;
4
4
  export declare function generateCopyrights(configCopyright: DataTypes.BuiltInCopyright | DataTypes.Copyright[] | undefined): DataTypes.Copyright[];
@@ -1,8 +1,8 @@
1
- export function generateOfficialCopyright() {
1
+ export function generateOfficialCopyright(date = new Date()) {
2
2
  return {
3
3
  range: {
4
4
  firstYear: 1996,
5
- lastYear: 2016,
5
+ lastYear: date.getFullYear(),
6
6
  },
7
7
  product: {
8
8
  genre: "Internet RPG",
package/module/index.d.ts CHANGED
@@ -33,6 +33,8 @@ export interface TemplateValues {
33
33
  "data-wwa-virtualpad-enable"?: string;
34
34
  "data-wwa-virtualpad-viewport-fit-enable"?: string;
35
35
  "data-wwa-virtualpad-controller-elm"?: string;
36
+ "data-wwa-user-defined-scripts-file"?: string;
37
+ "data-wwa-picture-image-names-file"?: string;
36
38
  };
37
39
  };
38
40
  debugConsoleElement?: {
package/module/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as pug from "pug";
2
- import * as path from "path";
2
+ import * as path from "node:path";
3
3
  import * as Helper from "./helper";
4
4
  function generateTemplateValues({ page, wwa, copyrights }) {
5
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
5
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
6
6
  return {
7
7
  head: {
8
8
  pageTitle: (page === null || page === void 0 ? void 0 : page.title) || "World Wide Adventure Wing",
@@ -28,11 +28,13 @@ function generateTemplateValues({ page, wwa, copyrights }) {
28
28
  "data-wwa-virtualpad-enable": Helper.toStringBooleanOptional((_p = (_o = wwa.gameOption) === null || _o === void 0 ? void 0 : _o.virtualPad) === null || _p === void 0 ? void 0 : _p.enable),
29
29
  "data-wwa-virtualpad-viewport-fit-enable": Helper.toStringBooleanOptional((_r = (_q = wwa.gameOption) === null || _q === void 0 ? void 0 : _q.virtualPad) === null || _r === void 0 ? void 0 : _r.viewportFitEnable),
30
30
  "data-wwa-virtualpad-controller-elm": ((_t = (_s = wwa.gameOption) === null || _s === void 0 ? void 0 : _s.virtualPad) === null || _t === void 0 ? void 0 : _t.controllerId) ? `#${wwa.gameOption.virtualPad.controllerId}` : undefined,
31
+ "data-wwa-user-defined-scripts-file": (_v = (_u = wwa.gameOption) === null || _u === void 0 ? void 0 : _u.wwaScript) === null || _v === void 0 ? void 0 : _v.userDefinedScriptsFile,
32
+ "data-wwa-picture-image-names-file": wwa.resources.pictureImageNamesFile,
31
33
  }
32
34
  },
33
- debugConsoleElement: ((_u = wwa.gameOption) === null || _u === void 0 ? void 0 : _u.debugConsole) ? { id: "wwa-debug-console-area" } : undefined,
34
- varDumpElement: ((_w = (_v = wwa.gameOption) === null || _v === void 0 ? void 0 : _v.userVars) === null || _w === void 0 ? void 0 : _w.dumpElementId) ? { id: wwa.gameOption.userVars.dumpElementId } : undefined,
35
- virtualPadController: ((_y = (_x = wwa.gameOption) === null || _x === void 0 ? void 0 : _x.virtualPad) === null || _y === void 0 ? void 0 : _y.controllerId) ? { id: wwa.gameOption.virtualPad.controllerId } : undefined,
35
+ debugConsoleElement: ((_w = wwa.gameOption) === null || _w === void 0 ? void 0 : _w.debugConsole) ? { id: "wwa-debug-console-area" } : undefined,
36
+ varDumpElement: ((_y = (_x = wwa.gameOption) === null || _x === void 0 ? void 0 : _x.userVars) === null || _y === void 0 ? void 0 : _y.dumpElementId) ? { id: wwa.gameOption.userVars.dumpElementId } : undefined,
37
+ virtualPadController: ((_0 = (_z = wwa.gameOption) === null || _z === void 0 ? void 0 : _z.virtualPad) === null || _0 === void 0 ? void 0 : _0.controllerId) ? { id: wwa.gameOption.virtualPad.controllerId } : undefined,
36
38
  footer: {
37
39
  copyrights: Helper.generateCopyrights(copyrights)
38
40
  }
package/module/wwa.pug CHANGED
@@ -29,6 +29,8 @@ html(lang="ja")
29
29
  data-wwa-virtualpad-enable=wwa.attributes["data-wwa-virtualpad-enable"]
30
30
  data-wwa-virtualpad-viewport-fit-enable=wwa.attributes["data-wwa-virtualpad-viewport-fit-enable"]
31
31
  data-wwa-virtualpad-controller-elm=wwa.attributes["data-wwa-virtualpad-controller-elm"]
32
+ data-wwa-user-defined-scripts-file=wwa.attributes["data-wwa-user-defined-scripts-file"]
33
+ data-wwa-picture-image-names-file=wwa.attributes["data-wwa-picture-image-names-file"]
32
34
  )
33
35
 
34
36
  if virtualPadController
package/package.json CHANGED
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "name": "@wwawing/page-generator",
3
- "version": "3.13.0-unstable.based-on.3.12.11.p.12",
3
+ "version": "4.0.2",
4
4
  "description": "a HTML file generator for WWA Wing",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/WWAWing/WWAWing.git",
10
+ "directory": "packages/page-generator"
11
+ },
7
12
  "scripts": {
8
13
  "test": "echo \"Error: no test specified\" && exit 1",
9
14
  "start": "npm run build && shx mkdir -p output && node debug/debug.js",
@@ -12,7 +17,8 @@
12
17
  "build:module": "tsc -p ./tsconfig.module.json && shx cp ./src/wwa.pug ./module/wwa.pug",
13
18
  "clean": "run-s clean:*",
14
19
  "clean:lib": "shx rm -rf ./lib",
15
- "clean:module": "shx rm -rf ./module"
20
+ "clean:module": "shx rm -rf ./module",
21
+ "type-check": "tsc -p . --watch --noEmit"
16
22
  },
17
23
  "files": [
18
24
  "lib",
@@ -26,22 +32,22 @@
26
32
  "author": "WWA Wing Team",
27
33
  "license": "MIT",
28
34
  "devDependencies": {
29
- "@types/node": "^18.11.9",
35
+ "@types/node": "^24",
30
36
  "@types/pug": "^2.0.6",
31
- "npm-run-all": "^4.1.5",
32
- "shelljs": "^0.8.5",
33
- "shx": "^0.3.4",
34
- "typescript": "^5.0.4"
37
+ "npm-run-all2": "^8.0.1",
38
+ "shelljs": "^0.10.0",
39
+ "shx": "^0.4.0",
40
+ "typescript": "^5.8.3"
35
41
  },
36
42
  "dependencies": {
37
- "pug": "^3.0.2"
43
+ "pug": "^3.0.3"
38
44
  },
39
45
  "publishConfig": {
40
46
  "access": "public"
41
47
  },
42
48
  "engines": {
43
- "node": ">=18",
44
- "npm": ">=8"
49
+ "node": ">=24",
50
+ "npm": ">=11"
45
51
  },
46
- "gitHead": "0324a3422986640c95d7be6e1df99e6663702249"
52
+ "gitHead": "86e576667cba53fbd81af94aea4a5efb58c2e0c6"
47
53
  }