vap-builder
Advanced tools
Comparing version 0.0.6 to 0.0.7
{ | ||
"name": "vap-builder", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Fast VAP framework buider", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,2 +6,4 @@ import { Config, Page } from '../define'; | ||
constructor(config: Config); | ||
getPath(data: any): string; | ||
writeContext(path: any, context: any): void; | ||
writeAdmin(data: Page): void; | ||
@@ -8,0 +10,0 @@ writeDisplay(data: Page): void; |
@@ -31,26 +31,32 @@ "use strict"; | ||
} | ||
default_1.prototype.writeAdmin = function (data) { | ||
default_1.prototype.getPath = function (data) { | ||
var writePath = this.outputDir + data.path + '/index.html'; | ||
console.log("\u5F00\u59CB\u5199\u5165 " + writePath); | ||
return writePath; | ||
}; | ||
default_1.prototype.writeContext = function (path, context) { | ||
fsPath.writeFile(path, context, function (err) { | ||
if (err) { | ||
console.error(err); | ||
throw new Error("\u5199\u5165 " + path + " \u5931\u8D25"); | ||
} | ||
}); | ||
}; | ||
default_1.prototype.writeAdmin = function (data) { | ||
var writePath = this.getPath(data); | ||
var str = ejs.render(Templete_1.ADMIN, data); | ||
fsPath.writeFile(writePath, str); | ||
// fs.writeFileSync(writePath, str); | ||
this.writeContext(writePath, str); | ||
}; | ||
default_1.prototype.writeDisplay = function (data) { | ||
var writePath = this.outputDir + data.path + '/index.html'; | ||
console.log("\u5F00\u59CB\u5199\u5165 " + writePath); | ||
var writePath = this.getPath(data); | ||
var str = ejs.render(Templete_1.DISPLAY, data); | ||
fsPath.writeFile(writePath, str); | ||
// fs.writeFileSync(writePath, str); | ||
this.writeContext(writePath, str); | ||
}; | ||
default_1.prototype.writeScreen = function (data) { | ||
var writePath = this.outputDir + data.path + '/index.html'; | ||
console.log("\u5F00\u59CB\u5199\u5165 " + writePath); | ||
var writePath = this.getPath(data); | ||
var str = ejs.render(Templete_1.SCREEN, data); | ||
fsPath.writeFile(writePath, str); | ||
// fs.writeFileSync(writePath, str); | ||
this.writeContext(writePath, str); | ||
}; | ||
default_1.prototype.writePortal = function (data) { | ||
var writePath = this.outputDir + data.path + '/index.html'; | ||
console.log("\u5F00\u59CB\u5199\u5165 " + writePath); | ||
var writePath = this.getPath(data); | ||
// @ts-ignore | ||
@@ -60,8 +66,7 @@ var tempPath = this.templateDir + '/' + data.page + '.ejs'; | ||
var str = ejs.render(template, data); | ||
fsPath.writeFile(writePath, str); | ||
this.writeContext(writePath, str); | ||
// fs.writeFileSync(writePath, str); | ||
}; | ||
default_1.prototype.writeLogin = function (data) { | ||
var writePath = this.outputDir + data.path + '/index.html'; | ||
console.log("\u5F00\u59CB\u5199\u5165 " + writePath); | ||
var writePath = this.getPath(data); | ||
// @ts-ignore | ||
@@ -76,4 +81,3 @@ var tempPath = this.templateDir + '/' + data.page + '.ejs'; | ||
var e_1, _a; | ||
var writePath = this.outputDir + data.path + '/index.html'; | ||
console.log("\u5F00\u59CB\u5199\u5165 " + writePath); | ||
var writePath = this.getPath(data); | ||
var readPath = ''; | ||
@@ -103,3 +107,3 @@ try { | ||
var str = ejs.render(template, data); | ||
fsPath.writeFile(writePath, str); | ||
this.writeContext(writePath, str); | ||
}; | ||
@@ -106,0 +110,0 @@ default_1.prototype.write = function (data) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
594
26642