@factor/app-extend
Advanced tools
Comparing version 0.3.7 to 0.4.0
49
index.js
@@ -11,14 +11,17 @@ export default Factor => { | ||
Factor.config.silent = false | ||
this.addCoreExtension("tools", require("@factor/tools").default) | ||
this.addCoreExtension("log", require("@factor/core-log/app").default) | ||
this.addCoreExtension("filters", require("@factor/filters").default) | ||
this.addCoreExtension("config", require("@factor/app-config").default) | ||
this.addCoreExtension("stack", require("@factor/core-stack").default) | ||
this.injectPlugins() | ||
this._install("tools", require("@factor/tools").default) | ||
this._install("log", require("@factor/core-log").default) | ||
this._install("filters", require("@factor/filters").default) | ||
this._install("config", require("@factor/app-config").default) | ||
this._install("stack", require("@factor/core-stack").default) | ||
this.loadPlugins() | ||
this.initializeApp() | ||
} | ||
addCoreExtension(id, extension) { | ||
_install(id, plugin) { | ||
Factor.use({ | ||
install(Factor) { | ||
Factor[`$${id}`] = Factor.prototype[`$${id}`] = extension(Factor) | ||
Factor[`$${id}`] = Factor.prototype[`$${id}`] = plugin(Factor) | ||
} | ||
@@ -28,4 +31,4 @@ }) | ||
injectPlugins() { | ||
const plugins = require("@generated/loader-app") | ||
loadPlugins() { | ||
const plugins = require("~/.factor/loader-app") | ||
for (var _p in plugins) { | ||
@@ -36,9 +39,3 @@ if (plugins[_p]) { | ||
if (typeof plugin == "function") { | ||
Factor.use({ | ||
install(Factor) { | ||
const h = `$${_p}` | ||
Factor[h] = Factor.prototype[h] = plugin(Factor) | ||
} | ||
}) | ||
this._install(_p, plugin) | ||
} | ||
@@ -49,6 +46,4 @@ } | ||
// After plugins added | ||
initializeApp() { | ||
Factor.$filters.run("initialize-app") | ||
Factor.$filters.run("after-initialize-app") | ||
const comps = Factor.$filters.apply("components", {}) | ||
@@ -70,18 +65,6 @@ for (var _ in comps) { | ||
} | ||
} | ||
mixinApp() { | ||
if (!Factor.$mixinsApplied) { | ||
const mixins = Factor.$filters.apply("mixins", {}) | ||
Object.keys(mixins).forEach(key => { | ||
if (typeof mixins[key] == "function") { | ||
mixins[key]() | ||
} | ||
}) | ||
Factor.$mixinsApplied = true | ||
} | ||
Factor.$filters.run("initialize-app") | ||
} | ||
})() | ||
} |
{ | ||
"name": "@factor/app-extend", | ||
"version": "0.3.7", | ||
"version": "0.4.0", | ||
"license": "GPL-2.0", | ||
@@ -9,6 +9,6 @@ "publishConfig": { | ||
"dependencies": { | ||
"@factor/app-config": "^0.3.7", | ||
"@factor/filters": "^0.3.7" | ||
"@factor/app-config": "^0.4.0", | ||
"@factor/filters": "^0.4.0" | ||
}, | ||
"gitHead": "174edc7cb60508cd2d707d18e411cb0a4c13b3cd" | ||
"gitHead": "763b7b89b0d6a1b0bb32ebd794c7fe76056f5123" | ||
} |
Sorry, the diff of this file is not supported yet
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
20567
55
+ Added@factor/app-config@0.4.0(transitive)
+ Added@factor/filters@0.4.0(transitive)
+ Addedcaller@1.1.0(transitive)
- Removed@factor/app-config@0.3.7(transitive)
- Removed@factor/filters@0.3.7(transitive)
Updated@factor/app-config@^0.4.0
Updated@factor/filters@^0.4.0