create-forgeon 0.3.12 → 0.3.14
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/package.json +1 -1
- package/src/modules/dependencies.test.mjs +1 -1
- package/src/modules/executor.mjs +1 -1
- package/src/modules/executor.test.mjs +1 -1
- package/src/modules/queue.mjs +1 -1
- package/src/modules/registry.mjs +1 -1
- package/src/modules/scheduler.mjs +1 -1
- package/src/run-add-module.mjs +4 -3
- package/src/utils/fs.mjs +31 -26
- package/templates/module-fragments/scheduler/20_scope.md +1 -1
- package/templates/module-presets/scheduler/packages/scheduler/package.json +1 -1
- package/templates/module-presets/scheduler/packages/scheduler/src/forgeon-scheduler.module.ts +1 -1
- package/templates/module-presets/scheduler/packages/scheduler/src/index.ts +1 -1
- package/templates/module-presets/scheduler/packages/scheduler/src/scheduler-config.loader.ts +1 -1
- package/templates/module-presets/scheduler/packages/scheduler/src/scheduler-config.module.ts +1 -1
- package/templates/module-presets/scheduler/packages/scheduler/src/scheduler-config.service.ts +1 -1
- package/templates/module-presets/scheduler/packages/scheduler/src/scheduler-env.schema.ts +1 -1
- package/templates/module-presets/scheduler/packages/scheduler/src/scheduler.service.ts +1 -1
package/package.json
CHANGED
package/src/modules/executor.mjs
CHANGED
package/src/modules/queue.mjs
CHANGED
package/src/modules/registry.mjs
CHANGED
package/src/run-add-module.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
printOptionalIntegrationsWarning,
|
|
17
17
|
runIntegrationFlow,
|
|
18
18
|
} from './integrations/flow.mjs';
|
|
19
|
-
import { writeJson } from './utils/fs.mjs';
|
|
19
|
+
import { readJson, writeJson } from './utils/fs.mjs';
|
|
20
20
|
|
|
21
21
|
function printModuleList() {
|
|
22
22
|
const modules = listModulePresets();
|
|
@@ -63,7 +63,7 @@ function collectDependencyManifestState(targetRoot) {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
const filePath = path.join(currentDir, entry.name);
|
|
66
|
-
const packageJson =
|
|
66
|
+
const packageJson = readJson(filePath);
|
|
67
67
|
const snapshot = {
|
|
68
68
|
name: packageJson.name ?? null,
|
|
69
69
|
dependencies: toSortedObject(packageJson.dependencies),
|
|
@@ -114,7 +114,7 @@ function ensureSyncTooling({ packageRoot, targetRoot }) {
|
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
const packageJson =
|
|
117
|
+
const packageJson = readJson(packagePath);
|
|
118
118
|
if (!packageJson.scripts) {
|
|
119
119
|
packageJson.scripts = {};
|
|
120
120
|
}
|
|
@@ -309,3 +309,4 @@ export async function runAddModule(argv = process.argv.slice(2)) {
|
|
|
309
309
|
console.log('Next: run pnpm install');
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
|
+
|
package/src/utils/fs.mjs
CHANGED
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
|
|
4
|
-
export function copyRecursive(source, destination) {
|
|
5
|
-
const stat = fs.statSync(source);
|
|
6
|
-
|
|
7
|
-
if (stat.isDirectory()) {
|
|
8
|
-
fs.mkdirSync(destination, { recursive: true });
|
|
9
|
-
for (const entry of fs.readdirSync(source)) {
|
|
10
|
-
copyRecursive(path.join(source, entry), path.join(destination, entry));
|
|
11
|
-
}
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
fs.copyFileSync(source, destination);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function writeJson(filePath, data) {
|
|
19
|
-
fs.writeFileSync(filePath, `${JSON.stringify(data, null, 2)}\n`, 'utf8');
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
export function copyRecursive(source, destination) {
|
|
5
|
+
const stat = fs.statSync(source);
|
|
6
|
+
|
|
7
|
+
if (stat.isDirectory()) {
|
|
8
|
+
fs.mkdirSync(destination, { recursive: true });
|
|
9
|
+
for (const entry of fs.readdirSync(source)) {
|
|
10
|
+
copyRecursive(path.join(source, entry), path.join(destination, entry));
|
|
11
|
+
}
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
fs.copyFileSync(source, destination);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function writeJson(filePath, data) {
|
|
19
|
+
fs.writeFileSync(filePath, `${JSON.stringify(data, null, 2)}\n`, 'utf8');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function readJson(filePath) {
|
|
23
|
+
const raw = fs.readFileSync(filePath, 'utf8').replace(/^\uFEFF/, '');
|
|
24
|
+
return JSON.parse(raw);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function removeIfExists(targetPath) {
|
|
28
|
+
if (fs.existsSync(targetPath)) {
|
|
29
|
+
fs.rmSync(targetPath, { recursive: true, force: true });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { Injectable, Logger, OnModuleDestroy, OnModuleInit } from '@nestjs/common';
|
|
2
2
|
import { SchedulerRegistry } from '@nestjs/schedule';
|
|
3
3
|
import { QueueService } from '@forgeon/queue';
|
|
4
4
|
import { CronJob } from 'cron';
|