@cedarjs/vite 8.0.0-canary.3419 → 8.0.0-canary.3422
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/dist/jobsDevMiddleware.d.ts.map +1 -1
- package/dist/jobsDevMiddleware.js +27 -1
- package/package.json +19 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobsDevMiddleware.d.ts","sourceRoot":"","sources":["../src/jobsDevMiddleware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jobsDevMiddleware.d.ts","sourceRoot":"","sources":["../src/jobsDevMiddleware.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAA;AAsGzC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC1B;AAKD,KAAK,eAAe,GAAG,IAAI,CAAC,aAAa,EAAE,eAAe,CAAC,CAAA;AAE3D;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,eAAe,GAC1B,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAwGhC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
1
3
|
import { pathToFileURL } from "node:url";
|
|
2
4
|
import ansis from "ansis";
|
|
3
5
|
import {
|
|
6
|
+
isJobModuleFile,
|
|
4
7
|
JobNotFoundError,
|
|
5
8
|
JobsLibNotFoundError,
|
|
9
|
+
jobsFromModules,
|
|
6
10
|
setJobLoaderOverrides
|
|
7
11
|
} from "@cedarjs/jobs";
|
|
8
12
|
import { getPaths } from "@cedarjs/project-config";
|
|
@@ -40,10 +44,27 @@ async function loadJobViaVite(viteServer, { name: jobName, path: jobPath }) {
|
|
|
40
44
|
}
|
|
41
45
|
return mod[jobName];
|
|
42
46
|
}
|
|
47
|
+
async function loadAllJobsViaVite(viteServer) {
|
|
48
|
+
const jobsDir = getPaths().api.jobs;
|
|
49
|
+
if (!fs.existsSync(jobsDir)) {
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
const files = fs.readdirSync(jobsDir, { recursive: true, encoding: "utf-8" }).filter(isJobModuleFile).sort();
|
|
53
|
+
const modules = [];
|
|
54
|
+
for (const file of files) {
|
|
55
|
+
modules.push(
|
|
56
|
+
await viteServer.ssrLoadModule(
|
|
57
|
+
pathToFileURL(path.join(jobsDir, file)).href
|
|
58
|
+
)
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
return jobsFromModules(modules);
|
|
62
|
+
}
|
|
43
63
|
async function startJobsDevWorkers(viteServer) {
|
|
44
64
|
setJobLoaderOverrides({
|
|
45
65
|
loadJobsManager: () => loadJobsManagerViaVite(viteServer),
|
|
46
|
-
loadJob: (computedProperties) => loadJobViaVite(viteServer, computedProperties)
|
|
66
|
+
loadJob: (computedProperties) => loadJobViaVite(viteServer, computedProperties),
|
|
67
|
+
loadAllJobs: () => loadAllJobsViaVite(viteServer)
|
|
47
68
|
});
|
|
48
69
|
let jobsManager;
|
|
49
70
|
try {
|
|
@@ -61,6 +82,11 @@ async function startJobsDevWorkers(viteServer) {
|
|
|
61
82
|
setJobLoaderOverrides(void 0);
|
|
62
83
|
return null;
|
|
63
84
|
}
|
|
85
|
+
try {
|
|
86
|
+
await jobsManager.syncSchedules();
|
|
87
|
+
} catch (e) {
|
|
88
|
+
logger.error("[CedarJS Jobs] Could not sync the declared schedules", e);
|
|
89
|
+
}
|
|
64
90
|
logger.warn(
|
|
65
91
|
`[CedarJS Jobs] Starting ${numWorkers.length} worker(s) in-process (Unified Dev)...`
|
|
66
92
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/vite",
|
|
3
|
-
"version": "8.0.0-canary.
|
|
3
|
+
"version": "8.0.0-canary.3422",
|
|
4
4
|
"description": "Vite configuration package for CedarJS",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -54,17 +54,17 @@
|
|
|
54
54
|
"@babel/preset-typescript": "7.29.7",
|
|
55
55
|
"@babel/traverse": "7.29.10",
|
|
56
56
|
"@babel/types": "7.29.8",
|
|
57
|
-
"@cedarjs/api": "8.0.0-canary.
|
|
58
|
-
"@cedarjs/api-server": "8.0.0-canary.
|
|
59
|
-
"@cedarjs/babel-config": "8.0.0-canary.
|
|
60
|
-
"@cedarjs/context": "8.0.0-canary.
|
|
61
|
-
"@cedarjs/graphql-server": "8.0.0-canary.
|
|
62
|
-
"@cedarjs/internal": "8.0.0-canary.
|
|
63
|
-
"@cedarjs/jobs": "8.0.0-canary.
|
|
64
|
-
"@cedarjs/project-config": "8.0.0-canary.
|
|
65
|
-
"@cedarjs/server-store": "8.0.0-canary.
|
|
66
|
-
"@cedarjs/structure": "8.0.0-canary.
|
|
67
|
-
"@cedarjs/testing": "8.0.0-canary.
|
|
57
|
+
"@cedarjs/api": "8.0.0-canary.3422",
|
|
58
|
+
"@cedarjs/api-server": "8.0.0-canary.3422",
|
|
59
|
+
"@cedarjs/babel-config": "8.0.0-canary.3422",
|
|
60
|
+
"@cedarjs/context": "8.0.0-canary.3422",
|
|
61
|
+
"@cedarjs/graphql-server": "8.0.0-canary.3422",
|
|
62
|
+
"@cedarjs/internal": "8.0.0-canary.3422",
|
|
63
|
+
"@cedarjs/jobs": "8.0.0-canary.3422",
|
|
64
|
+
"@cedarjs/project-config": "8.0.0-canary.3422",
|
|
65
|
+
"@cedarjs/server-store": "8.0.0-canary.3422",
|
|
66
|
+
"@cedarjs/structure": "8.0.0-canary.3422",
|
|
67
|
+
"@cedarjs/testing": "8.0.0-canary.3422",
|
|
68
68
|
"@swc/core": "1.16.13",
|
|
69
69
|
"@universal-deploy/store": "^0.3.0",
|
|
70
70
|
"@universal-deploy/vite": "^0.2.0",
|
|
@@ -94,10 +94,10 @@
|
|
|
94
94
|
"yargs-parser": "21.1.1"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
|
-
"@cedarjs/auth": "8.0.0-canary.
|
|
98
|
-
"@cedarjs/framework-tools": "8.0.0-canary.
|
|
99
|
-
"@cedarjs/router": "8.0.0-canary.
|
|
100
|
-
"@cedarjs/web": "8.0.0-canary.
|
|
97
|
+
"@cedarjs/auth": "8.0.0-canary.3422",
|
|
98
|
+
"@cedarjs/framework-tools": "8.0.0-canary.3422",
|
|
99
|
+
"@cedarjs/router": "8.0.0-canary.3422",
|
|
100
|
+
"@cedarjs/web": "8.0.0-canary.3422",
|
|
101
101
|
"@dr.pogodin/react-helmet": "2.0.4",
|
|
102
102
|
"@hyrious/esbuild-plugin-commonjs": "0.2.6",
|
|
103
103
|
"@jridgewell/trace-mapping": "0.3.31",
|
|
@@ -119,9 +119,9 @@
|
|
|
119
119
|
"vitest": "4.1.11"
|
|
120
120
|
},
|
|
121
121
|
"peerDependencies": {
|
|
122
|
-
"@cedarjs/auth": "8.0.0-canary.
|
|
123
|
-
"@cedarjs/router": "8.0.0-canary.
|
|
124
|
-
"@cedarjs/web": "8.0.0-canary.
|
|
122
|
+
"@cedarjs/auth": "8.0.0-canary.3422",
|
|
123
|
+
"@cedarjs/router": "8.0.0-canary.3422",
|
|
124
|
+
"@cedarjs/web": "8.0.0-canary.3422",
|
|
125
125
|
"react": "19.3.0",
|
|
126
126
|
"react-dom": "19.3.0"
|
|
127
127
|
},
|