tsdf 7.1.0
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/.eslintignore +3 -0
- package/.eslintrc.cjs +56 -0
- package/.gitattributes +22 -0
- package/.prettierrc +6 -0
- package/.vscode/settings.json +3 -0
- package/.vscode/tasks.json +25 -0
- package/README.md +3 -0
- package/package.json +63 -0
- package/scripts/check-if-is-sync.sh +6 -0
- package/src/main.ts +1 -0
- package/test/setup/setup.ts +15 -0
- package/test/test.test.ts +5 -0
- package/tsconfig.json +24 -0
- package/tsconfig.prod.json +9 -0
- package/tsup.config.ts +12 -0
- package/vitest.config.ts +9 -0
package/.eslintignore
ADDED
package/.eslintrc.cjs
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const OFF = 0;
|
|
2
|
+
const WARN = 1;
|
|
3
|
+
const ERROR = 2;
|
|
4
|
+
|
|
5
|
+
module.exports = {
|
|
6
|
+
parser: '@typescript-eslint/parser',
|
|
7
|
+
parserOptions: {
|
|
8
|
+
project: './tsconfig.json',
|
|
9
|
+
createDefaultProgram: true,
|
|
10
|
+
ecmaVersion: 8,
|
|
11
|
+
ecmaFeatures: {
|
|
12
|
+
jsx: true,
|
|
13
|
+
},
|
|
14
|
+
useJSXTextNode: true,
|
|
15
|
+
sourceType: 'module',
|
|
16
|
+
},
|
|
17
|
+
env: {
|
|
18
|
+
browser: true,
|
|
19
|
+
},
|
|
20
|
+
plugins: ['@typescript-eslint'],
|
|
21
|
+
|
|
22
|
+
rules: {
|
|
23
|
+
'no-warning-comments': [WARN, { terms: ['FIX:'] }],
|
|
24
|
+
'no-constant-binary-expression': ERROR,
|
|
25
|
+
'object-shorthand': ERROR,
|
|
26
|
+
'no-useless-rename': ERROR,
|
|
27
|
+
'no-param-reassign': ERROR,
|
|
28
|
+
|
|
29
|
+
'no-prototype-builtins': OFF,
|
|
30
|
+
|
|
31
|
+
/* typescript */
|
|
32
|
+
'@typescript-eslint/no-explicit-any': OFF,
|
|
33
|
+
'@typescript-eslint/naming-convention': [
|
|
34
|
+
'error',
|
|
35
|
+
{
|
|
36
|
+
selector: 'typeLike',
|
|
37
|
+
format: ['PascalCase'],
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
'@typescript-eslint/no-throw-literal': ERROR,
|
|
41
|
+
'@typescript-eslint/no-unused-expressions': ERROR,
|
|
42
|
+
'@typescript-eslint/no-unused-vars': [ERROR, { argsIgnorePattern: '^_' }],
|
|
43
|
+
'@typescript-eslint/no-shadow': [ERROR, { ignoreOnInitialization: true }],
|
|
44
|
+
'@typescript-eslint/no-non-null-assertion': OFF,
|
|
45
|
+
|
|
46
|
+
/* jest */
|
|
47
|
+
'jest/expect-expect': [ERROR, { assertFunctionNames: ['expect*'] }],
|
|
48
|
+
'jest/no-deprecated-functions': OFF,
|
|
49
|
+
},
|
|
50
|
+
extends: [
|
|
51
|
+
'eslint:recommended',
|
|
52
|
+
'plugin:@typescript-eslint/recommended',
|
|
53
|
+
'plugin:jest/recommended',
|
|
54
|
+
'plugin:jest/style',
|
|
55
|
+
],
|
|
56
|
+
};
|
package/.gitattributes
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Auto detect text files and perform LF normalization
|
|
2
|
+
* text eol=lf
|
|
3
|
+
|
|
4
|
+
# Custom for Visual Studio
|
|
5
|
+
*.cs diff=csharp
|
|
6
|
+
|
|
7
|
+
# Standard to msysgit
|
|
8
|
+
*.doc diff=astextplain
|
|
9
|
+
*.DOC diff=astextplain
|
|
10
|
+
*.docx diff=astextplain
|
|
11
|
+
*.DOCX diff=astextplain
|
|
12
|
+
*.dot diff=astextplain
|
|
13
|
+
*.DOT diff=astextplain
|
|
14
|
+
*.pdf diff=astextplain
|
|
15
|
+
*.PDF diff=astextplain
|
|
16
|
+
*.rtf diff=astextplain
|
|
17
|
+
*.RTF diff=astextplain
|
|
18
|
+
|
|
19
|
+
# Denote all files that are truly binary and should not be modified.
|
|
20
|
+
*.png binary
|
|
21
|
+
*.jpg binary
|
|
22
|
+
*.ico binary
|
package/.prettierrc
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
|
3
|
+
// for the documentation about the tasks.json format
|
|
4
|
+
"version": "2.0.0",
|
|
5
|
+
"tasks": [
|
|
6
|
+
{
|
|
7
|
+
"type": "npm",
|
|
8
|
+
"script": "npm-publish",
|
|
9
|
+
"label": "publish package",
|
|
10
|
+
"problemMatcher": [],
|
|
11
|
+
"presentation": {
|
|
12
|
+
"clear": true
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"type": "npm",
|
|
17
|
+
"script": "test",
|
|
18
|
+
"label": "run tests",
|
|
19
|
+
"problemMatcher": [],
|
|
20
|
+
"presentation": {
|
|
21
|
+
"clear": true
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tsdf",
|
|
3
|
+
"version": "7.1.0",
|
|
4
|
+
"description": "A data fetching solution based on t-state",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Lucas Santos",
|
|
7
|
+
"repository": "github:lucasols/tsdf",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "./dist/main.cjs",
|
|
10
|
+
"module": "./dist/main.js",
|
|
11
|
+
"types": "./dist/main.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/main.js",
|
|
15
|
+
"require": "./dist/main.cjs"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=16.0.0"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"test": "vitest --ui",
|
|
24
|
+
"lint": "pnpm tsc && pnpm eslint && pnpm format",
|
|
25
|
+
"eslint": "eslint --ext .jsx,.js,.ts,.tsx src/",
|
|
26
|
+
"format": "prettier --write src/**/*.ts",
|
|
27
|
+
"tsc": "tsc -p tsconfig.prod.json",
|
|
28
|
+
"test:run": "vitest run",
|
|
29
|
+
"build": "pnpm test:run && pnpm lint && pnpm build:no-test",
|
|
30
|
+
"build:no-test": "tsup --minify --dts",
|
|
31
|
+
"npm-publish": "./scripts/check-if-is-sync.sh && pnpm build && npm publish"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
35
|
+
"@testing-library/react": "^13.4.0",
|
|
36
|
+
"@types/node": "^18.11.18",
|
|
37
|
+
"@types/react": "^18.0.26",
|
|
38
|
+
"@types/react-dom": "^18.0.10",
|
|
39
|
+
"@types/testing-library__jest-dom": "^5.14.5",
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
|
41
|
+
"@typescript-eslint/parser": "^5.47.1",
|
|
42
|
+
"@vitest/ui": "0.26.2",
|
|
43
|
+
"eslint": "^8.30.0",
|
|
44
|
+
"eslint-plugin-jest": "^27.1.7",
|
|
45
|
+
"jsdom": "^20.0.3",
|
|
46
|
+
"prettier": "^2.8.1",
|
|
47
|
+
"react": "^18.2.0",
|
|
48
|
+
"react-dom": "^18.2.0",
|
|
49
|
+
"tiny-glob": "^0.2.9",
|
|
50
|
+
"tsm": "^2.3.0",
|
|
51
|
+
"tsup": "^6.5.0",
|
|
52
|
+
"typescript": "^4.9.4",
|
|
53
|
+
"vite": "^4.0.3",
|
|
54
|
+
"vitest": "^0.26.2"
|
|
55
|
+
},
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"t-state": "^7.1.0"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"react": "^18.0.0",
|
|
61
|
+
"react-dom": "^18.0.0"
|
|
62
|
+
}
|
|
63
|
+
}
|
package/src/main.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
console.log('comming soon');
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-namespace */
|
|
2
|
+
import { expect } from 'vitest';
|
|
3
|
+
import matchers, {
|
|
4
|
+
TestingLibraryMatchers,
|
|
5
|
+
} from '@testing-library/jest-dom/matchers';
|
|
6
|
+
|
|
7
|
+
declare global {
|
|
8
|
+
namespace Vi {
|
|
9
|
+
interface JestAssertion<T = any>
|
|
10
|
+
extends jest.Matchers<void, T>,
|
|
11
|
+
TestingLibraryMatchers<T, void> {}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
expect.extend(matchers);
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compileOnSave": false,
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"target": "ESNext",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"module": "CommonJS",
|
|
7
|
+
"jsx": "react-jsx",
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"types": [
|
|
10
|
+
"node"
|
|
11
|
+
],
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"esModuleInterop": true,
|
|
14
|
+
"strictNullChecks": true,
|
|
15
|
+
"noImplicitReturns": true,
|
|
16
|
+
"noImplicitAny": true,
|
|
17
|
+
"alwaysStrict": true,
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUncheckedIndexedAccess": true,
|
|
20
|
+
"forceConsistentCasingInFileNames": true,
|
|
21
|
+
"keyofStringsOnly": true,
|
|
22
|
+
"strictPropertyInitialization": true
|
|
23
|
+
}
|
|
24
|
+
}
|
package/tsup.config.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineConfig } from 'tsup';
|
|
2
|
+
import glob from 'tiny-glob'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
entry: await glob('./src/**/!(*.d|*.spec).ts'),
|
|
7
|
+
clean: true,
|
|
8
|
+
format: ['cjs', 'esm'],
|
|
9
|
+
esbuildOptions(options) {
|
|
10
|
+
options.mangleProps = /[^_]_$/;
|
|
11
|
+
},
|
|
12
|
+
});
|