Sut up dev environment
This commit is contained in:
parent
a1b47a38cc
commit
cc2e81e648
14
.github/workflows/test.yaml
vendored
Normal file
14
.github/workflows/test.yaml
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
name: Test CI
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: "14"
|
||||
- run: npm install
|
||||
- run: npm test
|
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
node_modules/
|
||||
package-lock.json
|
||||
pnpm-lock.yaml
|
||||
/lib/
|
6
README.md
Normal file
6
README.md
Normal file
@ -0,0 +1,6 @@
|
||||
# HTML pagination
|
||||
|
||||

|
||||
|
||||
It is a plugin for HTML document pagination to fit fixed-sized container.
|
||||
This operation is rather time-consuming, so, please, use this module carefully.
|
7
jestconfig.json
Normal file
7
jestconfig.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"transform": {
|
||||
"^.+\\.(t|j)sx?$": "ts-jest"
|
||||
},
|
||||
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
|
||||
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"]
|
||||
}
|
22
package.json
22
package.json
@ -2,9 +2,19 @@
|
||||
"name": "html-pagination",
|
||||
"version": "1.0.0",
|
||||
"description": "Package for html document pagination to fit container with fixed width",
|
||||
"main": "index.js",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"files": [
|
||||
"./lib/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
"build": "tsc",
|
||||
"test": "jest --config jestconfig.json --passWithNoTests",
|
||||
"prepare": "npm run build",
|
||||
"prepublishOnly": "npm test && npm run lint",
|
||||
"preversion": "npm run lint",
|
||||
"version": "npm run format && git add -A src",
|
||||
"postversion": "git push && git push --tags"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -19,5 +29,11 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/dm1sh/html-pagination/issues"
|
||||
},
|
||||
"homepage": "https://github.com/dm1sh/html-pagination#readme"
|
||||
"homepage": "https://github.com/dm1sh/html-pagination#readme",
|
||||
"devDependencies": {
|
||||
"@types/jest": "^26.0.24",
|
||||
"jest": "^27.0.6",
|
||||
"ts-jest": "^27.0.4",
|
||||
"typescript": "^4.3.5"
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
export abstract class CacheInterface {
|
||||
export declare abstract class CacheInterface {
|
||||
abstract g(key: string): string;
|
||||
abstract s(key: string, value: string): void;
|
||||
}
|
||||
@ -15,7 +15,7 @@ declare function getPage(n: number): string;
|
||||
* @param container HTML element which will store content to display
|
||||
* @param cache Class implementing `g` and `s` methods for getting and setting elements of KV storage
|
||||
*/
|
||||
export function setup(
|
||||
export declare function setup(
|
||||
content: HTMLElement,
|
||||
container: HTMLElement,
|
||||
cache: CacheInterface
|
11
tsconfig.json
Normal file
11
tsconfig.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "commonjs",
|
||||
"declaration": true,
|
||||
"outDir": "./lib",
|
||||
"strict": true
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules", "**/__tests__/*"]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user