Skip to content

Commit

Permalink
feat: change output structure
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Sep 9, 2019
1 parent b0ee4b2 commit 2e8336d
Show file tree
Hide file tree
Showing 10 changed files with 350 additions and 28 deletions.
5 changes: 1 addition & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/index.*
!/index.ts
/test.*
!/test.ts
coverage
lib
CHANGELOG.md
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
*.log
*.tsbuildinfo
/index.*
!/index.ts
/test.*
!/test.ts
coverage
lib
node_modules
2 changes: 1 addition & 1 deletion codechecks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ checks:
- name: build-size-watcher
options:
files:
- path: 'index.*'
- path: 'lib/*.*'
- name: type-coverage-watcher
options:
ignoreCatch: true
Expand Down
2 changes: 0 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ module.exports = {
statements: 100,
},
},
moduleFileExtensions: ['ts', 'js'],
testMatch: ['**/test.ts'],
}
14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
"author": "JounQin <admin@1stg.me>",
"license": "MIT",
"files": [
"/index.*"
"lib"
],
"scripts": {
"build": "tsc -b",
"build:ts": "tsc -p src",
"build:bundle": "rollup -c node_modules/@1stg/rollup-config/module.js",
"build:bundle:min": "cross-env NODE_ENV=production yarn build:bundle",
"build": "run-p build:**",
"lint": "EFF_NO_LINK_RULES=true eslint . --ext js,md,ts -f friendly",
"test": "jest",
"prepublishOnly": "yarn build --force",
Expand All @@ -21,24 +24,29 @@
"@1stg/husky-config": "^0.3.0",
"@1stg/lint-staged": "^0.6.0",
"@1stg/prettier-config": "^0.2.0",
"@1stg/rollup-config": "^0.8.0",
"@1stg/tsconfig": "^0.5.0",
"@babel/core": "^7.6.0",
"@commitlint/cli": "^8.1.0",
"@commitlint/config-conventional": "^8.1.0",
"@types/jest": "^24.0.18",
"cross-env": "^5.2.1",
"eslint": "^6.3.0",
"eslint-formatter-friendly": "^7.0.0",
"husky": "^3.0.5",
"jest": "^24.9.0",
"lint-staged": "^9.2.5",
"npm-run-all": "^4.1.5",
"prettier": "^1.18.2",
"remark-preset-lint-consistent": "^2.0.3",
"remark-preset-lint-markdown-style-guide": "^2.1.3",
"remark-preset-lint-recommended": "^3.0.3",
"remark-preset-prettier": "^0.2.0",
"rollup": "^1.21.2",
"ts-jest": "^24.0.2",
"type-coverage": "^2.2.0",
"typescript": "^3.6.2"
"typescript": "^3.6.2",
"umd-globals": "link:."
},
"typeCoverage": {
"atLeast": 100
Expand Down
2 changes: 1 addition & 1 deletion index.ts → src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export const AS_IS_PKGS = [
'moment',
'rxjs',
// pkgs which has no umd module actually for now
'qrcode',
'tslib',
]

Expand Down Expand Up @@ -60,6 +59,7 @@ export const upperCamelCaseReducer = (

const GLOBALS = {
lodash: '_',
qrcode: 'QRCode',
qrious: 'QRious',
'react-dom': 'ReactDOM',
underscore: '_',
Expand Down
8 changes: 8 additions & 0 deletions src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"declarationDir": "../lib/types",
"importHelpers": false,
"outDir": "../lib/es"
}
}
2 changes: 1 addition & 1 deletion test.ts → test/test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import _, {
asIsReducer,
upperCamelCaseReducer,
getGlobals,
} from '.'
} from '../src'

describe('umd globals', () => {
it('default export and globals named export should be same exactly ', () =>
Expand Down
9 changes: 1 addition & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
{
"extends": "./node_modules/@1stg/tsconfig/tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"importHelpers": false,
"module": "commonjs",
"outDir": "."
},
"files": ["index.ts", "test.ts"]
"extends": "./node_modules/@1stg/tsconfig/tsconfig.json"
}

0 comments on commit 2e8336d

Please sign in to comment.