@kuroson/sydneydayjs 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +15 -10
- package/eslint.config.mjs +0 -97
- package/src/index.ts +0 -14
- package/tsconfig.build.json +0 -18
- package/tsconfig.json +0 -24
- package/tsup.config.ts +0 -16
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kuroson/sydneydayjs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "A pre-configured dayjs wrapper with Sydney (Australia/Sydney) timezone as the default",
|
|
5
5
|
"author": "Alvin Cherk <a.cherk@unsw.edu.au>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,20 +21,12 @@
|
|
|
21
21
|
},
|
|
22
22
|
"./package.json": "./package.json"
|
|
23
23
|
},
|
|
24
|
-
"engines": {
|
|
25
|
-
"node": ">=22"
|
|
26
|
-
},
|
|
27
|
-
"depcheck": {
|
|
28
|
-
"ignores": [],
|
|
29
|
-
"skip-missing": true
|
|
30
|
-
},
|
|
31
24
|
"dependencies": {
|
|
32
25
|
"dayjs": "^1.11.10"
|
|
33
26
|
},
|
|
34
27
|
"devDependencies": {
|
|
35
28
|
"@eslint/js": "9.39.2",
|
|
36
29
|
"@typescript-eslint/eslint-plugin": "8.50.0",
|
|
37
|
-
"@typescript-eslint/parser": "8.50.0",
|
|
38
30
|
"depcheck": "1.4.7",
|
|
39
31
|
"eslint": "9.39.2",
|
|
40
32
|
"eslint-config-prettier": "10.1.8",
|
|
@@ -56,8 +48,21 @@
|
|
|
56
48
|
"publishConfig": {
|
|
57
49
|
"access": "public"
|
|
58
50
|
},
|
|
51
|
+
"depcheck": {
|
|
52
|
+
"ignores": [],
|
|
53
|
+
"skip-missing": true
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=22"
|
|
57
|
+
},
|
|
58
|
+
"files": [
|
|
59
|
+
"dist",
|
|
60
|
+
"package.json",
|
|
61
|
+
"README.md",
|
|
62
|
+
"LICENSE",
|
|
63
|
+
"CHANGELOG.md"
|
|
64
|
+
],
|
|
59
65
|
"scripts": {
|
|
60
|
-
"build": "tsup",
|
|
61
66
|
"build:all": "tsup",
|
|
62
67
|
"depcheck": "depcheck",
|
|
63
68
|
"lint": "eslint './**/*.{ts,js}'",
|
package/eslint.config.mjs
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath } from 'url';
|
|
2
|
-
import { dirname } from 'path';
|
|
3
|
-
import js from '@eslint/js';
|
|
4
|
-
import tseslint from 'typescript-eslint';
|
|
5
|
-
import unusedImports from 'eslint-plugin-unused-imports';
|
|
6
|
-
import prettier from 'eslint-config-prettier';
|
|
7
|
-
import prettierPlugin from 'eslint-plugin-prettier';
|
|
8
|
-
import { defineConfig } from 'eslint/config';
|
|
9
|
-
|
|
10
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
11
|
-
|
|
12
|
-
const config = defineConfig([
|
|
13
|
-
js.configs.recommended,
|
|
14
|
-
...tseslint.configs.recommendedTypeChecked,
|
|
15
|
-
...tseslint.configs.stylisticTypeChecked,
|
|
16
|
-
prettier,
|
|
17
|
-
{
|
|
18
|
-
ignores: [
|
|
19
|
-
'node_modules',
|
|
20
|
-
'**/node_modules',
|
|
21
|
-
'**/.cache',
|
|
22
|
-
'build',
|
|
23
|
-
'dist',
|
|
24
|
-
'.yarn',
|
|
25
|
-
'.turbo',
|
|
26
|
-
'**/.turbo',
|
|
27
|
-
'.out',
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
languageOptions: {
|
|
32
|
-
parser: tseslint.parser,
|
|
33
|
-
parserOptions: {
|
|
34
|
-
project: './tsconfig.json',
|
|
35
|
-
tsconfigRootDir: __dirname,
|
|
36
|
-
ecmaVersion: 'latest',
|
|
37
|
-
sourceType: 'module',
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
plugins: {
|
|
41
|
-
'unused-imports': unusedImports,
|
|
42
|
-
prettier: prettierPlugin,
|
|
43
|
-
},
|
|
44
|
-
rules: {
|
|
45
|
-
'unused-imports/no-unused-imports': 'warn',
|
|
46
|
-
'prettier/prettier': 'error',
|
|
47
|
-
// Allow both type and interface (prefer type)
|
|
48
|
-
'@typescript-eslint/consistent-type-definitions': 'off',
|
|
49
|
-
// Allow both Array<T> and T[] syntax
|
|
50
|
-
'@typescript-eslint/array-type': 'off',
|
|
51
|
-
// Allow both index signatures and Record types
|
|
52
|
-
'@typescript-eslint/consistent-indexed-object-style': 'off',
|
|
53
|
-
// Allow unused variables
|
|
54
|
-
'@typescript-eslint/no-unused-vars': 'off',
|
|
55
|
-
// Allow template literal expressions with any type
|
|
56
|
-
'@typescript-eslint/restrict-template-expressions': 'off',
|
|
57
|
-
// Allow explicit any types
|
|
58
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
59
|
-
// Allow unsafe member access on any types
|
|
60
|
-
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
61
|
-
// Allow unsafe argument types
|
|
62
|
-
'@typescript-eslint/no-unsafe-argument': 'off',
|
|
63
|
-
// Allow promise rejections with non-Error values
|
|
64
|
-
'@typescript-eslint/prefer-promise-reject-errors': 'off',
|
|
65
|
-
// Strict boolean expressions
|
|
66
|
-
'@typescript-eslint/strict-boolean-expressions': 'warn',
|
|
67
|
-
// Code quality
|
|
68
|
-
'@typescript-eslint/prefer-nullish-coalescing': 'warn',
|
|
69
|
-
'@typescript-eslint/prefer-optional-chain': 'warn',
|
|
70
|
-
'prefer-const': 'error',
|
|
71
|
-
'no-var': 'error',
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
files: ['*.js', '*.cjs'],
|
|
76
|
-
languageOptions: {
|
|
77
|
-
parserOptions: {
|
|
78
|
-
ecmaVersion: 'latest',
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
...tseslint.configs.disableTypeChecked,
|
|
82
|
-
rules: {
|
|
83
|
-
'@typescript-eslint/no-var-requires': 'off',
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
files: ['*.config.ts', '*.config.mjs'],
|
|
88
|
-
languageOptions: {
|
|
89
|
-
parserOptions: {
|
|
90
|
-
project: null,
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
...tseslint.configs.disableTypeChecked,
|
|
94
|
-
},
|
|
95
|
-
]);
|
|
96
|
-
|
|
97
|
-
export default config;
|
package/src/index.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import dayjs from 'dayjs';
|
|
2
|
-
import timezone from 'dayjs/plugin/timezone';
|
|
3
|
-
import utc from 'dayjs/plugin/utc';
|
|
4
|
-
|
|
5
|
-
const TIME_ZONE = 'Australia/Sydney';
|
|
6
|
-
|
|
7
|
-
dayjs.extend(utc);
|
|
8
|
-
dayjs.extend(timezone);
|
|
9
|
-
dayjs.tz.setDefault(TIME_ZONE);
|
|
10
|
-
|
|
11
|
-
export const sydneyDayjs = {
|
|
12
|
-
now: () => dayjs.tz(new Date(), TIME_ZONE).tz(TIME_ZONE),
|
|
13
|
-
create: (date: Parameters<typeof dayjs>[0]) => dayjs.tz(date, TIME_ZONE),
|
|
14
|
-
};
|
package/tsconfig.build.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
-
"extends": "./tsconfig.json",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"baseUrl": "./src",
|
|
6
|
-
"target": "ESNext",
|
|
7
|
-
"verbatimModuleSyntax": true,
|
|
8
|
-
"module": "ESNext",
|
|
9
|
-
"moduleResolution": "bundler",
|
|
10
|
-
"outDir": "./dist",
|
|
11
|
-
"rootDir": "./src",
|
|
12
|
-
"declarationDir": "./dist",
|
|
13
|
-
"noEmit": false,
|
|
14
|
-
"incremental": true,
|
|
15
|
-
"tsBuildInfoFile": "./tsconfig.build.tsbuildinfo"
|
|
16
|
-
},
|
|
17
|
-
"exclude": ["dist", "**/__tests__/*", "node_modules"]
|
|
18
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
-
"extends": "../../../tsconfig.base.json",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"moduleResolution": "bundler",
|
|
7
|
-
"target": "ESNext",
|
|
8
|
-
"lib": ["ESNext"],
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"allowSyntheticDefaultImports": true,
|
|
11
|
-
"baseUrl": "./src",
|
|
12
|
-
"outDir": "./dist",
|
|
13
|
-
"rootDir": "./src",
|
|
14
|
-
"noEmit": true,
|
|
15
|
-
"incremental": true,
|
|
16
|
-
"resolveJsonModule": true,
|
|
17
|
-
"strict": true,
|
|
18
|
-
"skipLibCheck": true,
|
|
19
|
-
"declaration": true,
|
|
20
|
-
"declarationMap": true
|
|
21
|
-
},
|
|
22
|
-
"exclude": ["**/node_modules", "**/.*/*", "dist", "tsup.config.ts"],
|
|
23
|
-
"include": ["src/**/*.ts"]
|
|
24
|
-
}
|
package/tsup.config.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'tsup';
|
|
2
|
-
|
|
3
|
-
export default defineConfig(() => ({
|
|
4
|
-
entry: ['src/index.ts'],
|
|
5
|
-
format: ['esm', 'cjs'],
|
|
6
|
-
splitting: false,
|
|
7
|
-
clean: true,
|
|
8
|
-
dts: true,
|
|
9
|
-
platform: 'node',
|
|
10
|
-
target: 'node22',
|
|
11
|
-
tsconfig: new URL('tsconfig.build.json', import.meta.url).pathname,
|
|
12
|
-
sourcemap: true,
|
|
13
|
-
minify: false,
|
|
14
|
-
treeshake: true,
|
|
15
|
-
outDir: 'dist',
|
|
16
|
-
}));
|