From 793f00acc4733c69309e5cff524c410d1ac4ef97 Mon Sep 17 00:00:00 2001 From: Jack Zhuang Date: Mon, 4 Mar 2019 17:41:57 +0800 Subject: [PATCH] initial --- .gitignore | 61 ++++++++++++++++ app/index.js | 177 ++++++++++++++++++++++++++++++++++++++++++++++ app/load_to_db.js | 38 ++++++++++ index.js | 15 ++++ package-lock.json | Bin 0 -> 33453 bytes package.json | 20 ++++++ server.js | 9 +++ 7 files changed, 320 insertions(+) create mode 100644 .gitignore create mode 100644 app/index.js create mode 100644 app/load_to_db.js create mode 100644 index.js create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 server.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..ad46b30886 --- /dev/null +++ b/.gitignore @@ -0,0 +1,61 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# next.js build output +.next diff --git a/app/index.js b/app/index.js new file mode 100644 index 0000000000..3ff42010e1 --- /dev/null +++ b/app/index.js @@ -0,0 +1,177 @@ +const _ = require("underscore"); +const fs = require("fs"); +const path = require("path"); +const yaml = require('js-yaml'); +const loadToDB = require('../lib/load_to_db'); + +const appFileName = 'app.yml'; +const objectFolderName = 'objects'; +const triggerFolderName = 'triggers'; +const actionFolderName = 'actions'; +const reportFolderName = 'reports'; + +const loadJSONFile = (filePath)=>{ + return JSON.parse(fs.readFileSync(filePath, 'utf8').normalize('NFC')); +} + +const loadYmlFile = (filePath)=>{ + return yaml.safeLoad(fs.readFileSync(filePath, 'utf8')); +} + +const loadJSFile = (filePath)=>{ + return require(filePath); +} + +const loadFile = (filePath)=>{ + try { + let extname = path.extname(filePath); + if(extname.toLocaleLowerCase() == '.json') + return loadJSONFile(filePath); + else if(extname.toLocaleLowerCase() == '.yml') + return loadYmlFile(filePath); + } catch (error) { + console.error('loadFile error', filePath, error); + return {} + } +} + +const loadApp = (appFilePath)=>{ + let app = loadFile(appFilePath); + if(!_.isEmpty(app)){ + Creator.Apps[ app._id || app.name] = app; + } +} + +const loadObjectInCreator = (object)=>{ + if(!_.isEmpty(object)){ + Creator.Objects[object.name] = object; + Creator.fiberLoadObjects(object); + } +} + +const loadObject = (objectPath)=>{ + let obj =loadFile(objectPath); + loadObjectInCreator(obj) +} + +//TODO afterUndelete,beforeSubmit +const triggerMapping = { + beforeInsert: { + on: 'server', + when: 'before.insert' + }, + beforeUpdate: { + on: 'server', + when: 'before.update' + }, + beforeDelete: { + on: 'server', + when: 'before.remove' + }, + afterInsert: { + on: 'server', + when: 'after.insert' + }, + afterUpdate: { + on: 'server', + when: 'after.update' + }, + afterDelete: { + on: 'server', + when: 'after.remove' + } +} +const loadTrigger = (triggerPath)=>{ + let trigger = loadJSFile(triggerPath); + let object_name = trigger.object_name + if(!object_name){ + console.error(`load trigger error:Missing attribute 'object_name' /r ${triggerPath}`) + return + } + + let object = Creator.Objects[object_name] + if(!object){ + console.error(`load trigger error:Invalid 'object_name' /r ${triggerPath}`) + return + } + + if(!object.triggers){ + object.triggers = {} + } + + _.each(trigger, (attr, key)=>{ + let tm = triggerMapping[key] + if(!_.isEmpty(tm)){ + let tkey = `_${key}`.toLocaleUpperCase(); + object.triggers[tkey] = _.extend({}, tm, { + todo: attr + }) + } + }) + + loadObjectInCreator(object); +} + +const loadReport = (reportPath)=>{ + let report = loadFile(reportPath); + Creator.Reports[report._id] = report; + loadToDB.loadReports(report); +} + +exports.load = function(srcDirectory) { + if(fs.existsSync(srcDirectory) && fs.statSync(srcDirectory).isDirectory()){ + console.log('Loading app ... ', srcDirectory); + fs.readdir(srcDirectory, (err, appFiles)=>{ + //读取 app + const appFilePath = path.join(srcDirectory, appFileName); + if(fs.existsSync(appFilePath)){ + loadApp(appFilePath); + // fs.watchFile(appFilePath, (curr, prev) => { + // loadApp(appFilePath); + // }); + } + + //读取 object + const objectFolderPath = path.join(srcDirectory, objectFolderName); + if(fs.existsSync(objectFolderPath)){ + fs.readdir(objectFolderPath, (err, objectFiles)=>{ + _.each(objectFiles, (aof)=>{ + const objectPath = path.join(objectFolderPath, aof); + loadObject(objectPath); + // fs.watchFile(objectPath, (curr, prev) => { + // loadObject(objectPath); + // }); + }) + }) + } + + //读取 triggers + const triggerFolderPath = path.join(srcDirectory, triggerFolderName); + if (fs.existsSync(triggerFolderPath)) { + fs.readdir(triggerFolderPath, (err, triggerFiles)=>{ + _.each(triggerFiles, (tf)=>{ + const triggerPath = path.join(triggerFolderPath, tf); + loadTrigger(triggerPath); + }) + }) + } + + //读取 reports + const reportFolderPath = path.join(srcDirectory, reportFolderName); + if (fs.existsSync(reportFolderPath)) { + fs.readdir(reportFolderPath, (err, reportFiles)=>{ + _.each(reportFiles, (rf)=>{ + const reportPath = path.join(reportFolderPath, rf); + loadReport(reportPath); + }) + }) + } + + }) + + //监控apps文件夹变化 + // fs.watch(srcDirectory, (eventType, filename)=>{ + // console.warn('文件修改未生效,请重启服务', eventType, filename); + // }) + } +} \ No newline at end of file diff --git a/app/load_to_db.js b/app/load_to_db.js new file mode 100644 index 0000000000..824c4505bf --- /dev/null +++ b/app/load_to_db.js @@ -0,0 +1,38 @@ +// fix: Meteor code must always run within a Fiber. +var Fiber = require("fibers"); + +exports.loadObject = function (obj) { + var collection = Creator.getCollection('objects'); + Fiber(function () { + collection.upsert({ + name: obj.name + }, { + $set: obj + }); + }).run(); +} + +exports.loadTrigger = function (trigger) { + var collection = Creator.getCollection('objects'); + Fiber(function () { + collection.upsert({ + name: trigger.name + }, { + $set: trigger + }); + }).run(); +} + +exports.loadReports = function (report) { + var collection = Creator.getCollection('reports'); + if (!report.space) { + report.space = 'global'; + } + Fiber(function () { + collection.upsert({ + _id: report._id + }, { + $set: report + }); + }).run(); +} \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000000..a5513a94bd --- /dev/null +++ b/index.js @@ -0,0 +1,15 @@ +// const path = require("path") +// const projectDir = path.resolve(__dirname, '../../../') +// const {steedos} = require(`${projectDir}/package.json`); + +// const steedos_plugins = steedos.plugins + +// // const projectNodeModules = path.join(projectDir, 'node_modules'); + +// //先加载plugin, 再加载本地app +// _.each(steedos_plugins, (plugin)=>{ +// // require(path.join(projectNodeModules,plugin)); +// require(require.resolve(plugin)) +// }) + +exports.load = require("./app").load; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..094d0748b5ea403a8460d9fcf9f14d2cc143cb64 GIT binary patch literal 33453 zcmcJ2S+lClvf%sq6<_Sfwq1e)>Ww%ZEzUEbi2Cq#FoVhrBHnw>Z||&fLKhBe#k~)E zFBHtGoU<~sivRq_Uw{3vMN9qjAAkM%zd@*~iW3xM$5;RSZ**&~`hn@#=q~w1ei5f{ zcaFT(%$>Tp-X-zVzUoD$uLkgV=tnC4PElReR#aOy@%R4;Pyz0BC`%1h$InZVt?bmi zAKA9*!_QBTeV;%XPXL2}ah%;=RnXjwFm!|eC=`5EH-pemzHHap1YeG?7haB3$QQCE zkVm+dze4?Z8_u*tRrk#>LE{C6SRspfvb0z`l-Ss&)cXeie5+p zMA1wMD32ymf{BvX$Klo)9oKg(Gr(LWzG`2U^dq*TsChkcPrs+mOhq(>-{YIEe|>=X zqP|Kus>2g0(6uk(e)K@KKw=Q!%2(+gaNtC~tmZAz%?FX|I(~>A`N2mJ>*jiqi#_1M05-iB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j>i*CoBB5Ga7 zKmztrq}tt1S-G|xQFK^gVmoLbAVnCBhxEbj9t1%sX?&%!49l9@bB<%)Q24P(H@C$) z;ki};4rho8+-!J^l}58{R>+m9n{aH;Tl<+#Y+c0@Z+CpM;=A_WXOr$X2J{3Hkqw`+ n_L;#9XKa0QtkT|Qd6;ZhoqdB~CqS>zy&6nl|G)n6uYdf1+&K|# literal 0 HcmV?d00001 diff --git a/package.json b/package.json new file mode 100644 index 0000000000..93c8fb8d56 --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "name": "@steedos/core", + "version": "1.1.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "@steedos/meteor-bundle-runner": "^1.1.4", + "fibers": "^3.1.1", + "js-yaml": "3.12.1", + "underscore": "1.5.2" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/server.js b/server.js new file mode 100644 index 0000000000..ced51c33cf --- /dev/null +++ b/server.js @@ -0,0 +1,9 @@ +var server = require('@steedos/meteor-bundle-runner'); + +server.Fiber(function () { + server.Profile.run("Server startup", function () { + server.loadServerBundles(); + server.callStartupHooks(); + server.runMain(); + }); +}).run(); \ No newline at end of file