-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c45dd23
commit 1c45c7c
Showing
17 changed files
with
9,728 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
language: node_js | ||
node_js: | ||
- '12' | ||
|
||
before_script: | ||
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter | ||
- chmod +x ./cc-test-reporter | ||
- ./cc-test-reporter before-build | ||
|
||
after_script: | ||
- ./cc-test-reporter format-coverage -t lcov ./coverage/lcov.info | ||
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT | ||
|
||
install: | ||
- yarn cache clean | ||
- yarn | ||
|
||
script: | ||
- yarn run build | ||
- yarn test:report | ||
|
||
deploy: | ||
provider: script | ||
skip_cleanup: true | ||
script: | ||
- npx semantic-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"preset": "ts-jest", | ||
"collectCoverage": true, | ||
"coveragePathIgnorePatterns": [ | ||
"types.ts" | ||
], | ||
"collectCoverageFrom": [ | ||
"<rootDir>/src/main/ts/**/*.ts" | ||
], | ||
"testMatch": [ | ||
"<rootDir>/src/test/ts/**/*.ts", | ||
"<rootDir>/src/test/js/**/*.js" | ||
], | ||
"testPathIgnorePatterns": [ | ||
"/node_modules/", | ||
"<rootDir>/src/test/stub" | ||
], | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"tsx", | ||
"js", | ||
"jsx", | ||
"json", | ||
"node" | ||
], | ||
"transform": { | ||
"^.+\\.(ts|tsx)$": "ts-jest" | ||
}, | ||
"globals": { | ||
"ts-jest": { | ||
"tsConfig": "tsconfig.test.json" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
{ | ||
"name": "@qiwi/license", | ||
"version": "0.0.0", | ||
"description": "QIWI OSS License", | ||
"source": "src/main/ts/index.ts", | ||
"main": "target/bundle/license.js", | ||
"module": "target/bundle/license.mjs", | ||
"unpkg": "target/bundle/license.umd.js", | ||
"types": "typings/index.d.ts", | ||
"typescript": { | ||
"definition": "typings/index.d.ts" | ||
}, | ||
"files": [ | ||
"README.md", | ||
"CHANGELOG.md", | ||
"target", | ||
"typings", | ||
"flow-typed" | ||
], | ||
"scripts": { | ||
"jest": "jest -w 2 --config=jest.config.json", | ||
"lint": "tslint -p tsconfig.test.json src/**/*.ts", | ||
"lint:fix": "yarn lint --fix", | ||
"test": "yarn lint && yarn jest", | ||
"clean": "rimraf target typings", | ||
"build": "yarn clean && yarn build:es5 && yarn build:es6 && yarn build:ts && yarn libdef && yarn docs && yarn uglify && yarn build:bundle", | ||
"build:es5": "mkdir -p target/es5 && tsc -p tsconfig.es5.json", | ||
"build:es6": "mkdir -p target/es6 && tsc -p tsconfig.es6.json", | ||
"build:ts": "cp -r src/main/ts/ target/ts/", | ||
"build:bundle": "microbundle build src/main/ts/index.ts -o target/bundle", | ||
"dtsgen": "dts-generator --project ./ --out typings/index.d.ts --prefix license/target/es5 --name license --main license/target/es5/index --moduleResolution node", | ||
"flowgen": "flowgen typings/index.d.ts --output-file flow-typed/index.flow.js", | ||
"libdef": "yarn dtsgen && yarn libdeffix && yarn flowgen", | ||
"libdeffix": "node -r esm ./src/gen/js/libdef-fix.js --dts=./typings/index.d.ts", | ||
"test:report": "yarn test && yarn push:report", | ||
"push:report": "yarn coveralls:push", | ||
"coveralls:push": "cat ./coverage/lcov.info | coveralls", | ||
"docs": "typedoc --readme README.md --tsconfig tsconfig.json src/main --ignoreCompilerErrors || exit 0", | ||
"uglify": "for f in $(find target -name '*.js'); do short=${f%.js}; terser -c -m -o $short.js -- $f; done", | ||
"postupdate": "yarn && yarn build && yarn test" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/qiwi/license.git" | ||
}, | ||
"keywords": [ | ||
"license", | ||
"oss", | ||
"mit" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/qiwi/license/issues" | ||
}, | ||
"homepage": "https://github.com/qiwi/license#readme", | ||
"dependencies": { | ||
"@qiwi/substrate": "^1.11.2", | ||
"lodash": "^4.17.15", | ||
"tslib": "^1.10.0" | ||
}, | ||
"devDependencies": { | ||
"@qiwi/semantic-release-gh-pages-plugin": "^1.10.6", | ||
"@semantic-release/changelog": "^3.0.4", | ||
"@semantic-release/git": "^7.0.16", | ||
"@semantic-release/github": "^5.4.3", | ||
"@semantic-release/npm": "^5.1.15", | ||
"@types/jest": "^24.0.18", | ||
"@types/jest-json-schema": "^1.2.1", | ||
"coveralls": "^3.0.6", | ||
"dts-generator": "^3.0.0", | ||
"eslint-plugin-typescript": "^0.14.0", | ||
"esm": "^3.2.25", | ||
"flowgen": "1.10.0", | ||
"jest": "^24.9.0", | ||
"lodash": "^4.17.15", | ||
"microbundle": "^0.12.0-next.3", | ||
"replace-in-file": "^4.1.3", | ||
"rimraf": "^3.0.0", | ||
"semantic-release": "^15.13.24", | ||
"terser": "^4.3.0", | ||
"ts-jest": "^24.0.2", | ||
"tslint": "^5.19.0", | ||
"tslint-config-qiwi": "^1.1.1", | ||
"typedoc": "^0.15.0", | ||
"typedoc-plugin-external-module-name": "^2.1.0", | ||
"typescript": "^3.6.2", | ||
"typescript-eslint-parser": "^22.0.0" | ||
}, | ||
"release": { | ||
"branch": "master", | ||
"verifyConditions": [ | ||
"@semantic-release/changelog", | ||
"@semantic-release/npm", | ||
"@semantic-release/git", | ||
"@qiwi/semantic-release-gh-pages-plugin" | ||
], | ||
"prepare": [ | ||
"@semantic-release/changelog", | ||
"@semantic-release/npm", | ||
"@semantic-release/git" | ||
], | ||
"publish": [ | ||
"@semantic-release/npm", | ||
"@semantic-release/github", | ||
"@qiwi/semantic-release-gh-pages-plugin" | ||
] | ||
}, | ||
"author": "QIWI <orensource@qiwi.com>", | ||
"contributors": [ | ||
"Anton Golub <a.golub@qiwi.com>", | ||
"Osipova Evgeniya <e.osipova@qiwi.com>" | ||
], | ||
"license": "MIT", | ||
"private": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"extends": [ | ||
"config:base" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import {resolve} from 'path' | ||
import { argv } from 'yargs' | ||
import assert from 'assert' | ||
import {sync as replaceSync} from 'replace-in-file' | ||
|
||
const {flow, dts} = argv | ||
const DTS = resolve(dts) | ||
const IMPORT_MAIN_PATTERN = /\timport main = require\('(.+)'\);/g | ||
const IMPORT_MAIN_LINE_PATTERN = /^\timport main = require\('(.+)'\);$/ | ||
const BROKEN_MODULE_NAME = /(declare module '.+\/target\/es5\/)[^/]*\/src\/main\/index'.+/ | ||
const REFERENCE = /\/\/\/.+/ | ||
|
||
assert(!!dts, ' `dts` file path should be specified') | ||
|
||
const options = { | ||
files: DTS, | ||
from: [ | ||
'\texport = main;', | ||
IMPORT_MAIN_PATTERN, | ||
BROKEN_MODULE_NAME, | ||
REFERENCE, | ||
/^\s*[\r\n]/gm | ||
], | ||
to: [ | ||
'', | ||
line => { | ||
const [, name] = IMPORT_MAIN_LINE_PATTERN.exec(line) | ||
return ` export * from '${name}';` | ||
}, | ||
line => { | ||
const [, module] = BROKEN_MODULE_NAME.exec(line) | ||
return `${module}index' {` | ||
}, | ||
'', | ||
'' | ||
], | ||
} | ||
|
||
const changes = replaceSync(options); | ||
console.log('Modified files:', changes); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const render = () => { /*noop*/ } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
describe('index', () => { | ||
it('', () => { | ||
expect(true).toBeTruthy() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"target": "es6", | ||
"outDir": "target/es6" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"target": "es5", | ||
"outDir": "target/es5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"compilerOptions": { | ||
"rootDir": "./src/main/ts/", | ||
"baseUrl": "./src/main/ts/", | ||
"moduleResolution": "node", | ||
"target": "es5", | ||
"lib": [ | ||
"esnext" | ||
], | ||
"strict": true, | ||
"sourceMap": false, | ||
"declaration": false, | ||
"noEmitHelpers": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"importHelpers": true, | ||
"allowSyntheticDefaultImports": true, | ||
"skipLibCheck": true, | ||
"resolveJsonModule": true, | ||
"experimentalDecorators": true, | ||
|
||
"incremental": true, | ||
"tsBuildInfoFile": "./buildcache/.tsbuildinfo" | ||
}, | ||
"include": [ | ||
"src/main/**/*" | ||
], | ||
"exclude": [ | ||
"node_modules", | ||
"src/test" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"include": [ | ||
"src/**/*" | ||
], | ||
"exclude": [ | ||
"node_modules" | ||
] | ||
} |
Oops, something went wrong.