@tobi2409/fullsty 0.5.2 → 0.5.4
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/README.md +13 -5
- package/package.json +1 -1
- package/scripts/extension-wrappers/@tobi2409/authentication-core-lib/authentication-core-lib-wrapper.ts +2 -0
- package/scripts/extension-wrappers/@tobi2409/authentication-core-lib/extension.json +3 -0
- package/scripts/extension-wrappers/db-connection/db-connection-wrapper.ts +2 -2
- package/scripts/shared/server-package-utils.js +18 -7
package/README.md
CHANGED
|
@@ -14,12 +14,20 @@ Minimal Fullsty starter workflow.
|
|
|
14
14
|
|
|
15
15
|
A sample application can be found at https://github.com/tobi2409/fullsty/tree/main/projects/db-test
|
|
16
16
|
|
|
17
|
+
For the `db-test` demo, add the required server wrappers in your project root before generating/running:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
fullsty-server-pkg add pg
|
|
21
|
+
fullsty-server-pkg add db-connection
|
|
22
|
+
fullsty-server-pkg add kysely
|
|
23
|
+
```
|
|
24
|
+
|
|
17
25
|
## 1) Create a project
|
|
18
26
|
|
|
19
27
|
From the repository root:
|
|
20
28
|
|
|
21
29
|
```bash
|
|
22
|
-
|
|
30
|
+
create-fullsty-project projects/demo1
|
|
23
31
|
```
|
|
24
32
|
|
|
25
33
|
This creates a new folder (for example [projects/demo1](projects/demo1)).
|
|
@@ -55,12 +63,12 @@ It also copies [project-frame/server-package.json](project-frame/server-package.
|
|
|
55
63
|
Run it from the project root, for example:
|
|
56
64
|
|
|
57
65
|
```bash
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
66
|
+
fullsty-server-pkg add pg
|
|
67
|
+
fullsty-server-pkg add kysely
|
|
68
|
+
fullsty-server-pkg remove pg
|
|
61
69
|
```
|
|
62
70
|
|
|
63
|
-
Alternatively, you can also use npx fullsty-server-pkg
|
|
71
|
+
Alternatively, you can also use `npx fullsty-server-pkg`.
|
|
64
72
|
|
|
65
73
|
What it does:
|
|
66
74
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tobi2409/fullsty",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "Fullsty is a modular fullstack framework starter built from three core parts: template-engine, layout and proc2rest. It provides a project frame for building fullstack applications with a clear separation of client and server code.",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "Tobias Hollstein",
|
|
@@ -19,8 +19,8 @@ export class DbConnection {
|
|
|
19
19
|
async getConnection(): Promise<unknown> {
|
|
20
20
|
if (this.driverName === "pg") {
|
|
21
21
|
if (!this.connectionWrapper) {
|
|
22
|
-
// @ts-ignore pg-
|
|
23
|
-
const { PgConnectionWrapper } = await import("../pg/pg-
|
|
22
|
+
// @ts-ignore pg-wrapper is supplied by the pg extension in generated projects.
|
|
23
|
+
const { PgConnectionWrapper } = await import("../pg/pg-wrapper.ts");
|
|
24
24
|
this.connectionWrapper = new PgConnectionWrapper(this.connectionData.connectionName ?? "default");
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -24,17 +24,21 @@ export function handleAdd(projectDir, scriptDir, serverDir, packageNames) {
|
|
|
24
24
|
for (const packageName of packageNames) {
|
|
25
25
|
const wrapperDir = wrapperDirFromPackage(scriptDir, packageName);
|
|
26
26
|
const targetWrapperDir = path.join(serverDir, packageName);
|
|
27
|
+
const wrapperExists = fs.existsSync(wrapperDir);
|
|
27
28
|
|
|
28
|
-
if (
|
|
29
|
+
if (!wrapperExists) {
|
|
29
30
|
json.dependencies[packageName] = "latest";
|
|
31
|
+
continue;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
|
-
if (
|
|
33
|
-
|
|
34
|
-
excludedNames: [EXTENSION_CONFIG_FILE],
|
|
35
|
-
});
|
|
36
|
-
console.log(`\n✅ Copied wrapper for ${packageName} to src/server/${packageName}`);
|
|
34
|
+
if (shouldAddToServerPackage(wrapperDir)) {
|
|
35
|
+
json.dependencies[packageName] = "latest";
|
|
37
36
|
}
|
|
37
|
+
|
|
38
|
+
copyDirectory(wrapperDir, targetWrapperDir, {
|
|
39
|
+
excludedNames: [EXTENSION_CONFIG_FILE],
|
|
40
|
+
});
|
|
41
|
+
console.log(`\n✅ Copied wrapper for ${packageName} to src/server/${packageName}`);
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
writeJson(projectDir, "server-package.json", json);
|
|
@@ -54,13 +58,20 @@ export function handleRemove(projectDir, scriptDir, serverDir, packageNames) {
|
|
|
54
58
|
for (const packageName of packageNames) {
|
|
55
59
|
const wrapperDir = wrapperDirFromPackage(scriptDir, packageName);
|
|
56
60
|
const targetWrapperDir = path.join(serverDir, packageName);
|
|
61
|
+
const wrapperExists = fs.existsSync(wrapperDir);
|
|
62
|
+
|
|
63
|
+
if (!wrapperExists) {
|
|
64
|
+
delete json.dependencies[packageName];
|
|
65
|
+
delete json.devDependencies[packageName];
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
57
68
|
|
|
58
69
|
if (shouldAddToServerPackage(wrapperDir)) {
|
|
59
70
|
delete json.dependencies[packageName];
|
|
60
71
|
delete json.devDependencies[packageName];
|
|
61
72
|
}
|
|
62
73
|
|
|
63
|
-
if (fs.existsSync(
|
|
74
|
+
if (fs.existsSync(targetWrapperDir)) {
|
|
64
75
|
fs.rmSync(targetWrapperDir, { recursive: true, force: true });
|
|
65
76
|
|
|
66
77
|
console.log(
|