@itcase/types 1.0.2 → 1.0.4

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 CHANGED
@@ -1,3 +1,19 @@
1
+ ## [1.0.4](https://github.com/ITCase/itcase-types/compare/v1.0.3...v1.0.4) (2025-06-04)
2
+
3
+ ### Features
4
+
5
+ * add simple urls types ([3d28026](https://github.com/ITCase/itcase-types/commit/3d280261291d9f93ecb694de79ab0be5f9075d2d))
6
+
7
+ ## [1.0.3](https://github.com/ITCase/itcase-types/compare/v1.0.2...v1.0.3) (2025-05-13)
8
+
9
+ ### Fixes
10
+
11
+ * add files to git ([a9bd6a6](https://github.com/ITCase/itcase-types/commit/a9bd6a613ec8e161179a7553d25232728fdd19e0))
12
+
13
+ ### Features
14
+
15
+ * add simple "common" types ([e797bc4](https://github.com/ITCase/itcase-types/commit/e797bc4701a4e8f6e9f357b5ab7c7868f7b6c742))
16
+
1
17
  ## [1.0.2](https://github.com/ITCase/itcase-types/compare/v1.0.1...v1.0.2) (2025-04-21)
2
18
 
3
19
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/types",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "unified type storage",
5
5
  "keywords": [
6
6
  "types"
@@ -8,7 +8,7 @@
8
8
  "license": "MIT",
9
9
  "private": false,
10
10
  "exports": {
11
- ".": "./index.ts"
11
+ ".": "./types/index.ts"
12
12
  },
13
13
  "scripts": {
14
14
  "lint": "eslint types/",
@@ -16,6 +16,11 @@
16
16
  "prepare": "husky",
17
17
  "semantic-release": "semantic-release"
18
18
  },
19
+ "files": [
20
+ "types",
21
+ "README.md",
22
+ "CHANGELOG.md"
23
+ ],
19
24
  "repository": {
20
25
  "type": "git",
21
26
  "url": "https://github.com/ITCase/itcase-types.git"
@@ -24,20 +29,18 @@
24
29
  "access": "public",
25
30
  "registry": "https://registry.npmjs.org/"
26
31
  },
27
- "dependencies": {
28
- "@itcase/config": "^1.0.26"
29
- },
30
32
  "devDependencies": {
31
- "@commitlint/cli": "^19.8.0",
32
- "@commitlint/config-conventional": "^19.8.0",
33
- "@itcase/lint": "^1.1.4",
33
+ "@commitlint/cli": "^19.8.1",
34
+ "@commitlint/config-conventional": "^19.8.1",
35
+ "@itcase/config": "^1.0.41",
36
+ "@itcase/lint": "^1.1.9",
34
37
  "@semantic-release/changelog": "^6.0.3",
35
38
  "@semantic-release/git": "^10.0.1",
36
39
  "@semantic-release/release-notes-generator": "14.0.3",
37
40
  "conventional-changelog-conventionalcommits": "^8.0.0",
38
- "eslint": "9.24.0",
41
+ "eslint": "9.26.0",
39
42
  "husky": "^9.1.7",
40
- "lint-staged": "^15.5.1",
43
+ "lint-staged": "^16.0.0",
41
44
  "prettier": "^3.5.3",
42
45
  "semantic-release": "^24.2.3",
43
46
  "typescript": "^5.8.3"
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Used for objects unique identifier as "id" property. Sometime id may be
3
+ * generated as random string(uuid) or number from the rest-api response.
4
+ * Or in some cases when JS convert number to string, e.g. cookies, search-params, etc.
5
+ */
6
+ type Id = number | string
7
+
8
+ /**
9
+ * Date
10
+ * @format ISO date: "2024-01-31"
11
+ */
12
+ type DateIso = string
13
+
14
+ /**
15
+ * Date and time
16
+ * @format ISO date and time: "2024-01-31T23:00:59.322230+03:00"
17
+ */
18
+ type DateTimeIso = string
19
+
20
+ /**
21
+ * URL to some endpoint. E.g.: to django rest framework
22
+ * @format relative URL: "/rest/{...}/some/"
23
+ */
24
+ type RelativeUrl = string
25
+
26
+ /**
27
+ * URL to some endpoint. E.g.: to django rest framework
28
+ * @format absolute URL: "https://itcase.pro/rest/{...}/some/"
29
+ */
30
+ type AbsoluteUrl = string
31
+
32
+ /**
33
+ * URL to file. E.g.: in django media folder
34
+ * @format relative URL: "/media/uploads/{...}/file_name.png"
35
+ */
36
+ type ImageRelativeUrl = string
37
+
38
+ /**
39
+ * URL to file. E.g.: in django media folder
40
+ * @format absolute URL: "https://itcase.pro/media/uploads/{...}/file_name.png"
41
+ */
42
+ type ImageAbsoluteUrl = string
43
+
44
+ /**
45
+ * Simple callback function that takes no arguments and returns nothing.
46
+ * This type is used for basic event handlers or asynchronous operations.
47
+ */
48
+ type SimpleCallback = () => void
49
+
50
+ export type {
51
+ Id,
52
+ DateIso,
53
+ DateTimeIso,
54
+ RelativeUrl,
55
+ AbsoluteUrl,
56
+ ImageRelativeUrl,
57
+ ImageAbsoluteUrl,
58
+ SimpleCallback,
59
+ }
package/types/index.ts CHANGED
@@ -17,6 +17,7 @@ export * from './vertical'
17
17
  * files
18
18
  */
19
19
  export * from './appearanceKeys'
20
+ export * from './common'
20
21
  export * from './direction'
21
22
  export * from './elevation'
22
23
  export * from './height'
package/.editorconfig DELETED
@@ -1,35 +0,0 @@
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
- [*.{css,js,jsx,mjs,ts,tsx}]
13
- indent_style = space
14
- indent_size = 2
15
- tab_size = 2
16
- end_of_line = lf
17
- charset = utf-8
18
- trim_trailing_whitespace = true
19
- insert_final_newline = true
20
-
21
- [*.{html,py}]
22
- indent_style = space
23
- indent_size = 4
24
- end_of_line = lf
25
- charset = utf-8
26
- trim_trailing_whitespace = true
27
- insert_final_newline = true
28
-
29
- [*.md]
30
- trim_trailing_whitespace = false
31
-
32
- [Makefile]
33
- indent_style = tab
34
- indent_size = 4
35
-
@@ -1,33 +0,0 @@
1
- name: "Publish Package to NPM Registry"
2
-
3
- on:
4
- push:
5
- branches:
6
- - master
7
-
8
-
9
- jobs:
10
- publish-npm:
11
- runs-on: ubuntu-latest
12
- env:
13
- GIT_WORKFLOW: true
14
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
16
-
17
- steps:
18
- - name: "Make Checkout"
19
- uses: actions/checkout@v3
20
- with:
21
- fetch-depth: 0
22
-
23
- - name: "Setup NodeJS"
24
- uses: actions/setup-node@v3
25
- with:
26
- node-version: 20
27
-
28
- - name: "Install dependencies"
29
- run: npm install --force
30
-
31
- - name: "Publish package"
32
- shell: bash
33
- run: npm run semantic-release
@@ -1,5 +0,0 @@
1
- #!/bin/bash
2
-
3
- if [[ $(git log --format=%B -n 1) =~ major:|minor:|patch: ]]; then
4
- exit 0
5
- fi
@@ -1,14 +0,0 @@
1
- #!/bin/bash
2
-
3
- /bin/bash ".husky/check_message"
4
-
5
- branch="$(git rev-parse --abbrev-ref HEAD)"
6
-
7
- if [ "$branch" = "master" ]; then
8
- {
9
- npx commitlint --edit &&
10
- exit 0
11
- } || {
12
- /bin/bash ".husky/set_release_message"
13
- }
14
- fi
package/.husky/post-merge DELETED
@@ -1,14 +0,0 @@
1
- #!/bin/bash
2
-
3
- /bin/bash ".husky/check_message"
4
-
5
- branch="$(git rev-parse --abbrev-ref HEAD)"
6
-
7
- if [ "$branch" = "master" ]; then
8
- {
9
- npx commitlint --edit &&
10
- exit 0
11
- } || {
12
- /bin/bash ".husky/set_release_message"
13
- }
14
- fi
package/.husky/pre-commit DELETED
@@ -1,6 +0,0 @@
1
- #!/bin/bash
2
-
3
- if grep --include=*.{json,css,html,py} --exclude-dir={dist,node_modules,bower_components,.git} -nri --color -B 1 -A 1 '<\{7\} HEAD\|^\=\.{7\}\|>\.{7\}' .; then
4
- echo 'Fix conflicts'
5
- exit 1
6
- else ./node_modules/lint-staged/bin/lint-staged.js; fi
package/.husky/pre-push DELETED
@@ -1,14 +0,0 @@
1
- #!/bin/dash
2
-
3
- if [ $GIT_WORKFLOW ]; then
4
- exit 0
5
- fi
6
-
7
- /bin/bash ".husky/check_message"
8
-
9
- branch="$(git rev-parse --abbrev-ref HEAD)"
10
-
11
- if [ "$branch" = "master" ]; then
12
- npx commitlint --edit &&
13
- exit 0
14
- fi
@@ -1,43 +0,0 @@
1
- #!/bin/bash
2
-
3
- exec < /dev/tty
4
-
5
- function update_message {
6
- commit_message=$(git log --format=%B -n 1)
7
- new_commit_message="${1}: ${commit_message}"
8
- git commit --amend -m "${new_commit_message}"
9
- git log --format=%B -n 1
10
- }
11
-
12
-
13
- PS3='Select release type: '
14
-
15
- MAJOR='MAJOR version when you make incompatible API changes'
16
- MINOR='MINOR version when you add functionality in a backwards compatible manner'
17
- PATCH='PATCH version when you make backwards compatible bug fixes'
18
- CANCEL='Cancel'
19
-
20
- options=("${MAJOR}" "${MINOR}" "${PATCH}" "${CANCEL}")
21
- select opt in "${options[@]}"
22
- do
23
- case $opt in
24
- $MAJOR)
25
- update_message 'major'
26
- exit 0
27
- ;;
28
- $MINOR)
29
- update_message 'minor'
30
- exit 0
31
- ;;
32
- $PATCH)
33
- update_message 'patch'
34
- exit 0
35
- ;;
36
- $CANCEL)
37
- exit 1
38
- ;;
39
- *) echo "invalid option $REPLY";;
40
- esac
41
- done
42
-
43
- < /dev/tty
@@ -1,3 +0,0 @@
1
- import commitlint from '@itcase/config/commitlint/index.js'
2
-
3
- export default commitlint
package/eslint.config.mjs DELETED
@@ -1,3 +0,0 @@
1
- import eslint from '@itcase/lint/eslint/index.js'
2
-
3
- export default eslint
package/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './types/index'
@@ -1,3 +0,0 @@
1
- import lintstaged from '@itcase/config/lint-staged/index.js'
2
-
3
- export default lintstaged
@@ -1,3 +0,0 @@
1
- import prettier from '@itcase/lint/prettier/index.js'
2
-
3
- export default prettier
@@ -1,3 +0,0 @@
1
- import semanticRelease from '@itcase/config/semantic-release/index.js'
2
-
3
- export default semanticRelease
package/tsconfig.json DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- // Enforce consistent file casing
4
- "forceConsistentCasingInFileNames": true,
5
- // Treat each file as a separate module
6
- "isolatedModules": true,
7
- // Resolve modules using Node.js resolution algorithm
8
- "moduleResolution": "node",
9
- // Do not emit output files (for checking only)
10
- "noEmit": true,
11
- // Skip type checking of declaration files
12
- "skipLibCheck": true,
13
- // Enable strict type-checking options
14
- "strict": true
15
- },
16
- // Include files from the 'src' directory for compilation
17
- "include": [
18
- "types"
19
- ],
20
- "exclude": [
21
- "node_modules/**"
22
- ]
23
- }