Skip to content

Commit 5cc1fc6

Browse files
committed
added first services/models
1 parent 05c4d3a commit 5cc1fc6

33 files changed

+3417
-1
lines changed

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Compiled class file
2+
*.class
3+
4+
# Log file
5+
*.log
6+
7+
# BlueJ files
8+
*.ctxt
9+
10+
# Mobile Tools for Java (J2ME)
11+
.mtj.tmp/
12+
13+
# Package Files #
14+
*.jar
15+
*.war
16+
*.nar
17+
*.ear
18+
*.zip
19+
*.tar.gz
20+
*.rar
21+
22+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23+
hs_err_pid*
24+
replay_pid*
25+
26+
node_modules

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
11
# js-common
2-
common Javascript code for frontend development
2+
A JavaScript library that provides essential utilities and reusable components to simplify development and enhance interaction with MyCoRe-based applications.
3+
4+
## Add package
5+
### npm/yarn environment
6+
```
7+
npx jsr add @mycore/js-common
8+
```
9+
10+
## Usage example
11+
```ts
12+
import { LangService } from '@mycore/js-common/i18n';
13+
14+
const langService = new LangService(BASE_URL);
15+
console.log(langService.getLanguages());
16+
```
17+

eslint.config.mjs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import eslint from '@eslint/js';
2+
import globals from 'globals';
3+
import tseslint from 'typescript-eslint';
4+
import jsdoc from 'eslint-plugin-jsdoc';
5+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
6+
7+
export default tseslint.config(
8+
{
9+
ignores: ['dist/', 'node_modules/'],
10+
},
11+
eslint.configs.recommended,
12+
{
13+
files: ['src/**/*.ts'],
14+
extends: [
15+
...tseslint.configs.recommendedTypeChecked,
16+
...tseslint.configs.strictTypeChecked,
17+
jsdoc.configs["flat/recommended-typescript"]
18+
],
19+
plugins: {
20+
'@typescript-eslint': tseslint.plugin,
21+
},
22+
languageOptions: {
23+
globals: globals.browser,
24+
ecmaVersion: 'latest',
25+
sourceType: 'module',
26+
parserOptions: {
27+
project: true,
28+
},
29+
},
30+
rules: {
31+
"jsdoc/require-description": 1,
32+
},
33+
},
34+
{
35+
languageOptions: {
36+
globals: globals.browser,
37+
},
38+
},
39+
eslintPluginPrettierRecommended
40+
);

jsr.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "@mycore-test/js-common",
3+
"version": "0.1.26",
4+
"exports": {
5+
"./i18n": "./src/i18n/index.ts",
6+
"./access-key": "./src/access-key/index.ts",
7+
"./auth": "./src/auth/index.ts",
8+
"./orcid": "./src/orcid/index.ts",
9+
"./utils/cache": "./src/utils/cache/index.ts",
10+
"./utils/errors": "./src/utils/errors/index.ts",
11+
"./utils/http": "./src/utils/http/index.ts"
12+
},
13+
"publish": {
14+
"include": [
15+
"src/**/*.ts",
16+
"README.md"
17+
]
18+
}
19+
}
20+

package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "js-common",
3+
"version": "0.1.23",
4+
"description": "A common Javascript code for MyCoRe development",
5+
"repository": "https://github.com/MyCoRe-Org/js-common.git",
6+
"author": "MyCoRe",
7+
"license": "GPL-3.0",
8+
"scripts": {
9+
"test-publish": "jsr publish --dry-run",
10+
"lint": "eslint src --max-warnings 0"
11+
},
12+
"devDependencies": {
13+
"@eslint/js": "^9.16.0",
14+
"@typescript-eslint/eslint-plugin": "^8.17.0",
15+
"@typescript-eslint/parser": "^8.17.0",
16+
"eslint": "^9.16.0",
17+
"eslint-config-prettier": "^10.0.1",
18+
"eslint-plugin-jsdoc": "^50.6.3",
19+
"eslint-plugin-prettier": "^5.2.3",
20+
"globals": "^15.13.0",
21+
"jsr": "^0.13.2",
22+
"prettier": "^3.4.2",
23+
"typescript": "^5.7.2",
24+
"typescript-eslint": "^8.17.0"
25+
},
26+
"dependencies": {}
27+
}

prettier.config.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export default {
2+
semi: true,
3+
singleQuote: true,
4+
printWidth: 80,
5+
trailingComma: 'es5',
6+
tabWidth: 2,
7+
useTabs: false,
8+
endOfLine: 'auto',
9+
arrowParens: 'avoid',
10+
bracketSpacing: true,
11+
bracketSameLine: false,
12+
};

0 commit comments

Comments
 (0)