alloy-compiler
Advanced tools
Comparing version 0.1.4 to 0.2.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [0.2.0](https://github.com/appcelerator/alloy-devkit/compare/v0.1.4...v0.2.0) (2020-03-03) | ||
### Features | ||
* pass file content in options ([a1ba8a0](https://github.com/appcelerator/alloy-devkit/commit/a1ba8a09aa46d404de7794b44aee9d2d1165e03d)) | ||
## [0.1.4](https://github.com/appcelerator/alloy-devkit/compare/v0.1.3...v0.1.4) (2020-02-27) | ||
@@ -8,0 +19,0 @@ |
@@ -31,8 +31,15 @@ const { constants: CONST, logger } = require('alloy-utils'); | ||
let hasView = true; | ||
let viewContent = ''; | ||
try { | ||
viewContent = this.fs.readFileSync(files.VIEW, 'utf-8'); | ||
} catch (e) { | ||
hasView = false; | ||
let hasView = false; | ||
let viewContent = options.viewContent; | ||
if (!viewContent) { | ||
try { | ||
viewContent = this.fs.readFileSync(files.VIEW, 'utf-8'); | ||
hasView = true; | ||
} catch (e) { | ||
if (e.code !== 'ENOENT') { | ||
throw e; | ||
} | ||
} | ||
} else { | ||
hasView = true; | ||
} | ||
@@ -56,12 +63,14 @@ if (hasView) { | ||
// process the controller code | ||
let controllerContent; | ||
try { | ||
controllerContent = this.fs.readFileSync(files.CONTROLLER, 'utf-8'); | ||
logger.info(' controller: "' | ||
+ path.relative(path.join(meta.basePath, CONST.DIR.CONTROLLER), files.CONTROLLER) + '"'); | ||
} catch (e) { | ||
if (e.code !== 'ENOENT') { | ||
throw e; | ||
let controllerContent = options.controllerContent; | ||
if (!controllerContent) { | ||
try { | ||
controllerContent = this.fs.readFileSync(files.CONTROLLER, 'utf-8'); | ||
} catch (e) { | ||
if (e.code !== 'ENOENT') { | ||
throw e; | ||
} | ||
} | ||
} | ||
logger.info(' controller: "' | ||
+ path.relative(path.join(meta.basePath, CONST.DIR.CONTROLLER), files.CONTROLLER) + '"'); | ||
const cCode = CU.loadController(files.CONTROLLER, controllerContent); | ||
@@ -68,0 +77,0 @@ let controllerCode = ''; |
{ | ||
"name": "alloy-compiler", | ||
"version": "0.1.4", | ||
"version": "0.2.0", | ||
"description": "Compiler for Alloy components", | ||
@@ -22,3 +22,3 @@ "main": "lib/index.js", | ||
"@babel/types": "^7.8.3", | ||
"alloy-utils": "^0.1.4", | ||
"alloy-utils": "^0.2.0", | ||
"chmodr": "^1.2.0", | ||
@@ -35,3 +35,3 @@ "fs-extra": "^8.1.0", | ||
}, | ||
"gitHead": "ab6ac0759d5fdc8963f1d502482b7a295db3f5aa" | ||
"gitHead": "ef3bf708b0fe576429ed527e58320284ef360075" | ||
} |
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
919744
23760
+ Addedalloy-utils@0.2.7(transitive)
+ Addedat-least-node@1.0.0(transitive)
+ Addedfs-extra@9.1.0(transitive)
+ Addedjsonfile@6.1.0(transitive)
+ Addeduniversalify@2.0.1(transitive)
+ Addedxmldom@0.6.0(transitive)
- Removedalloy-utils@0.1.4(transitive)
Updatedalloy-utils@^0.2.0