Skip to content

Commit

Permalink
Merge pull request #510 from iamkun/dev
Browse files Browse the repository at this point in the history
D2M
  • Loading branch information
splashwizard authored Feb 24, 2019
2 parents 2a58380 + 4bfbced commit 0050764
Show file tree
Hide file tree
Showing 58 changed files with 1,753 additions and 1,203 deletions.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/--bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: "\U0001F4A9Bug report"
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Information**
- Day.js Version [e.g. v1.0.0]
- OS: [e.g. iOS]
- Browser [e.g. chrome 62]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ coverage
/plugin
dayjs.min.js
/esm
index.d.ts

#dev
demo.js
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ coverage
# dev
src
test
types
build
.babelrc
.eslintrc.json
Expand All @@ -25,4 +26,4 @@ docs

#other
.travis.yml
karma.sauce.conf.js
karma.sauce.conf.js
40 changes: 20 additions & 20 deletions .babelrc → babel.config.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"env": {
"test": {
"presets": [
"@babel/preset-env"
]
},
"build": {
"presets": [
[
"@babel/preset-env",
{
"modules": false,
"loose": true
}
]
]
}
}
}
module.exports = {
"env": {
"test": {
"presets": [
"@babel/preset-env"
]
},
"build": {
"presets": [
[
"@babel/preset-env",
{
"modules": false,
"loose": true
}
]
]
}
}
};
21 changes: 21 additions & 0 deletions build/esm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const fs = require('fs')
const path = require('path')
const util = require('util')

const { promisify } = util

const localeDir = path.join(process.env.PWD, 'esm/locale');

(async () => {
try {
const readLocaleDir = await promisify(fs.readdir)(localeDir)
readLocaleDir.forEach(async (l) => {
const filePath = path.join(localeDir, l)
const readFile = await promisify(fs.readFile)(filePath, 'utf8')
const result = readFile.replace("'dayjs'", "'../index'")
await promisify(fs.writeFile)(filePath, result, 'utf8')
})
} catch (e) {
console.error(e) // eslint-disable-line no-console
}
})()
5 changes: 5 additions & 0 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const configFactory = require('./rollup.config')
const fs = require('fs')
const util = require('util')
const path = require('path')
const { ncp } = require('ncp')

const { promisify } = util

Expand Down Expand Up @@ -39,6 +40,10 @@ async function build(option) {
input: './src/index.js',
fileName: './dayjs.min.js'
}))

ncp('./types/', './', (err) => {
if (err) { throw err }
})
} catch (e) {
console.error(e) // eslint-disable-line no-console
}
Expand Down
Loading

0 comments on commit 0050764

Please sign in to comment.