Skip to content

Commit

Permalink
Development (#2740)
Browse files Browse the repository at this point in the history
* Fix typo in docs (#2718)

* Feature/less code smell (#2726)

* ran prettier

* prettier pre-commit hook

* eslint

* eslint

* eslint fix

* prettier again

* fixing eslint complaints

* adding eslint to pre commit hook

* updating vite config and remove generated coverage from repo

* remove generated coverage from repo

* Fix typo in docs (#2718)

* fix coveralls

Co-authored-by: carlos-ea <[email protected]>

* 2630 prompttimeondatechange option (#2731)

* resolves #2630

* resolves #2720 (#2732)

fixes #2720

* Fixes #2600 (#2733)

Fixes #2600

* CustomDateFormat Plugin prefers englishFormat instead of localized format (#2724)

* CustomDateFormat Plugin prefers englishFormat instead of localized format

* Fix de dateFormats

* Fix all locales

* Fix typehints in german tooltips

* Fix: replaceExtendedTokens makes 2-digits to 1-digits

* Fix style

* 2719 locales are not properly importable in typescript (#2737)

* playing with jsdom

* seems to work

* working on tests

* fixes #2719.

* rollback

* add locales/plugin source and types to npm

* put version back

* update cdn references

* fix #2621 by added min-height and simplifying rebuild function (#2738)

* fixes #2672

* release 6.2.8

* release 6.2.8

Co-authored-by: carlos-ea <[email protected]>
Co-authored-by: Sebastian Blank <[email protected]>
  • Loading branch information
3 people authored Dec 14, 2022
1 parent 5e04fcc commit 4dbbd20
Show file tree
Hide file tree
Showing 170 changed files with 11,617 additions and 9,794 deletions.
9 changes: 9 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**/dist/
**/docs/
**/coverage/
**/.husky/
**/types/
**/build/

#temporary
/test/test-import.ts
18 changes: 18 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
env:
browser: true
es2021: true
extends:
- eslint:recommended
- plugin:@typescript-eslint/recommended
- prettier
overrides: []
parser: '@typescript-eslint/parser'
parserOptions:
ecmaVersion: latest
sourceType: module
plugins:
- '@typescript-eslint'
rules:
linebreak-style:
- error
- unix
22 changes: 8 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,28 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Perform Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '16'
node-version: '18'
- name: Npm install
run: npm ci
- name: Unit tests
run: npm run test:coverage
- name: Build docs
run: npm run docs
# Send coverage report to Coveralls
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI
on:
push:
branches: [ development ]
pull_request:
branches: [ development ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Perform Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Npm install
run: npm ci
- name: Unit tests
run: npm run test:coverage
# Send coverage report to Coveralls
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ site
src/docs/partials/examples/test.html
/docs/
/dist/plugins/examples/
coverage/tmp
coverage

.DS_Store
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
3 changes: 1 addition & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/_layouts
/.gitignore
/node_modules
/Makefile
/test
*.log
*.swp
Expand All @@ -13,4 +12,4 @@
*.user
*.csproj
*.sln
*.nupkg
*.nupkg
6 changes: 5 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
src/docs/tempus-dominus*
dist
docs
node_modules
.github
coverage
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"singleQuote": true,
"tabWidth": 2,
"htmlWhitespaceSensitivity": "ignore"
"htmlWhitespaceSensitivity": "ignore",
"endOfLine": "lf"
}
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

[![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.2.7
# Tempus Dominus Date/Time Picker v6.2.8

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.

# Ready State
The beta is here. There's still plenty of things that can be worked on and you can see the [rough roadmap here](https://github.com/Eonasdan/tempus-dominus/projects).

The beta is here. There's still plenty of things that can be worked on and you can see the [rough roadmap here](https://github.com/Eonasdan/tempus-dominus/projects).

# Community

Expand All @@ -19,7 +20,7 @@ Please also take a look at the [discussions](https://github.com/Eonasdan/tempus-

## Building

Run `npm i` to install needed packages.
Run `npm i` to install needed packages.

The docs folder contains the generated documentation site, don't modify this directly as it will be overwritten on build. The dist folder contains the built js/css files.

Expand All @@ -28,14 +29,15 @@ The docs folder contains the generated documentation site, don't modify this dir
You can run `npm run serve` which will start a browser-sync server. Navigate to `http://localhost:3001/` to view the docs.

## Watching for changes

Do not run `npm run serve` at the same time.

Run `npm start`. This runs browser-sync, the build and watchers for the docs, styles, and typescript.

## Where do you use this?

I'd love to know if your public site is using this plugin and list your logo on the documentation site. Leave [create a discussion](https://github.com/Eonasdan/tempus-dominus/discussions/categories/show-your-love) and let me know.

## Priority support is available at an hourly rate.

If you have an urgent request, bug or need installation help, please contact in the discord server.

10 changes: 5 additions & 5 deletions build/banner.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
'use strict'
'use strict';

const pkg = require('../package.json')
const year = new Date().getFullYear()
const pkg = require('../package.json');
const year = new Date().getFullYear();

function getBanner() {
return `/*!
* Tempus Dominus v${pkg.version} (${pkg.homepage})
* Copyright 2013-${year} ${pkg.author.name}
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
*/`
*/`;
}

module.exports = getBanner
module.exports = getBanner;
3 changes: 1 addition & 2 deletions build/browser-sync-config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const fs = require('fs');
/*
|--------------------------------------------------------------------------
| Browser-sync config file
Expand All @@ -21,7 +20,7 @@ module.exports = {
watchOptions: {
ignoreInitial: true,
},
server: "docs",
server: 'docs',
https: false,
proxy: false,
port: 3001,
Expand Down
66 changes: 37 additions & 29 deletions build/change-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,76 +7,84 @@
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/

'use strict'
'use strict';

const fs = require('fs').promises
const path = require('path')
const globby = require('globby')
const fs = require('fs').promises;
const path = require('path');
const globby = require('globby');

const VERBOSE = process.argv.includes('--verbose')
const DRY_RUN = process.argv.includes('--dry') || process.argv.includes('--dry-run')
const VERBOSE = process.argv.includes('--verbose');
const DRY_RUN =
process.argv.includes('--dry') || process.argv.includes('--dry-run');

// These are the filetypes we only care about replacing the version
const GLOB = [
'**/*.{css,html,js,json,md,scss,txt,yml,ts,nuspec}',
'!**/change-log*'
]
'!**/change-log*',
];
const GLOBBY_OPTIONS = {
cwd: path.join(__dirname, '..'),
gitignore: true
}
gitignore: true,
};

// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37
function regExpQuote(string) {
return string.replace(/[$()*+-.?[\\\]^{|}]/g, '\\$&')
return string.replace(/[$()*+-.?[\\\]^{|}]/g, '\\$&');
}

function regExpQuoteReplacement(string) {
return string.replace(/\$/g, '$$')
return string.replace(/\$/g, '$$');
}

async function replaceRecursively(file, oldVersion, newVersion) {
const originalString = await fs.readFile(file, 'utf8')
const originalString = await fs.readFile(file, 'utf8');
const newString = originalString.replace(
new RegExp(regExpQuote(oldVersion), 'g'), regExpQuoteReplacement(newVersion)
)
new RegExp(regExpQuote(oldVersion), 'g'),
regExpQuoteReplacement(newVersion)
);

// No need to move any further if the strings are identical
if (originalString === newString) {
return
return;
}

if (VERBOSE) {
console.log(`FILE: ${file}`)
console.log(`FILE: ${file}`);
}

if (DRY_RUN) {
return
return;
}

await fs.writeFile(file, newString, 'utf8')
await fs.writeFile(file, newString, 'utf8');
}

async function main(args) {
let [oldVersion, newVersion] = args
let [oldVersion, newVersion] = args;

if (!oldVersion || !newVersion) {
console.error('USAGE: change-version old_version new_version [--verbose] [--dry[-run]]')
console.error('Got arguments:', args)
process.exit(1)
console.error(
'USAGE: change-version old_version new_version [--verbose] [--dry[-run]]'
);
console.error('Got arguments:', args);
process.exit(1);
}

// Strip any leading `v` from arguments because otherwise we will end up with duplicate `v`s
[oldVersion, newVersion] = [oldVersion, newVersion].map(arg => arg.startsWith('v') ? arg.slice(1) : arg)
[oldVersion, newVersion] = [oldVersion, newVersion].map((arg) =>
arg.startsWith('v') ? arg.slice(1) : arg
);

try {
const files = await globby(GLOB, GLOBBY_OPTIONS)
const files = await globby(GLOB, GLOBBY_OPTIONS);

await Promise.all(files.map(file => replaceRecursively(file, oldVersion, newVersion)))
await Promise.all(
files.map((file) => replaceRecursively(file, oldVersion, newVersion))
);
} catch (error) {
console.error(error)
process.exit(1)
console.error(error);
process.exit(1);
}
}

main(process.argv.slice(2)).then()
main(process.argv.slice(2)).then();
21 changes: 0 additions & 21 deletions build/copyToDist.js

This file was deleted.

Loading

0 comments on commit 4dbbd20

Please sign in to comment.