Skip to content

Commit d1fb57c

Browse files
Initial commit
0 parents  commit d1fb57c

10 files changed

+146
-0
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
dist
2+
.DS_Store
3+
node_modules
4+
coverage
5+
temp
6+
*.log
7+
.vscode
8+
/.aws/credentials
9+
.yalc
10+
.idea

.npmignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
src
2+
api-extractor.json
3+
__tests__
4+
.editorconfig
5+
.gitignore
6+
rollup.config.js
7+
tsconfig.json
8+
yarn.lock
9+
docs
10+
.prettierrc
11+
.build.sh
12+
.github

.prettierrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"tabWidth": 2,
3+
"useTabs": false,
4+
"semi": false
5+
}

LICENSE

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2023 FormKit Inc.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Tempo
2+
3+
Tempo takes the pain out of dates in JavaScript by allowing you to parse, manipulate, format, and internationalize dates and times using JavaScript’s native `Intl.DateTimeFormat`.

package.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "@formkit/tempo",
3+
"version": "0.1.0",
4+
"description": "📆 Parse, format, manipulate, and internationalize dates and times in JavaScript and TypeScript.",
5+
"main": "index.js",
6+
"type": "module",
7+
"scripts": {
8+
"test": "echo \"Error: no test specified\" && exit 1"
9+
},
10+
"keywords": [
11+
"date",
12+
"time",
13+
"internationalization",
14+
"date format"
15+
],
16+
"author": "Justin Schroeder <justin@formkit.com>",
17+
"license": "MIT"
18+
}

rollup.config.js

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import typescript from "@rollup/plugin-typescript"
2+
import { terser } from "rollup-plugin-terser"
3+
4+
const FRAMEWORK = process.env.FRAMEWORK || "index"
5+
const DECLARATIONS = process.env.DECLARATIONS || false
6+
const MIN = process.env.MIN || false
7+
8+
const external = [
9+
"vue",
10+
"preact",
11+
"react",
12+
"angular",
13+
"process",
14+
"solid-js",
15+
"rollup-plugin-terser",
16+
"../index",
17+
]
18+
19+
function createOutput() {
20+
if (DECLARATIONS) {
21+
return {
22+
dir: "./dist",
23+
format: "esm",
24+
}
25+
}
26+
return {
27+
file: `./dist/${FRAMEWORK !== "index" ? FRAMEWORK + "/" : ""}index.${
28+
MIN ? "min.js" : "mjs"
29+
}`,
30+
format: "esm",
31+
}
32+
}
33+
34+
const plugins = [
35+
typescript({
36+
tsconfig: "tsconfig.json",
37+
compilerOptions: DECLARATIONS
38+
? {
39+
declaration: true,
40+
emitDeclarationOnly: true,
41+
}
42+
: {},
43+
rootDir: "./",
44+
outDir: `./dist`,
45+
include: ["./src/**/*"],
46+
exclude: ["./docs"],
47+
}),
48+
]
49+
50+
if (MIN) {
51+
plugins.push(terser())
52+
}
53+
54+
export default {
55+
external,
56+
input: `./src/${FRAMEWORK === "index" ? "" : FRAMEWORK + "/"}index.ts`,
57+
output: createOutput(),
58+
plugins,
59+
}

src/index.ts

Whitespace-only changes.

tsconfig.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"compilerOptions": {
3+
"experimentalDecorators": true,
4+
"module": "esnext",
5+
"target": "es2019",
6+
"lib": ["es2019", "dom"],
7+
"strict": true,
8+
"allowJs": false,
9+
"moduleResolution": "node",
10+
"outDir": "dist",
11+
"types": [
12+
"prismjs",
13+
"node"
14+
]
15+
},
16+
"exclude": [
17+
"examples"
18+
]
19+
}

0 commit comments

Comments
 (0)