Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup TypeScript: Emit d.ts files #345

Merged
merged 6 commits into from
Nov 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,18 @@
"storybook": "start-storybook -s ./node_modules/@salesforce-ux/design-system -p 9001 -c .storybook",
"test": "npm-run-all type-check test:jest test:storyshots",
"test:storyshots": "NODE_ENV=test jest test/storyshots/*.test.js",
"test:jest": "jest test/*-spec.js test/*-spec.tsx",
"test:jest": "jest test/*-spec.tsx",
"prepublish": "npm run build",
"type-check": "tsc --noEmit",
"type-check:watch": "npm run type-check -- --watch",
"format": "npm run lint:src -- --fix && npm run lint:stories -- --fix && npm run lint:test -- --fix",
"lint": "npm run lint:src && npm run lint:stories && npm run lint:test",
"lint:src": "eslint --ext .js,.jsx,.ts,.tsx src/scripts/**",
"lint:stories": "eslint --ext .js,.jsx,.ts,.tsx stories/**",
"lint:test": "eslint --ext .js,.jsx,.ts,.tsx test/**",
"build": "babel -d lib/ src/ --extensions \".js,.ts,.tsx\"",
"lint:src": "eslint --ext .ts,.tsx src/scripts/**",
"lint:stories": "eslint --ext .ts,.tsx stories/**",
"lint:test": "eslint --ext .js,.ts,.tsx test/**",
"build": "npm run build:src && npm run build:types",
"build:src": "babel -d lib/ src/ --extensions \".ts,.tsx\"",
"build:types": "tsc -p tsconfig.types.json",
"build:assets": "cp -r node_modules/@salesforce-ux/design-system/assets public",
"build:storybook": "build-storybook -o public",
"deploy": "npm-run-all build:storybook build:assets deploy:ghpage",
Expand Down Expand Up @@ -79,7 +81,6 @@
"@types/storybook__addon-knobs": "^5.0.0",
"@types/storybook__react": "^4.0.1",
"@types/svg4everybody": "^2.1.1",
"@types/uuid": "^3.4.4",
"@typescript-eslint/eslint-plugin": "^1.5.0",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/AutoAlign.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export function autoAlign(options: AutoAlignOptions) {
type ResultProps = TOriginalProps & AutoAlignProps;

return class extends React.Component<ResultProps, AutoAlignState> {
private pid: number | null = null;
pid: number | null = null;

/* eslint-disable react/sort-comp */
node: any;
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"target": "esnext", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
"allowJs": true, /* Allow javascript files to be compiled. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
"jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
"declaration": false, /* Generates corresponding '.d.ts' file. */
// "declaration": true, /* Generates corresponding '.d.ts' file. */
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
Expand Down
11 changes: 11 additions & 0 deletions tsconfig.types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true,
"rootDir": "src"
},
"include": [
"src/**/*"
]
}
1 change: 1 addition & 0 deletions types/uuid.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module 'uuid';
7 changes: 0 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1870,13 +1870,6 @@
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e"
integrity sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ==

"@types/uuid@^3.4.4":
version "3.4.4"
resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-3.4.4.tgz#7af69360fa65ef0decb41fd150bf4ca5c0cefdf5"
integrity sha512-tPIgT0GUmdJQNSHxp0X2jnpQfBSTfGxUMc/2CXBU2mnyTFVYVa2ojpoQ74w0U2yn2vw3jnC640+77lkFFpdVDw==
dependencies:
"@types/node" "*"

"@types/vfile-message@*":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@types/vfile-message/-/vfile-message-1.0.1.tgz#e1e9895cc6b36c462d4244e64e6d0b6eaf65355a"
Expand Down