Skip to content

Commit ddc33ab

Browse files
committed
updating syntax from incept framework 0.0.28
1 parent 6532e63 commit ddc33ab

File tree

7 files changed

+239
-95
lines changed

7 files changed

+239
-95
lines changed

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"packages": [
33
"packages/*"
44
],
5-
"version": "0.0.23"
5+
"version": "0.0.28"
66
}

packages/virtual_modules/package-lock.json

Lines changed: 111 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/virtual_modules/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "virtual_modules",
3-
"version": "0.0.26",
3+
"version": "0.0.28",
44
"description": "Enabling the virtual module space",
55
"author": "Chris <chris@incept.asia>",
66
"license": "MIT",
@@ -22,7 +22,7 @@
2222
"build": "tsc"
2323
},
2424
"dependencies": {
25-
"@inceptjs/framework": "^0.0.26",
25+
"@inceptjs/framework": "^0.0.28",
2626
"memfs": "^3.3.0"
2727
},
2828
"devDependencies": {

packages/virtual_modules/src/VirtualFS.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -426,12 +426,8 @@ export default class VirtualFS extends MemVolume {
426426

427427
const response = new Response();
428428
this._emitter.emitSync(file, file, response, this);
429-
430-
if (response.body && typeof response.body === 'object') {
431-
response.write(JSON.stringify(response.body, null, 4));
432-
}
433429

434-
if (typeof response.body !== 'undefined' && response.body !== null) {
430+
if (response.filled) {
435431
const dirname = path.dirname(file);
436432
if (!super.existsSync(dirname)) {
437433
this.mkdirSync(dirname, { recursive: true })

packages/virtual_modules/test/VirtualFS.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describe('Base Tests', () => {
7373
it('Should route and dynamically read from vfs using `fs` and `require`', () => {
7474
const route = `${__dirname}/assets/post/:id/info.json`
7575
this.vfs.route(route, (filename, res, vfs) => {
76-
res.body = vfs.routeParams(filename, route)
76+
res.write(vfs.routeParams(filename, route))
7777
})
7878

7979
const test = `${__dirname}/assets/post/1/info.json`
@@ -117,9 +117,9 @@ describe('Base Tests', () => {
117117
const params = vfs.routeParams(filename, '/my/routes/**')
118118
const path = params.args.join('/')
119119
if (path === 'route/1.js') {
120-
res.body = 'module.exports = require("./2")'
120+
res.write('module.exports = require("./2")')
121121
} else if (path === 'route/2.js') {
122-
res.body = 'module.exports = 1'
122+
res.write('module.exports = 1')
123123
}
124124
})
125125

0 commit comments

Comments
 (0)