diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 8fcde36..ace1682 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -36,3 +36,8 @@ jobs: with: package: './packages/prettier-config/package.json' token: ${{ secrets.NPM_AUTH_TOKEN }} + - name: Publish tsconfig + uses: JS-DevTools/npm-publish@v1 + with: + package: './packages/tsconfig/package.json' + token: ${{ secrets.NPM_AUTH_TOKEN }} diff --git a/.versionrc b/.versionrc index 56f2535..536978a 100644 --- a/.versionrc +++ b/.versionrc @@ -19,6 +19,10 @@ { "filename": "packages/prettier-config/package.json", "type": "json" + }, + { + "filename": "packages/tsconfig/package.json", + "type": "json" } ] } diff --git a/docs/TODOS.md b/docs/TODOS.md index 3ee69c6..5653e36 100644 --- a/docs/TODOS.md +++ b/docs/TODOS.md @@ -2,5 +2,4 @@ - add stylelint configuration - add commitlint configuration -- add typescript configuration - add css reset diff --git a/packages/tsconfig/__tests__/index.js b/packages/tsconfig/__tests__/index.js new file mode 100644 index 0000000..5e0505e --- /dev/null +++ b/packages/tsconfig/__tests__/index.js @@ -0,0 +1,14 @@ +const test = require('tape') + +test('entry point parses', (t) => { + t.doesNotThrow(() => require('../tsconfig.base.json'), 'index does not throw') + t.doesNotThrow( + () => require('../tsconfig.react.json'), + 'index does not throw', + ) + t.doesNotThrow( + () => require('../tsconfig.react.dev.json'), + 'index does not throw', + ) + t.end() +}) diff --git a/packages/tsconfig/package.json b/packages/tsconfig/package.json new file mode 100644 index 0000000..543a4c6 --- /dev/null +++ b/packages/tsconfig/package.json @@ -0,0 +1,39 @@ +{ + "name": "@jdp-dev/tsconfig", + "version": "0.0.8", + "description": "My shareable TypeScript config.", + "private": false, + "homepage": "https://github.com/john-d-pelingo/jdp-scripts", + "author": { + "email": "johndarrylpelingo@gmail.com", + "name": "John Darryl Pelingo", + "url": "https://johndpelingo.com" + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/john-d-pelingo/jdp-scripts", + "directory": "packages/tsconfig" + }, + "bugs": { + "url": "https://github.com/john-d-pelingo/jdp-scripts/issues" + }, + "keywords": [ + "typescript", + "tsconfig" + ], + "main": "tsconfig.base.json", + "scripts": { + "prepublishOnly": "npm run test", + "test": "tape __tests__/*.js" + }, + "peerDependencies": { + "typescript": ">= 4.1" + }, + "dependencies": { + "typescript": "^4.1.2" + }, + "devDependencies": { + "tape": "^5.0.1" + } +} diff --git a/packages/tsconfig/tsconfig.base.json b/packages/tsconfig/tsconfig.base.json new file mode 100644 index 0000000..3c264a3 --- /dev/null +++ b/packages/tsconfig/tsconfig.base.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "allowJs": true, + "allowSyntheticDefaultImports": true, + "alwaysStrict": true, + "emitDecoratorMetadata": false, + "experimentalDecorators": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "importHelpers": true, + "isolatedModules": true, + "lib": ["ESNext", "DOM"], + "module": "esnext", + "moduleResolution": "node", + "noEmit": true, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "pretty": true, + "removeComments": true, + "resolveJsonModule": true, + "skipLibCheck": false, + "sourceMap": true, + "strict": true, + "stripInternal": true, + "target": "esnext" + }, + "exclude": ["node_modules"] +} diff --git a/packages/tsconfig/tsconfig.react.dev.json b/packages/tsconfig/tsconfig.react.dev.json new file mode 100644 index 0000000..44f1c37 --- /dev/null +++ b/packages/tsconfig/tsconfig.react.dev.json @@ -0,0 +1,6 @@ +{ + "extends": "tsconfig.react.json", + "compilerOptions": { + "jsx": "react-jsxdev" + } +} diff --git a/packages/tsconfig/tsconfig.react.json b/packages/tsconfig/tsconfig.react.json new file mode 100644 index 0000000..30d5e99 --- /dev/null +++ b/packages/tsconfig/tsconfig.react.json @@ -0,0 +1,6 @@ +{ + "extends": "tsconfig.base.json", + "compilerOptions": { + "jsx": "react-jsx" + } +}