-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Converts to ES6 to enable tree-shaking * Updates index.js to ES6 * Adds `babel-plugin-add-module-exports` for backward compatibility * Modify index.js generator * Convert functions to es6 import/export format * Add examples * Update stuff * Update webpack 2.0 in examples * Install gzip-size-cli and pretty-bytes-cli to examples * Fix browserify example * Update examples READMEs * Move build-index at the end of release.sh * Add names in jsDocs * Fix build-docs * Regenerate docs * Add smoke test * Rebuild index.js * Fix version of phantomjs * Add more examples * Modify flow typings generator to include aliases in all typings * Modify build_index to generate es and non-es indices * Generate TypeScript typings for es
- Loading branch information
Showing
827 changed files
with
24,300 additions
and
2,881 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"presets": ["es2015"] | ||
"presets": ["es2015", "babel-preset-power-assert"], | ||
"plugins": ["add-module-exports"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
[ignore] | ||
.*node_modules* | ||
.*examples* | ||
[options] | ||
suppress_comment= \\(.\\|\n\\)*\\$ExpectedMistake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
node_modules | ||
npm-debug.log | ||
npm-debug.log* | ||
tmp | ||
dist/compressed | ||
test.espowered.js | ||
dist | ||
.envrc | ||
.idea/ | ||
/.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"presets": ["es2015"], | ||
"plugins": ["date-fns"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Usage With webpack 1.x | ||
|
||
See [example.js](./example.js) for source code example. | ||
|
||
See [package.json scripts](./package.json) for CLI usage. | ||
|
||
## Build Example | ||
|
||
```sh | ||
yarn | ||
yarn run build | ||
``` | ||
|
||
See ./dist for output. | ||
|
||
## Minimal Build Size | ||
|
||
You can see minimal build size (when you use just one function): | ||
|
||
```sh | ||
gzip-size dist/example.min.js | pretty-bytes | ||
#=> 4.07 kB | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import {format} from 'date-fns' | ||
|
||
const result = format('2017-01-25T21:28:15.000Z', 'DD.MM.YYYY HH:mm:ss') | ||
console.log(result === '25.01.2017 21:28:15') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "date-fns-example-babel", | ||
"version": "0.1.0", | ||
"description": "Example of date-fns usage with webpack 1.x, babel and babel-plugin-date-fns", | ||
"main": "example.js", | ||
"author": "Sasha Koss <koss@nocorp.me>", | ||
"license": "MIT", | ||
"dependencies": { | ||
"babel-core": "^6.22.1", | ||
"babel-plugin-date-fns": "^0.1.0", | ||
"babel-preset-babili": "^0.0.11", | ||
"babel-preset-es2015": "^6.22.0", | ||
"babili": "^0.0.11", | ||
"gzip-size-cli": "^1.0.0", | ||
"pretty-bytes-cli": "^2.0.0", | ||
"webpack": "1" | ||
}, | ||
"scripts": { | ||
"build": "yarn run build-date-fns && yarn run build-webpack && yarn run build-babili", | ||
"build-date-fns": "env PACKAGE_OUTPUT_PATH=\"$(pwd)/node_modules/date-fns\" ../../scripts/build_package.sh", | ||
"build-webpack": "webpack", | ||
"build-babili": "babili dist/example.js --out-file dist/example.min.js --minified --no-comments && yarn run stats-size", | ||
"stats-size": "gzip-size dist/example.min.js | pretty-bytes", | ||
"test": "test $(env TZ=UTC node ./dist/example.min.js) = true" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
entry: './example.js', | ||
output: { | ||
path: './dist', | ||
filename: 'example.js' | ||
}, | ||
module: { | ||
loaders: [{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
loader: 'babel-loader' | ||
}] | ||
} | ||
} |
Oops, something went wrong.