Package initialization

master
Tudor Stanciu 2023-02-07 00:32:31 +02:00
commit 3078492800
11 changed files with 6784 additions and 0 deletions

23
.gitignore vendored Normal file
View File

@ -0,0 +1,23 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
node_modules
# builds
build
lib
dist
.rpt2_cache
# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
example/package-lock.json

2
.npmrc Normal file
View File

@ -0,0 +1,2 @@
//lab.code-rove.com/:_authToken=${OWN_NPM_TOKEN}
@flare:registry=https://lab.code-rove.com/public-node-registry

6
.prettierrc Normal file
View File

@ -0,0 +1,6 @@
{
"arrowParens": "avoid",
"printWidth": 160,
"trailingComma": "none",
"singleQuote": false
}

26
README.md Normal file
View File

@ -0,0 +1,26 @@
# Tuitio connector
## Introduction
Tuitio connector is an npm package written in typescript that facilitates the integration of a react application with [Tuitio](https://lab.code-rove.com/gitea/tudor.stanciu/tuitio).
## Package installation
The package installation can be done in two ways:
- from the command line: `npm install @flare/tuitio-connector@1.0.0`
- from the package.json file: `"@flare/tuitio-connector": "1.0.0"`
## How to use the package
TO DO
## Unit testing
Unit testing is done using [Jest](https://jestjs.io/). This is an awesome testing framework created by Facebook.
The files containing tests are identified by the extension `*.test.ts`.
All tests in the package can be executed by running: `npm test`.
## Changelog
1.0.0 - Package initialization

7
jestconfig.json Normal file
View File

@ -0,0 +1,7 @@
{
"transform": {
"^.+\\.(t|j)sx?$": "ts-jest"
},
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"]
}

6637
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

50
package.json Normal file
View File

@ -0,0 +1,50 @@
{
"name": "@flare/tuitio-connector",
"version": "1.0.0",
"description": "Tuitio connector",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"scripts": {
"build": "tsc",
"test": "jest --config jestconfig.json",
"format": "prettier --write \"src/**/*.ts\"",
"lint": "tslint -p tsconfig.json",
"prepublishOnly": "npm test && npm run lint",
"prepush": "npm run build",
"preversion": "npm run lint",
"version": "npm run format && git add -A src",
"push": "npm publish",
"push:major": "npm run version:major && npm run push",
"push:minor": "npm run version:minor && npm run push",
"push:patch": "npm run version:patch && npm run push",
"version:major": "npm version major --no-git-tag-version",
"version:minor": "npm version minor --no-git-tag-version",
"version:patch": "npm version patch --no-git-tag-version"
},
"repository": {
"type": "git",
"url": "https://lab.code-rove.com/gitea/bricks/tuitio-connector.git"
},
"keywords": [
"flare",
"tuitio-connector"
],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://lab.code-rove.com/gitea/bricks/tuitio-connector/issues"
},
"homepage": "https://lab.code-rove.com/gitea/bricks/tuitio-connector#readme",
"files": [
"lib/**/*"
],
"devDependencies": {
"@types/jest": "^29.4.0",
"jest": "^29.4.1",
"prettier": "^2.8.3",
"ts-jest": "^29.0.5",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
"typescript": "^4.9.5"
}
}

View File

@ -0,0 +1,11 @@
import { sum } from "../index";
test("Test 1", () => {
const result = sum(1, 1);
expect(result).toBe(2);
});
test("Test 2", () => {
const result = sum(99, 101);
expect(result).toBe(200);
});

1
src/index.ts Normal file
View File

@ -0,0 +1 @@
export const sum = (n1: number, n2: number) => n1 + n2;

18
tsconfig.json Normal file
View File

@ -0,0 +1,18 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"declaration": true,
"outDir": "./lib",
"jsx": "react",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"allowJs": false,
"noUnusedLocals": true,
"noUnusedParameters": true
},
"include": ["./src"],
"exclude": ["node_modules", "**/__tests__/*"]
}

3
tslint.json Normal file
View File

@ -0,0 +1,3 @@
{
"extends": ["tslint:recommended", "tslint-config-prettier"]
}