Skip to content

Commit

Permalink
Integrate datatypes-date-time into build/packaging process (#496)
Browse files Browse the repository at this point in the history
* Integrate datatypes-date-time into build process
* Add recognizers-text-data-types-timex-expression to main package's deps
* Bumping npm package version of data-types-timex
  • Loading branch information
sanxing-chen authored and tellarin committed Apr 27, 2018
1 parent 2e4be3e commit 87f62bc
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 6 deletions.
3 changes: 2 additions & 1 deletion JavaScript/lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"lerna": "2.5.1",
"packages": [
"packages/recognizers-*"
"packages/recognizers-*",
"packages/datatypes-date-time"
],
"version": "1.0.0"
}
10 changes: 9 additions & 1 deletion JavaScript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
"name": "recognizers",
"version": "1.0.0",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/Recognizers-Text"
},
"bugs": {
"url": "https://github.com/Microsoft/Recognizers-Text/issues"
},
"scripts": {
"build": "lerna bootstrap",
"lint": "tslint -t codeFrame ./packages/**/*.ts",
Expand Down Expand Up @@ -77,6 +84,7 @@
"@microsoft/recognizers-text-number": "file:./packages/recognizers-number",
"@microsoft/recognizers-text-number-with-unit": "file:./packages/recognizers-number-with-unit",
"@microsoft/recognizers-text-sequence": "file:./packages/recognizers-sequence",
"@microsoft/recognizers-text-suite": "file:./packages/recognizers-text-suite"
"@microsoft/recognizers-text-suite": "file:./packages/recognizers-text-suite",
"@microsoft/recognizers-text-data-types-timex-expression": "file:./packages/datatypes-date-time"
}
}
4 changes: 4 additions & 0 deletions JavaScript/packages/datatypes-date-time/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!dist/*.js
!dist/types/**/*
!README.md
12 changes: 8 additions & 4 deletions JavaScript/packages/datatypes-date-time/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/recognizers-text-data-types-timex-expression",
"version": "1.0.0-rc.1",
"version": "1.0.1",
"description": "Support for TIMEX representation of data time",
"author": "Microsoft",
"license": "MIT",
Expand All @@ -9,7 +9,9 @@
"timex",
"luis"
],
"main": "index.js",
"main": "dist/recognizers-text-data-types-timex-expression.umd.js",
"module": "dist/recognizers-text-data-types-timex-expression.es5.js",
"browser": "dist/recognizers-text-data-types-timex-expression.browser.js",
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/Recognizers-Text"
Expand All @@ -19,9 +21,11 @@
},
"engines": {
"node": ">=6.0.0"
},
},
"scripts": {
"test": "mocha"
"test": "mocha",
"clean-build": "rimraf dist",
"prepare": "npm run clean-build && rollup -c"
},
"devDependencies": {
"chai": "^4.1.2",
Expand Down
26 changes: 26 additions & 0 deletions JavaScript/packages/datatypes-date-time/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import sourceMaps from 'rollup-plugin-sourcemaps';
import pkg from './package.json';
import camelCase from 'lodash.camelcase';

export default {
input: `index.js`,
output: [
{ file: pkg.module, format: 'es' },
{ file: pkg.main, name: camelCase(pkg.name), format: 'umd', exports: 'named' },
{ file: pkg.browser, format: 'iife', name: camelCase(pkg.name), exports: 'named' }
],
exports: 'named',
sourcemap: true,
plugins: [
// Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs)
commonjs(),
// Allow node_modules resolution, so you can use 'external' to control
// which external modules to include in the bundle
// https://github.com/rollup/rollup-plugin-node-resolve#usage
resolve(),
// Resolve source maps to the original source
sourceMaps()
]
};

0 comments on commit 87f62bc

Please sign in to comment.