Skip to content

Commit

Permalink
[@elastic/datemath] Remove build step from datemath package. (#75505)
Browse files Browse the repository at this point in the history
* Remove build step from datemath.

* Remove outdated docs reference to datemath.

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
lukeelmers and elasticmachine authored Aug 22, 2020
1 parent 50499a5 commit f7cfcea
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 38 deletions.
2 changes: 1 addition & 1 deletion docs/developer/contributing/development-tests.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ root)
|`yarn test:jest_integration -t regexp [test path]`

|Mocha
|`src/**/__tests__/**/*.js` `!src/**/public/__tests__/*.js``packages/kbn-datemath/test/**/*.js` `packages/kbn-dev-utils/src/**/__tests__/**/*.js` `tasks/**/__tests__/**/*.js`
|`src/**/__tests__/**/*.js` `!src/**/public/__tests__/*.js` `packages/kbn-dev-utils/src/**/__tests__/**/*.js` `tasks/**/__tests__/**/*.js`
|`node scripts/mocha --grep=regexp [test path]`

|Functional
Expand Down
4 changes: 0 additions & 4 deletions packages/elastic-datemath/.babelrc

This file was deleted.

4 changes: 0 additions & 4 deletions packages/elastic-datemath/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
/src
/test
/tsconfig.json
/.babelrc
/yarn.lock
/__tests__
8 changes: 4 additions & 4 deletions packages/elastic-datemath/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
* under the License.
*/

import dateMath from '../src';
import moment from 'moment';
import sinon from 'sinon';
import expect from '@kbn/expect';
const dateMath = require('../index');
const moment = require('moment');
const sinon = require('sinon');
const expect = require('@kbn/expect');

/**
* Require a new instance of the moment library, bypassing the require cache.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import moment from 'moment';
const moment = require('moment');

const unitsMap = {
ms: { weight: 1, type: 'fixed', base: 1 },
Expand Down Expand Up @@ -151,7 +151,7 @@ function parseDateMath(mathString, time, roundUp) {
return dateTime;
}

export default {
module.exports = {
parse: parse,
unitsMap: Object.freeze(unitsMap),
units: Object.freeze(units),
Expand Down
18 changes: 2 additions & 16 deletions packages/elastic-datemath/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,8 @@
"version": "5.0.3",
"description": "elasticsearch datemath parser, used in kibana",
"license": "Apache-2.0",
"main": "target/index.js",
"typings": "target/index.d.ts",
"scripts": {
"build": "babel src --out-dir target --copy-files",
"kbn:bootstrap": "yarn build --quiet",
"kbn:watch": "yarn build --watch"
},
"devDependencies": {
"@babel/cli": "^7.10.5",
"@babel/preset-env": "^7.11.0",
"babel-plugin-add-module-exports": "^1.0.2",
"moment": "^2.24.0"
},
"dependencies": {
"tslib": "^2.0.0"
},
"main": "index.js",
"typings": "index.d.ts",
"peerDependencies": {
"moment": "^2.24.0"
}
Expand Down
8 changes: 2 additions & 6 deletions packages/elastic-datemath/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"declaration": true,
"outDir": "./target"
},
"include": [
"./src/**/*.ts"
]
"index.d.ts"
],
}
1 change: 0 additions & 1 deletion packages/elastic-datemath/yarn.lock

This file was deleted.

0 comments on commit f7cfcea

Please sign in to comment.