@sealcode/sealgen 0.11.4 → 0.11.6
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/@types/find-css-includes.d.ts +1 -0
- package/lib/add-jdd-component.js +1 -1
- package/lib/build.js +25 -26
- package/lib/cli.js +2 -2
- package/lib/find-css-includes.js +30 -0
- package/lib/find-scss-includes.js +8 -8
- package/lib/page/stateful-page.js +2 -15
- package/package.json +2 -2
- package/src/add-jdd-component.ts +1 -1
- package/src/build.ts +31 -27
- package/src/cli.ts +2 -2
- package/src/{find-scss-includes.ts → find-css-includes.ts} +10 -10
- package/src/forms/{forms.scss → forms.css} +6 -6
- package/src/page/stateful-page.ts +3 -22
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function generate_css_includes(): Promise<void>;
|
package/lib/add-jdd-component.js
CHANGED
|
@@ -22,7 +22,7 @@ async function addJDDComponent() {
|
|
|
22
22
|
}
|
|
23
23
|
await fs_1.promises.mkdir((0, path_1.resolve)(file_path, "../"), { recursive: true });
|
|
24
24
|
await fs_1.promises.writeFile(file_path, (0, jdd_component_1.jddComponentTemplate)(component_name));
|
|
25
|
-
const css_file_path = target_locreq.resolve(`src/back/jdd-components/${(0, js_convert_case_1.toKebabCase)(component_name)}/${(0, js_convert_case_1.toKebabCase)(component_name)}.
|
|
25
|
+
const css_file_path = target_locreq.resolve(`src/back/jdd-components/${(0, js_convert_case_1.toKebabCase)(component_name)}/${(0, js_convert_case_1.toKebabCase)(component_name)}.css`);
|
|
26
26
|
await fs_1.promises.writeFile(css_file_path, `.${(0, js_convert_case_1.toKebabCase)(component_name)} {
|
|
27
27
|
}`);
|
|
28
28
|
// eslint-disable-next-line no-console
|
package/lib/build.js
CHANGED
|
@@ -30,10 +30,9 @@ exports.buildProject = void 0;
|
|
|
30
30
|
const esbuild_1 = require("esbuild");
|
|
31
31
|
const fs_1 = require("fs");
|
|
32
32
|
const path_1 = require("path");
|
|
33
|
-
const esbuild_sass_plugin_1 = require("esbuild-sass-plugin");
|
|
34
33
|
const chokidar = __importStar(require("chokidar"));
|
|
35
34
|
const tiny_glob_1 = __importDefault(require("tiny-glob"));
|
|
36
|
-
const
|
|
35
|
+
const find_css_includes_1 = require("./find-css-includes");
|
|
37
36
|
const sleep_1 = require("./utils/sleep");
|
|
38
37
|
const generate_collections_1 = require("./generate-collections");
|
|
39
38
|
const generate_routes_1 = require("./generate-routes");
|
|
@@ -110,37 +109,46 @@ async function build_ts() {
|
|
|
110
109
|
}
|
|
111
110
|
}
|
|
112
111
|
async function complex_build(watch) {
|
|
113
|
-
|
|
112
|
+
const loader = Object.fromEntries(["png", "svg", "jpg", "gif", "jpeg", "otf", "ttf"].map((ext) => ["." + ext, "file"]));
|
|
113
|
+
let css_build = await (0, esbuild_1.context)({
|
|
114
|
+
entryPoints: ["./src/main.css"],
|
|
115
|
+
sourcemap: true,
|
|
116
|
+
bundle: true,
|
|
117
|
+
outdir: "./public/dist",
|
|
118
|
+
logLevel: "info",
|
|
119
|
+
// plugins: [sassPlugin()],
|
|
120
|
+
loader,
|
|
121
|
+
});
|
|
114
122
|
let ongoing_ts = false;
|
|
115
|
-
let
|
|
123
|
+
let ongoing_css = false;
|
|
116
124
|
if (watch) {
|
|
117
125
|
const watcher = chokidar.watch("src", { ignoreInitial: true });
|
|
118
126
|
watcher.on("all", async (_, path) => {
|
|
119
|
-
if (!
|
|
127
|
+
if (!css_build)
|
|
120
128
|
return;
|
|
121
129
|
if (path.includes(".#"))
|
|
122
130
|
return;
|
|
123
|
-
if (path.endsWith(".
|
|
124
|
-
if (
|
|
131
|
+
if (path.endsWith(".css") && !path.endsWith("/includes.css")) {
|
|
132
|
+
if (ongoing_css) {
|
|
125
133
|
return;
|
|
126
134
|
}
|
|
127
|
-
|
|
128
|
-
// refresh the list of all
|
|
129
|
-
await (0,
|
|
135
|
+
ongoing_css = true;
|
|
136
|
+
// refresh the list of all css files in includes.css
|
|
137
|
+
await (0, find_css_includes_1.generate_css_includes)();
|
|
130
138
|
try {
|
|
131
|
-
await
|
|
132
|
-
console.log(`Built main.
|
|
139
|
+
await css_build?.rebuild?.();
|
|
140
|
+
console.log(`Built main.css [on ${path}]`);
|
|
133
141
|
}
|
|
134
142
|
catch (e) {
|
|
135
143
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
136
144
|
console.error(e.message);
|
|
137
145
|
await (0, sleep_1.sleep)(200);
|
|
138
|
-
|
|
146
|
+
css_build
|
|
139
147
|
?.rebuild?.()
|
|
140
148
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
141
149
|
.catch((e) => console.error(e?.message));
|
|
142
150
|
}
|
|
143
|
-
|
|
151
|
+
ongoing_css = false;
|
|
144
152
|
}
|
|
145
153
|
if ((path.endsWith(".ts") || path.endsWith(".tsx")) &&
|
|
146
154
|
!path.endsWith("src/back/collections/collections.ts") &&
|
|
@@ -156,17 +164,9 @@ async function complex_build(watch) {
|
|
|
156
164
|
}
|
|
157
165
|
});
|
|
158
166
|
}
|
|
159
|
-
await (0,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
sourcemap: true,
|
|
163
|
-
outfile: "./public/dist/style.css",
|
|
164
|
-
logLevel: "info",
|
|
165
|
-
incremental: watch,
|
|
166
|
-
plugins: [(0, esbuild_sass_plugin_1.sassPlugin)()],
|
|
167
|
-
});
|
|
168
|
-
await build_ts();
|
|
169
|
-
watch && scss_build?.rebuild?.();
|
|
167
|
+
await (0, find_css_includes_1.generate_css_includes)();
|
|
168
|
+
await Promise.all([css_build.rebuild(), build_ts()]);
|
|
169
|
+
watch && css_build?.rebuild?.();
|
|
170
170
|
}
|
|
171
171
|
async function buildProject({ watch, }) {
|
|
172
172
|
try {
|
|
@@ -176,7 +176,6 @@ async function buildProject({ watch, }) {
|
|
|
176
176
|
outfile: "./public/dist/bundle.js",
|
|
177
177
|
logLevel: "info",
|
|
178
178
|
bundle: true,
|
|
179
|
-
watch,
|
|
180
179
|
});
|
|
181
180
|
await complex_build(watch);
|
|
182
181
|
}
|
package/lib/cli.js
CHANGED
|
@@ -5,7 +5,7 @@ const add_collection_1 = require("./add-collection");
|
|
|
5
5
|
const add_jdd_component_1 = require("./add-jdd-component");
|
|
6
6
|
const add_route_1 = require("./add-route");
|
|
7
7
|
const build_1 = require("./build");
|
|
8
|
-
const
|
|
8
|
+
const find_css_includes_1 = require("./find-css-includes");
|
|
9
9
|
const generate_collections_1 = require("./generate-collections");
|
|
10
10
|
const generate_components_1 = require("./generate-components");
|
|
11
11
|
const generate_routes_1 = require("./generate-routes");
|
|
@@ -16,7 +16,7 @@ const actions = {
|
|
|
16
16
|
"generate-collections": generate_collections_1.generateCollections,
|
|
17
17
|
"generate-components": generate_components_1.generateComponents,
|
|
18
18
|
"generate-routes": generate_routes_1.generateRoutes,
|
|
19
|
-
"generate-
|
|
19
|
+
"generate-css-includes": find_css_includes_1.generate_css_includes,
|
|
20
20
|
build: build_1.buildProject,
|
|
21
21
|
default: async function () {
|
|
22
22
|
console.log("Usage: `sealscript <action>`");
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.generate_css_includes = void 0;
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
const locreq_1 = __importDefault(require("locreq"));
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const walk_1 = require("./utils/walk");
|
|
11
|
+
const target_locreq = (0, locreq_1.default)(process.cwd());
|
|
12
|
+
async function generate_css_includes() {
|
|
13
|
+
const files = await Promise.all((await (0, walk_1.walkDir)(target_locreq.resolve("src/")))
|
|
14
|
+
.filter((f) => f.endsWith(".css") &&
|
|
15
|
+
!f.endsWith("/main.css") &&
|
|
16
|
+
!f.endsWith("\\main.css") &&
|
|
17
|
+
!f.endsWith("/includes.css") &&
|
|
18
|
+
!f.endsWith("\\includes.css") &&
|
|
19
|
+
!f.includes(".#"))
|
|
20
|
+
.map((fullpath) => (0, path_1.relative)(target_locreq.resolve("src/"), fullpath)));
|
|
21
|
+
await fs_1.promises.writeFile(target_locreq.resolve("src/includes.css"), `/* DO NOT EDIT! This file is generated automaticaly with npx sealgen generate-css-includes */
|
|
22
|
+
|
|
23
|
+
@import "../node_modules/@sealcode/sealgen/src/forms/forms.css";
|
|
24
|
+
${files.map((path) => `@import "${path.replaceAll("\\", "/")}";`).join("\n")}
|
|
25
|
+
`);
|
|
26
|
+
// eslint-disable-next-line no-console
|
|
27
|
+
console.log("Successfuly generated new src/includes.css file");
|
|
28
|
+
}
|
|
29
|
+
exports.generate_css_includes = generate_css_includes;
|
|
30
|
+
//# sourceMappingURL=find-css-includes.js.map
|
|
@@ -11,20 +11,20 @@ const walk_1 = require("./utils/walk");
|
|
|
11
11
|
const target_locreq = (0, locreq_1.default)(process.cwd());
|
|
12
12
|
async function generateScssIncludes() {
|
|
13
13
|
const files = await Promise.all((await (0, walk_1.walkDir)(target_locreq.resolve("src/")))
|
|
14
|
-
.filter((f) => f.endsWith(".
|
|
15
|
-
!f.endsWith("/main.
|
|
16
|
-
!f.endsWith("\\main.
|
|
17
|
-
!f.endsWith("/includes.
|
|
18
|
-
!f.endsWith("\\includes.
|
|
14
|
+
.filter((f) => f.endsWith(".css") &&
|
|
15
|
+
!f.endsWith("/main.css") &&
|
|
16
|
+
!f.endsWith("\\main.css") &&
|
|
17
|
+
!f.endsWith("/includes.css") &&
|
|
18
|
+
!f.endsWith("\\includes.css") &&
|
|
19
19
|
!f.includes(".#"))
|
|
20
20
|
.map((fullpath) => (0, path_1.relative)(target_locreq.resolve("src/"), fullpath)));
|
|
21
|
-
await fs_1.promises.writeFile(target_locreq.resolve("src/includes.
|
|
21
|
+
await fs_1.promises.writeFile(target_locreq.resolve("src/includes.css"), `/* DO NOT EDIT! This file is generated automaticaly with npx sealgen generate-scss-includes */
|
|
22
22
|
|
|
23
|
-
@import "../node_modules/@sealcode/sealgen/src/forms/forms.
|
|
23
|
+
@import "../node_modules/@sealcode/sealgen/src/forms/forms.css";
|
|
24
24
|
${files.map((path) => `@import "${path.replaceAll("\\", "/")}";`).join("\n")}
|
|
25
25
|
`);
|
|
26
26
|
// eslint-disable-next-line no-console
|
|
27
|
-
console.log("Successfuly generated new src/includes.
|
|
27
|
+
console.log("Successfuly generated new src/includes.css file");
|
|
28
28
|
}
|
|
29
29
|
exports.generateScssIncludes = generateScssIncludes;
|
|
30
30
|
//# sourceMappingURL=find-scss-includes.js.map
|
|
@@ -62,22 +62,9 @@ class StatefulPage extends mountable_1.Mountable {
|
|
|
62
62
|
// the "$" key is parsed as dot notation and overrides the state
|
|
63
63
|
const original_state = JSON.parse((0, base64_1.from_base64)(ctx.$body.state));
|
|
64
64
|
const modified_state = (0, deepmerge_1.default)(original_state, ctx.$body.$ || {}, {
|
|
65
|
-
arrayMerge: (
|
|
65
|
+
arrayMerge: (_target, source, _options) => {
|
|
66
66
|
// https://github.com/TehShrike/deepmerge#user-content-arraymerge-example-combine-arrays
|
|
67
|
-
|
|
68
|
-
source.forEach((item, index) => {
|
|
69
|
-
if (typeof destination[index] === "undefined") {
|
|
70
|
-
destination[index] =
|
|
71
|
-
options.cloneUnlessOtherwiseSpecified(item, options);
|
|
72
|
-
}
|
|
73
|
-
else if (options.isMergeableObject(item)) {
|
|
74
|
-
destination[index] = (0, deepmerge_1.default)(target[index], item, options);
|
|
75
|
-
}
|
|
76
|
-
else if (target.indexOf(item) === -1) {
|
|
77
|
-
destination.push(item);
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
return destination;
|
|
67
|
+
return source;
|
|
81
68
|
},
|
|
82
69
|
});
|
|
83
70
|
if (ctx.$body.action && ctx.$body.args) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sealcode/sealgen",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.6",
|
|
4
4
|
"description": "Module to automate adding routes and collections to a sealious application",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@koa/router": "^12.0.1",
|
|
50
50
|
"@sealcode/ts-predicates": "^0.4.3",
|
|
51
51
|
"deepmerge": "^4.3.1",
|
|
52
|
-
"esbuild": "^0.
|
|
52
|
+
"esbuild": "^0.20.0",
|
|
53
53
|
"esbuild-sass-plugin": "^2.3.1",
|
|
54
54
|
"js-convert-case": "^4.2.0",
|
|
55
55
|
"koa": "^2.13.0",
|
package/src/add-jdd-component.ts
CHANGED
|
@@ -29,7 +29,7 @@ export async function addJDDComponent(): Promise<void> {
|
|
|
29
29
|
const css_file_path = target_locreq.resolve(
|
|
30
30
|
`src/back/jdd-components/${toKebabCase(component_name)}/${toKebabCase(
|
|
31
31
|
component_name
|
|
32
|
-
)}.
|
|
32
|
+
)}.css`
|
|
33
33
|
);
|
|
34
34
|
await fs.writeFile(
|
|
35
35
|
css_file_path,
|
package/src/build.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { build, BuildResult } from "esbuild";
|
|
1
|
+
import { build, BuildContext, BuildResult, context } from "esbuild";
|
|
2
2
|
import { promises as fs } from "fs";
|
|
3
3
|
import { extname } from "path";
|
|
4
|
-
import { sassPlugin } from "esbuild-sass-plugin";
|
|
5
4
|
import * as chokidar from "chokidar";
|
|
6
5
|
import { default as glob } from "tiny-glob";
|
|
7
|
-
import {
|
|
6
|
+
import { generate_css_includes } from "./find-css-includes";
|
|
8
7
|
import { sleep } from "./utils/sleep";
|
|
9
8
|
import { generateCollections } from "./generate-collections";
|
|
10
9
|
import { generateRoutes } from "./generate-routes";
|
|
@@ -120,34 +119,47 @@ async function build_ts() {
|
|
|
120
119
|
}
|
|
121
120
|
|
|
122
121
|
async function complex_build(watch: boolean): Promise<void> {
|
|
123
|
-
|
|
122
|
+
const loader = Object.fromEntries(
|
|
123
|
+
(<const>["png", "svg", "jpg", "gif", "jpeg", "otf", "ttf"]).map(
|
|
124
|
+
(ext) => <const>["." + ext, "file"]
|
|
125
|
+
)
|
|
126
|
+
);
|
|
127
|
+
let css_build: BuildContext = await context({
|
|
128
|
+
entryPoints: ["./src/main.css"],
|
|
129
|
+
sourcemap: true,
|
|
130
|
+
bundle: true,
|
|
131
|
+
outdir: "./public/dist",
|
|
132
|
+
logLevel: "info",
|
|
133
|
+
// plugins: [sassPlugin()],
|
|
134
|
+
loader,
|
|
135
|
+
});
|
|
124
136
|
let ongoing_ts = false;
|
|
125
|
-
let
|
|
137
|
+
let ongoing_css = false;
|
|
126
138
|
if (watch) {
|
|
127
139
|
const watcher = chokidar.watch("src", { ignoreInitial: true });
|
|
128
140
|
watcher.on("all", async (_, path) => {
|
|
129
|
-
if (!
|
|
141
|
+
if (!css_build) return;
|
|
130
142
|
if (path.includes(".#")) return;
|
|
131
|
-
if (path.endsWith(".
|
|
132
|
-
if (
|
|
143
|
+
if (path.endsWith(".css") && !path.endsWith("/includes.css")) {
|
|
144
|
+
if (ongoing_css) {
|
|
133
145
|
return;
|
|
134
146
|
}
|
|
135
|
-
|
|
136
|
-
// refresh the list of all
|
|
137
|
-
await
|
|
147
|
+
ongoing_css = true;
|
|
148
|
+
// refresh the list of all css files in includes.css
|
|
149
|
+
await generate_css_includes();
|
|
138
150
|
try {
|
|
139
|
-
await
|
|
140
|
-
console.log(`Built main.
|
|
151
|
+
await css_build?.rebuild?.();
|
|
152
|
+
console.log(`Built main.css [on ${path}]`);
|
|
141
153
|
} catch (e) {
|
|
142
154
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
143
155
|
console.error(e.message);
|
|
144
156
|
await sleep(200);
|
|
145
|
-
|
|
157
|
+
css_build
|
|
146
158
|
?.rebuild?.()
|
|
147
159
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
148
160
|
.catch((e) => console.error(e?.message));
|
|
149
161
|
}
|
|
150
|
-
|
|
162
|
+
ongoing_css = false;
|
|
151
163
|
}
|
|
152
164
|
if (
|
|
153
165
|
(path.endsWith(".ts") || path.endsWith(".tsx")) &&
|
|
@@ -165,17 +177,10 @@ async function complex_build(watch: boolean): Promise<void> {
|
|
|
165
177
|
}
|
|
166
178
|
});
|
|
167
179
|
}
|
|
168
|
-
await
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
outfile: "./public/dist/style.css",
|
|
173
|
-
logLevel: "info",
|
|
174
|
-
incremental: watch,
|
|
175
|
-
plugins: [sassPlugin()],
|
|
176
|
-
});
|
|
177
|
-
await build_ts();
|
|
178
|
-
watch && scss_build?.rebuild?.();
|
|
180
|
+
await generate_css_includes();
|
|
181
|
+
|
|
182
|
+
await Promise.all([css_build.rebuild(), build_ts()]);
|
|
183
|
+
watch && css_build?.rebuild?.();
|
|
179
184
|
}
|
|
180
185
|
|
|
181
186
|
export async function buildProject({
|
|
@@ -190,7 +195,6 @@ export async function buildProject({
|
|
|
190
195
|
outfile: "./public/dist/bundle.js",
|
|
191
196
|
logLevel: "info",
|
|
192
197
|
bundle: true,
|
|
193
|
-
watch,
|
|
194
198
|
});
|
|
195
199
|
await complex_build(watch);
|
|
196
200
|
} catch (e) {
|
package/src/cli.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { addCollection } from "./add-collection";
|
|
|
3
3
|
import { addJDDComponent } from "./add-jdd-component";
|
|
4
4
|
import { addRoute } from "./add-route";
|
|
5
5
|
import { buildProject } from "./build";
|
|
6
|
-
import {
|
|
6
|
+
import { generate_css_includes } from "./find-css-includes";
|
|
7
7
|
import { generateCollections } from "./generate-collections";
|
|
8
8
|
import { generateComponents } from "./generate-components";
|
|
9
9
|
import { generateRoutes } from "./generate-routes";
|
|
@@ -18,7 +18,7 @@ const actions: Record<
|
|
|
18
18
|
"generate-collections": generateCollections,
|
|
19
19
|
"generate-components": generateComponents,
|
|
20
20
|
"generate-routes": generateRoutes,
|
|
21
|
-
"generate-
|
|
21
|
+
"generate-css-includes": generate_css_includes,
|
|
22
22
|
build: buildProject,
|
|
23
23
|
default: async function () {
|
|
24
24
|
console.log("Usage: `sealscript <action>`");
|
|
@@ -5,16 +5,16 @@ import { walkDir } from "./utils/walk";
|
|
|
5
5
|
|
|
6
6
|
const target_locreq = _locreq(process.cwd());
|
|
7
7
|
|
|
8
|
-
export async function
|
|
8
|
+
export async function generate_css_includes(): Promise<void> {
|
|
9
9
|
const files = await Promise.all(
|
|
10
10
|
(await walkDir(target_locreq.resolve("src/")))
|
|
11
11
|
.filter(
|
|
12
12
|
(f) =>
|
|
13
|
-
f.endsWith(".
|
|
14
|
-
!f.endsWith("/main.
|
|
15
|
-
!f.endsWith("\\main.
|
|
16
|
-
!f.endsWith("/includes.
|
|
17
|
-
!f.endsWith("\\includes.
|
|
13
|
+
f.endsWith(".css") &&
|
|
14
|
+
!f.endsWith("/main.css") &&
|
|
15
|
+
!f.endsWith("\\main.css") &&
|
|
16
|
+
!f.endsWith("/includes.css") &&
|
|
17
|
+
!f.endsWith("\\includes.css") &&
|
|
18
18
|
!f.includes(".#")
|
|
19
19
|
)
|
|
20
20
|
.map((fullpath) =>
|
|
@@ -23,13 +23,13 @@ export async function generateScssIncludes(): Promise<void> {
|
|
|
23
23
|
);
|
|
24
24
|
|
|
25
25
|
await fs.writeFile(
|
|
26
|
-
target_locreq.resolve("src/includes.
|
|
27
|
-
|
|
26
|
+
target_locreq.resolve("src/includes.css"),
|
|
27
|
+
`/* DO NOT EDIT! This file is generated automaticaly with npx sealgen generate-css-includes */
|
|
28
28
|
|
|
29
|
-
@import "../node_modules/@sealcode/sealgen/src/forms/forms.
|
|
29
|
+
@import "../node_modules/@sealcode/sealgen/src/forms/forms.css";
|
|
30
30
|
${files.map((path) => `@import "${path.replaceAll("\\", "/")}";`).join("\n")}
|
|
31
31
|
`
|
|
32
32
|
);
|
|
33
33
|
// eslint-disable-next-line no-console
|
|
34
|
-
console.log("Successfuly generated new src/includes.
|
|
34
|
+
console.log("Successfuly generated new src/includes.css file");
|
|
35
35
|
}
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
border: 1px solid var(--color);
|
|
4
4
|
border-radius: 5px;
|
|
5
5
|
padding: 10px;
|
|
6
|
+
}
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
.form-message--error {
|
|
9
|
+
--color: #ff4136;
|
|
10
|
+
}
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
12
|
+
.form-message--success {
|
|
13
|
+
--color: #2ecc40;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.form__error {
|
|
@@ -128,31 +128,12 @@ export abstract class StatefulPage<
|
|
|
128
128
|
|
|
129
129
|
const modified_state = deepmerge(original_state, ctx.$body.$ || {}, {
|
|
130
130
|
arrayMerge: (
|
|
131
|
-
|
|
131
|
+
_target: any[],
|
|
132
132
|
source: any[],
|
|
133
|
-
|
|
133
|
+
_options: ArrayMergeOptions
|
|
134
134
|
) => {
|
|
135
135
|
// https://github.com/TehShrike/deepmerge#user-content-arraymerge-example-combine-arrays
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
source.forEach((item, index) => {
|
|
139
|
-
if (typeof destination[index] === "undefined") {
|
|
140
|
-
destination[index] =
|
|
141
|
-
options.cloneUnlessOtherwiseSpecified(
|
|
142
|
-
item,
|
|
143
|
-
options
|
|
144
|
-
);
|
|
145
|
-
} else if (options.isMergeableObject(item)) {
|
|
146
|
-
destination[index] = deepmerge(
|
|
147
|
-
target[index],
|
|
148
|
-
item,
|
|
149
|
-
options
|
|
150
|
-
);
|
|
151
|
-
} else if (target.indexOf(item) === -1) {
|
|
152
|
-
destination.push(item);
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
return destination;
|
|
136
|
+
return source;
|
|
156
137
|
},
|
|
157
138
|
}) as State;
|
|
158
139
|
|