-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* sonarqube issues * plugins and locales! * sonarqube issues * plugins and locales! * trying out some plugin stuff * tiny di works * clean packagelock * fixed docs, plugin examples, add other locales * update build * doc updates. moved cheese * types * I spel real good * Fixed month manipulation issue #2474 * fixed start/end of week #2473 * If view option is passed do not override with default. * dark mode and minification! * input event trigger * fix for disposing inline calender gives an exception #2493 * fix reshow should not call dates.setValue with the current fixes: #2488 when a reshow is done, especially with inline calender the useCurrent or useDefault should not be used if there is already someting in the dates. If there is already a date set, but then you update some options it should stick to that date, not reset to the current or default.. * #fixes 2424 * bit of code clean up added view mode information to events * code cleanup * update paint * sonar * sonar * sonar * sonar * sonar * sonar Co-authored-by: jorge <[email protected]> Co-authored-by: Johan Compagner <[email protected]>
- Loading branch information
1 parent
89f69f8
commit 3ab219d
Showing
120 changed files
with
8,608 additions
and
17,725 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 |
---|---|---|
|
@@ -10,4 +10,5 @@ site | |
*.sln | ||
*.nupkg | ||
src/docs/partials/examples/test.html | ||
docs/ | ||
/docs/ | ||
/dist/plugins/examples/ |
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
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
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,81 @@ | ||
const rollup = require('rollup') | ||
const genericRollup = require('./rollup-plugin.config') | ||
const fs = require('fs') | ||
const util = require('util') | ||
const path = require('path') | ||
|
||
const { promisify } = util | ||
|
||
const promisifyReadDir = promisify(fs.readdir) | ||
const promisifyReadFile = promisify(fs.readFile) | ||
const promisifyWriteFile = promisify(fs.writeFile) | ||
|
||
const localeNameRegex = /\/\/ (.*) \[/ | ||
const formatName = n => n.replace(/\.ts/, '').replace(/-/g, '_') | ||
|
||
const localePath = path.join(__dirname, '../src/locales') | ||
|
||
async function build(option) { | ||
const bundle = await rollup.rollup(option.input) | ||
await bundle.write(option.output) | ||
} | ||
|
||
async function listLocaleJson(localeArr) { | ||
const localeListArr = [] | ||
await Promise.all(localeArr.map(async (l) => { | ||
const localeData = await promisifyReadFile(path.join(localePath, l), 'utf-8') | ||
localeListArr.push({ | ||
key: l.slice(0, -3), | ||
name: localeData.match(localeNameRegex)[1] | ||
}) | ||
})) | ||
promisifyWriteFile(path.join(__dirname, '../locales.json'), JSON.stringify(localeListArr), 'utf8') | ||
} | ||
|
||
(async () => { | ||
try { | ||
/* eslint-disable no-restricted-syntax, no-await-in-loop */ | ||
// We use await-in-loop to make rollup run sequentially to save on RAM | ||
const locales = await promisifyReadDir(localePath) | ||
for (const l of locales) { | ||
// run builds sequentially to limit RAM usage | ||
await build(genericRollup({ | ||
input: `./src/locales/${l}`, | ||
fileName: `./dist/locales/${l.replace('.ts', '.js')}`, | ||
name: `tempusDominus.locales.${formatName(l)}` | ||
})) | ||
} | ||
|
||
const plugins = await promisifyReadDir(path.join(__dirname, '../src/plugins')) | ||
for (const plugin of plugins.filter(x => x !== 'examples')) { | ||
// run builds sequentially to limit RAM usage | ||
await build(genericRollup({ | ||
input: `./src/plugins/${plugin}/index.ts`, | ||
fileName: `./dist/plugins/${plugin}.js`, | ||
name: `tempusDominus.plugins.${formatName(plugin)}` | ||
})) | ||
} | ||
|
||
const examplePlugins = await promisifyReadDir(path.join(__dirname, '../src/plugins/examples')) | ||
for (const plugin of examplePlugins.map(x => x.replace('.ts', ''))) { | ||
// run builds sequentially to limit RAM usage | ||
await build(genericRollup({ | ||
input: `./src/plugins/examples/${plugin}.ts`, | ||
fileName: `./dist/plugins/examples/${plugin}.js`, | ||
name: `tempusDominus.plugins.${formatName(plugin)}` | ||
})) | ||
} | ||
|
||
/* build(configFactory({ | ||
input: './src/index.js', | ||
fileName: './tempusDominus.min.js' | ||
}))*/ | ||
|
||
//await promisify(ncp)('./types/', './') | ||
|
||
// list locales | ||
// await listLocaleJson(locales) | ||
} catch (e) { | ||
console.error(e) // eslint-disable-line no-console | ||
} | ||
})() |
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,35 @@ | ||
const typescript = require('rollup-plugin-typescript2'); //todo investigate why the other one doesn't work | ||
//const typescript = require('@rollup/plugin-typescript'); | ||
//import { terser } from "rollup-plugin-terser"; | ||
|
||
const banner = require('./banner.js'); | ||
const globals = { | ||
'@popperjs/core': 'Popper', | ||
tempusDominus: 'tempusDominus' | ||
}; | ||
|
||
module.exports = (config) => { | ||
const { input, fileName, name } = config | ||
return { | ||
input: { | ||
input, | ||
external: [ | ||
'tempusDominus' | ||
], | ||
plugins: [ | ||
typescript({ | ||
declaration: true, | ||
declarationDir: 'types' | ||
}) | ||
] | ||
}, | ||
output: { | ||
banner, | ||
file: fileName, | ||
format: 'umd', | ||
name: name || 'tempusDominus', | ||
globals, | ||
compact: 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.