@swizzyweb/swizzy-frontend-template-web-service 0.2.1 → 0.2.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 +202 -0
- package/bundle/css/styles.css +4 -1
- package/bundle/js/bundle.js +40 -34
- package/dist/routers/ApiRouter/api-router.js.map +1 -1
- package/dist/routers/ApiRouter/controllers/funny-joke-controller.js.map +1 -1
- package/dist/routers/PageRouter/page-router.js +1 -2
- package/dist/routers/PageRouter/page-router.js.map +1 -1
- package/eslint.config.js +23 -0
- package/package.json +14 -7
- package/react/FunnyJokeTeller.tsx +1 -1
- package/src/routers/ApiRouter/api-router.ts +0 -3
- package/src/routers/ApiRouter/controllers/funny-joke-controller.ts +1 -3
- package/src/routers/PageRouter/page-router.ts +1 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-router.js","sourceRoot":"","sources":["../../../src/routers/ApiRouter/api-router.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EACnB,uBAAuB,EAGvB,uBAAuB,EACvB,SAAS,GACV,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"api-router.js","sourceRoot":"","sources":["../../../src/routers/ApiRouter/api-router.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EACnB,uBAAuB,EAGvB,uBAAuB,EACvB,SAAS,GACV,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAQ7E,MAAM,OAAO,YAAa,SAAQ,SAGjC;IACC,YAAY,KAAqB;QAC/B,KAAK,CAAC;YACJ,GAAG,KAAK;YACR,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,KAAK;YACX,cAAc,EAAE,uBAAuB;YACvC,oBAAoB,EAAE,CAAC,mBAAmB,CAAC;YAC3C,UAAU,EAAE;gBACV,uBAAuB;gBACvB,mBAAmB;gBACnB,uBAAuB;aACxB;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,uBAAuB,GAGzB,KAAK,WACP,KAAyD;IAEzD,OAAO,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;AAC5B,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"funny-joke-controller.js","sourceRoot":"","sources":["../../../../src/routers/ApiRouter/controllers/funny-joke-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EAGpB,aAAa,EACb,aAAa,GAEd,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"funny-joke-controller.js","sourceRoot":"","sources":["../../../../src/routers/ApiRouter/controllers/funny-joke-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EAGpB,aAAa,EACb,aAAa,GAEd,MAAM,+BAA+B,CAAC;AAYvC,MAAM,OAAO,mBAAoB,SAAQ,aAGxC;IACC,YAAY,KAA+B;QACzC,KAAK,CAAC;YACJ,GAAG,KAAK;YACR,IAAI,EAAE,qBAAqB;YAC3B,MAAM,EAAE,WAAW;YACnB,MAAM,EAAE,aAAa,CAAC,GAAG;YACzB,cAAc,EAAE,oBAAoB;YACpC,UAAU,EAAE,EAAE;SACf,CAAC,CAAC;IACL,CAAC;IAES,KAAK,CAAC,wBAAwB,CACtC,KAEC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1C,OAAO,KAAK,WAAW,GAAY,EAAE,GAAa;YAChD,MAAM,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;YAClD,IAAI,CAAC;gBACH,MAAM,EAAE,eAAe,EAAE,GAAG,QAAQ,EAAG,CAAC;gBACxC,MAAM,IAAI,GAAG,MAAM,eAAe,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;gBACpD,GAAG,CAAC,IAAI,CAAC;oBACP,OAAO,EAAE,wBAAwB;oBACjC,IAAI;iBACL,CAAC,CAAC;YACL,CAAC;YAAC,OAAO,CAAM,EAAE,CAAC;gBAChB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBAChB,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC,CAAC;YACnD,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { RequestIdMiddleware, RequestLoggerMiddleware, SwizzyRequestMiddleware, WebRouter, } from "@swizzyweb/swizzy-web-service";
|
|
2
2
|
import path from "path";
|
|
3
|
-
|
|
4
|
-
import express from "@swizzyweb/express";
|
|
3
|
+
import express from "express";
|
|
5
4
|
import { fileURLToPath } from "node:url";
|
|
6
5
|
// This gives you the directory where *this* file is located
|
|
7
6
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-router.js","sourceRoot":"","sources":["../../../src/routers/PageRouter/page-router.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EACnB,uBAAuB,EAGvB,uBAAuB,EACvB,SAAS,GACV,MAAM,+BAA+B,CAAC;AAEvC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,
|
|
1
|
+
{"version":3,"file":"page-router.js","sourceRoot":"","sources":["../../../src/routers/PageRouter/page-router.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EACnB,uBAAuB,EAGvB,uBAAuB,EACvB,SAAS,GACV,MAAM,+BAA+B,CAAC;AAEvC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,4DAA4D;AAC5D,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAM3C,MAAM,OAAO,aAAc,SAAQ,SAGlC;IACC,YAAY,KAAsB;QAChC,KAAK,CAAC;YACJ,GAAG,KAAK;YACR,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,EAAE;YACR,cAAc,EAAE,wBAAwB;YACxC,oBAAoB,EAAE,EAAE;YACxB,UAAU,EAAE;gBACV,uBAAuB;gBACvB,mBAAmB;gBACnB,uBAAuB;gBACvB,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;aAC9D;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,wBAAwB,GAG1B,KAAK,WACP,KAAyD;IAEzD,OAAO,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;AAC5B,CAAC,CAAC"}
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// eslint.config.js
|
|
2
|
+
import { defineConfig } from "eslint/config";
|
|
3
|
+
|
|
4
|
+
import tseslint from "@typescript-eslint/eslint-plugin";
|
|
5
|
+
import parser from "@typescript-eslint/parser";
|
|
6
|
+
|
|
7
|
+
export default [
|
|
8
|
+
{
|
|
9
|
+
files: ["**/*.ts"],
|
|
10
|
+
languageOptions: {
|
|
11
|
+
parser,
|
|
12
|
+
parserOptions: {
|
|
13
|
+
project: "./tsconfig.json",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
plugins: {
|
|
17
|
+
"@typescript-eslint": tseslint,
|
|
18
|
+
},
|
|
19
|
+
rules: {
|
|
20
|
+
"@typescript-eslint/no-floating-promises": "error",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swizzyweb/swizzy-frontend-template-web-service",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Template for swizzyweb frontend web services",
|
|
5
5
|
"main": "dist/app.js",
|
|
6
6
|
"type": "module",
|
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
"build:service": "tsc",
|
|
12
12
|
"build": "npm run build:webpack && npm run build:service",
|
|
13
13
|
"start:webpack": "webpack serve --config webpack.config.cjs",
|
|
14
|
-
"build:webpack": "webpack --config webpack.config.cjs"
|
|
14
|
+
"build:webpack": "webpack --config webpack.config.cjs",
|
|
15
|
+
"lint": "eslint .",
|
|
16
|
+
"lint:fix": "eslint . --fix"
|
|
15
17
|
},
|
|
16
18
|
"keywords": [
|
|
17
19
|
"react",
|
|
@@ -20,17 +22,21 @@
|
|
|
20
22
|
"route-optimizer",
|
|
21
23
|
"typescript"
|
|
22
24
|
],
|
|
23
|
-
"license": "
|
|
25
|
+
"license": "Apache-2.0",
|
|
24
26
|
"devDependencies": {
|
|
25
27
|
"@babel/core": "^7.28.4",
|
|
26
28
|
"@babel/preset-env": "^7.28.3",
|
|
27
29
|
"@babel/preset-react": "^7.27.1",
|
|
28
30
|
"@babel/preset-typescript": "^7.27.1",
|
|
29
|
-
"@swizzyweb/swerve": "^0.
|
|
31
|
+
"@swizzyweb/swerve": "^0.6.0",
|
|
30
32
|
"@tailwindcss/postcss": "^4.1.13",
|
|
33
|
+
"@types/express": "^5.0.6",
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "^8.54.0",
|
|
35
|
+
"@typescript-eslint/parser": "^8.54.0",
|
|
31
36
|
"autoprefixer": "^10.4.21",
|
|
32
37
|
"babel-loader": "^9.2.1",
|
|
33
38
|
"css-loader": "^7.1.2",
|
|
39
|
+
"eslint": "^9.39.2",
|
|
34
40
|
"html-webpack-plugin": "^5.6.4",
|
|
35
41
|
"mini-css-extract-plugin": "^2.9.4",
|
|
36
42
|
"postcss": "^8.5.6",
|
|
@@ -43,9 +49,10 @@
|
|
|
43
49
|
"webpack-dev-server": "^5.2.2"
|
|
44
50
|
},
|
|
45
51
|
"dependencies": {
|
|
46
|
-
"@swizzyweb/express": "^
|
|
47
|
-
"@swizzyweb/swizzy-common": "^0.3.
|
|
48
|
-
"@swizzyweb/swizzy-web-service": "^0.
|
|
52
|
+
"@swizzyweb/express-unuse": "^1.0.1",
|
|
53
|
+
"@swizzyweb/swizzy-common": "^0.3.3",
|
|
54
|
+
"@swizzyweb/swizzy-web-service": "^0.6.0",
|
|
55
|
+
"express": "^5.2.1",
|
|
49
56
|
"react": "^18.3.1",
|
|
50
57
|
"react-dom": "^18.3.1"
|
|
51
58
|
}
|
|
@@ -13,7 +13,7 @@ export function FunnyJokeTeller(props: any) {
|
|
|
13
13
|
let [punchlineText, setPunchlineText] = useState("");
|
|
14
14
|
let [categoryText, setCategoryText] = useState("");
|
|
15
15
|
async function getFunnyJoke() {
|
|
16
|
-
const res = await fetch("
|
|
16
|
+
const res = await fetch("api/funnyJoke", {
|
|
17
17
|
method: "get",
|
|
18
18
|
});
|
|
19
19
|
const body = await res.json();
|
|
@@ -8,9 +8,6 @@ import {
|
|
|
8
8
|
WebRouter,
|
|
9
9
|
} from "@swizzyweb/swizzy-web-service";
|
|
10
10
|
import { SampleFrontendWebServiceState } from "../../web-service.js";
|
|
11
|
-
import path from "path";
|
|
12
|
-
// @ts-ignore
|
|
13
|
-
import express from "@swizzyweb/express";
|
|
14
11
|
import { FunnyJokeController } from "./controllers/funny-joke-controller.js";
|
|
15
12
|
import { IFunnyJokeClient } from "../../client/index.js";
|
|
16
13
|
export interface ApiRouterState {
|
|
@@ -7,9 +7,7 @@ import {
|
|
|
7
7
|
WebControllerFunction,
|
|
8
8
|
} from "@swizzyweb/swizzy-web-service";
|
|
9
9
|
import { ApiRouterState, ApiWebRouter } from "../api-router.js";
|
|
10
|
-
|
|
11
|
-
import { Request, Response, json } from "@swizzyweb/express";
|
|
12
|
-
import path from "path";
|
|
10
|
+
import { Request, Response, json } from "express";
|
|
13
11
|
import { IFunnyJokeClient } from "../../../client/index.js";
|
|
14
12
|
|
|
15
13
|
export interface FunnyJokeControllerState {
|
|
@@ -9,8 +9,7 @@ import {
|
|
|
9
9
|
} from "@swizzyweb/swizzy-web-service";
|
|
10
10
|
import { SampleFrontendWebServiceState } from "../../web-service.js";
|
|
11
11
|
import path from "path";
|
|
12
|
-
|
|
13
|
-
import express from "@swizzyweb/express";
|
|
12
|
+
import express from "express";
|
|
14
13
|
import { fileURLToPath } from "node:url";
|
|
15
14
|
|
|
16
15
|
// This gives you the directory where *this* file is located
|