Skip to content

Commit 36d24b9

Browse files
[@elastic/datemath] Remove build step from datemath package. (#75505) (#75944)
* Remove build step from datemath. * Remove outdated docs reference to datemath. Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
1 parent c40d295 commit 36d24b9

File tree

9 files changed

+11
-38
lines changed

9 files changed

+11
-38
lines changed

docs/developer/contributing/development-tests.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ root)
2020
|`yarn test:jest_integration -t regexp [test path]`
2121

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

2626
|Functional

packages/elastic-datemath/.babelrc

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
1-
/src
2-
/test
31
/tsconfig.json
4-
/.babelrc
5-
/yarn.lock
62
/__tests__

packages/elastic-datemath/__tests__/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
* under the License.
1818
*/
1919

20-
import dateMath from '../src';
21-
import moment from 'moment';
22-
import sinon from 'sinon';
23-
import expect from '@kbn/expect';
20+
const dateMath = require('../index');
21+
const moment = require('moment');
22+
const sinon = require('sinon');
23+
const expect = require('@kbn/expect');
2424

2525
/**
2626
* Require a new instance of the moment library, bypassing the require cache.
File renamed without changes.

packages/elastic-datemath/src/index.js renamed to packages/elastic-datemath/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* under the License.
1818
*/
1919

20-
import moment from 'moment';
20+
const moment = require('moment');
2121

2222
const unitsMap = {
2323
ms: { weight: 1, type: 'fixed', base: 1 },
@@ -151,7 +151,7 @@ function parseDateMath(mathString, time, roundUp) {
151151
return dateTime;
152152
}
153153

154-
export default {
154+
module.exports = {
155155
parse: parse,
156156
unitsMap: Object.freeze(unitsMap),
157157
units: Object.freeze(units),

packages/elastic-datemath/package.json

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,8 @@
33
"version": "5.0.3",
44
"description": "elasticsearch datemath parser, used in kibana",
55
"license": "Apache-2.0",
6-
"main": "target/index.js",
7-
"typings": "target/index.d.ts",
8-
"scripts": {
9-
"build": "babel src --out-dir target --copy-files",
10-
"kbn:bootstrap": "yarn build --quiet",
11-
"kbn:watch": "yarn build --watch"
12-
},
13-
"devDependencies": {
14-
"@babel/cli": "^7.10.5",
15-
"@babel/preset-env": "^7.11.0",
16-
"babel-plugin-add-module-exports": "^1.0.2",
17-
"moment": "^2.24.0"
18-
},
19-
"dependencies": {
20-
"tslib": "^2.0.0"
21-
},
6+
"main": "index.js",
7+
"typings": "index.d.ts",
228
"peerDependencies": {
239
"moment": "^2.24.0"
2410
}
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
{
22
"extends": "../../tsconfig.json",
3-
"compilerOptions": {
4-
"declaration": true,
5-
"outDir": "./target"
6-
},
73
"include": [
8-
"./src/**/*.ts"
9-
]
4+
"index.d.ts"
5+
],
106
}

packages/elastic-datemath/yarn.lock

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)