Skip to content

Commit

Permalink
Development (#2668)
Browse files Browse the repository at this point in the history
* docs action (#2660)

* fix popper

* fix npm packages (again)
  • Loading branch information
Eonasdan authored Sep 27, 2022
1 parent 20483d3 commit 9d28d5b
Show file tree
Hide file tree
Showing 44 changed files with 9,809 additions and 6,041 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Rate on Openbase](https://badges.openbase.com/js/rating/@eonasdan/tempus-dominus.svg)](https://openbase.com/js/@eonasdan/tempus-dominus?utm_source=embedded&utm_medium=badge&utm_campaign=rate-badge)

# Tempus Dominus Date/Time Picker v6.1.2
# Tempus Dominus Date/Time Picker v6.1.3

Tempus Dominus is a powerful and robust date time picker for javascript. Version 6 is another major rewrite over the previous version. V6 is written with modern browsers in mind and is written in typescript. Bootstrap, momentjs and jQuery are no longer required dependencies. Popper2 is all that is required for the picker to position correctly. If you still require jQuery (seriously, you should move off that asap) there's a jQuery provider that wraps the native js functions.

Expand Down
2 changes: 1 addition & 1 deletion build/change-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ async function main(args) {
}
}

main(process.argv.slice(2))
main(process.argv.slice(2)).then()
38 changes: 19 additions & 19 deletions build/plugins.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
const rollup = require('rollup')
const genericRollup = require('./rollup-plugin.config')
const fs = require('fs')
const util = require('util')
const path = require('path')
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 { promisify } = util;

const promisifyReadDir = promisify(fs.readdir)
const formatName = n => n.replace(/\.ts/, '').replace(/-/g, '_')
const promisifyReadDir = promisify(fs.readdir);
const formatName = n => n.replace(/\.ts/, '').replace(/-/g, '_');

const localePath = path.join(__dirname, '../src/locales')
const localePath = path.join(__dirname, '../src/locales');

async function build(option) {
const bundle = await rollup.rollup(option.input)
await bundle.write(option.output)
const bundle = await rollup.rollup(option.input);
await bundle.write(option.output);
}

(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)
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'))
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'))
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)}`
}))
}));
}
} catch (e) {
console.error(e) // eslint-disable-line no-console
console.error(e); // eslint-disable-line no-console
}
})()
})();
13 changes: 5 additions & 8 deletions build/rollup-plugin.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
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 typescript = require('rollup-plugin-ts');

const banner = require('./banner.js');
const globals = {
Expand All @@ -9,7 +7,7 @@ const globals = {
};

module.exports = (config) => {
const { input, fileName, name } = config
const { input, fileName, name } = config;
return {
input: {
input,
Expand All @@ -18,8 +16,7 @@ module.exports = (config) => {
],
plugins: [
typescript({
declaration: true,
declarationDir: 'types'
tsconfig: resolvedConfig => ({ ...resolvedConfig, declaration: false, rootDir: "./src" })
})
]
},
Expand All @@ -31,5 +28,5 @@ module.exports = (config) => {
globals,
compact: true
}
}
}
};
};
8 changes: 2 additions & 6 deletions build/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//const typescript = require('rollup-plugin-typescript2'); //this doesn't produce map files correctly ...sigh
const typescript = require('@rollup/plugin-typescript');
const typescript = require('rollup-plugin-ts');
import postcss from 'rollup-plugin-postcss';
import { terser } from "rollup-plugin-terser";

Expand Down Expand Up @@ -49,10 +48,7 @@ export default [
],
external: ['@popperjs/core'],
plugins: [
typescript({
declaration: true,
declarationDir: 'types'
})
typescript()
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion dist/css/tempus-dominus.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/jQuery-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*global $, tempusDominus */

/*!
* Tempus Dominus v6.1.2 (https://getdatepicker.com/)
* Tempus Dominus v6.1.3 (https://getdatepicker.com/)
* Copyright 2013-2021 Jonathan Peterson
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/js/jQuery-provider.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9d28d5b

Please sign in to comment.