Skip to content

Commit

Permalink
filters包转成es5准备发包
Browse files Browse the repository at this point in the history
  • Loading branch information
yinlianghui committed Sep 9, 2019
1 parent 066aed0 commit 60de888
Show file tree
Hide file tree
Showing 17 changed files with 47 additions and 13 deletions.
22 changes: 22 additions & 0 deletions packages/filters/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"plugins": [
["@babel/plugin-transform-runtime",
{
"regenerator": true
}
],
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
["@babel/plugin-proposal-class-properties", {
"loose": false
}],
"@babel/plugin-proposal-json-strings"
],
"presets": [
"@babel/env"
],
"ignore": [
"./src/*.report.helper.js",
"./src/*.report.script.js"
]
}
14 changes: 13 additions & 1 deletion packages/filters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,26 @@
"main": "index.js",
"license": "Apache",
"scripts": {
"test": "mocha test/**/*.js"
"test": "npm run compile && mocha test/**/*.js",
"compile": "babel -d lib src/",
"prepare": "npm run compile"
},
"dependencies": {
"devextreme": "^18.2.6",
"moment": "^2.24.0",
"underscore": "^1.9.1"
},
"devDependencies": {
"@babel/cli": "^7.5.0",
"@babel/core": "^7.5.4",
"@babel/plugin-proposal-class-properties": "^7.5.0",
"@babel/plugin-proposal-json-strings": "^7.2.0",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-syntax-import-meta": "^7.2.0",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.5.4",
"@babel/register": "^7.4.4",
"@babel/runtime": "^7.5.4",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"jslint": "^0.12.1",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/filters/test/unit/advanced.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const formatFiltersToODataQuery = require('../../index').formatFiltersToODataQuery;
const formatFiltersToODataQuery = require('../../lib/index').formatFiltersToODataQuery;
const expect = require('chai').expect;
const userContext = {
utcOffset: 0
Expand Down
2 changes: 1 addition & 1 deletion packages/filters/test/unit/connector.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const formatFiltersToODataQuery = require('../../index').formatFiltersToODataQuery;
const formatFiltersToODataQuery = require('../../lib/index').formatFiltersToODataQuery;
const expect = require('chai').expect;

describe('format filters to odata query with connector "and" or "or" or "!"', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/filters/test/unit/format.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const formatFiltersToODataQuery = require('../../index').formatFiltersToODataQuery;
const formatFiltersToODataQuery = require('../../lib/index').formatFiltersToODataQuery;
const expect = require('chai').expect;

describe('advanced format filter to odata query', () => {
Expand Down
12 changes: 6 additions & 6 deletions packages/filters/test/unit/format_buildin_date_value.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const formatFiltersToODataQuery = require('../../index').formatFiltersToODataQuery;
const getMonthDays = require('../../utils').getMonthDays;
const getLastMonthFirstDay = require('../../utils').getLastMonthFirstDay;
const getQuarterStartMonth = require('../../utils').getQuarterStartMonth;
const getLastQuarterFirstDay = require('../../utils').getLastQuarterFirstDay;
const getNextQuarterFirstDay = require('../../utils').getNextQuarterFirstDay;
const formatFiltersToODataQuery = require('../../lib/index').formatFiltersToODataQuery;
const getMonthDays = require('../../lib/utils').getMonthDays;
const getLastMonthFirstDay = require('../../lib/utils').getLastMonthFirstDay;
const getQuarterStartMonth = require('../../lib/utils').getQuarterStartMonth;
const getLastQuarterFirstDay = require('../../lib/utils').getLastQuarterFirstDay;
const getNextQuarterFirstDay = require('../../lib/utils').getNextQuarterFirstDay;
const expect = require('chai').expect;
const moment = require('moment');

Expand Down
2 changes: 1 addition & 1 deletion packages/filters/test/unit/format_utc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const formatFiltersToODataQuery = require('../../index').formatFiltersToODataQuery;
const formatFiltersToODataQuery = require('../../lib/index').formatFiltersToODataQuery;
const expect = require('chai').expect;

const now = new Date();
Expand Down
2 changes: 1 addition & 1 deletion packages/filters/test/unit/formula.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const formatFiltersToODataQuery = require('../../index').formatFiltersToODataQuery;
const formatFiltersToODataQuery = require('../../lib/index').formatFiltersToODataQuery;
const expect = require('chai').expect;

const userContext = { userId: "hPgDcEd9vKQxwndQR", user: { _id: "hPgDcEd9vKQxwndQR", name: "系统管理员", email: "[email protected]" } };
Expand Down
2 changes: 1 addition & 1 deletion packages/filters/test/unit/simple.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const formatFiltersToODataQuery = require('../../index').formatFiltersToODataQuery;
const formatFiltersToODataQuery = require('../../lib/index').formatFiltersToODataQuery;
const expect = require('chai').expect;
describe('format filters to a simple odata query', () => {
it('empty array', async () => {
Expand Down

0 comments on commit 60de888

Please sign in to comment.