Skip to content

Commit

Permalink
Feedback to include declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
tristen committed Jun 30, 2022
1 parent aa961ea commit 4cef2cf
Show file tree
Hide file tree
Showing 9 changed files with 23,847 additions and 11 deletions.
4 changes: 0 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
*.log
coverage
.DS_Store
_batfish*
src/docs/data
src/docs/_site
pkg
src/test-cases-app/component-index.js
dist
**/*underreact.config.js
**/*babel.config.js
html.js
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ src/docs/data
pkg
src/test-cases-app/component-index.js
dist
tsconfig.tsbuildinfo
.vscode/launch.json
23,825 changes: 23,825 additions & 0 deletions index.d.ts

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "3.0.0-alpha.1",
"description": "UI components for Mapbox projects",
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"build-component-index": "rtk-index ./src/components ./src/test-cases-app/component-index.js",
"prestart": "npm run build-component-index",
Expand All @@ -15,7 +16,8 @@
"jest-watch": "jest --watch --verbose=false",
"format": "prettier --write '**/*.js'",
"lint": "eslint .",
"pretest": "npm run lint",
"tsc": "tsc",
"pretest": "npm run lint && npm run jest && npm run tsc",
"test": "jest",
"build": "scripts/build-module-indexes.js && scripts/build-package.js"
},
Expand Down
10 changes: 7 additions & 3 deletions scripts/build-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ function compileComponents() {

// Copy non-src files that we want in the package.
function copyFiles() {
return cpy(['LICENSE_Mapbox', 'CHANGELOG.md', 'README.md'], outputDir, {
cwd: rootDir
});
return cpy(
['LICENSE_Mapbox', 'CHANGELOG.md', 'README.md', 'index.d.ts'],
outputDir,
{
cwd: rootDir
}
);
}

// Create a package.json that is ready to be published.
Expand Down
6 changes: 4 additions & 2 deletions src/components/form/validators/validate-password.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ export default function validatePassword(value) {
''
) : (
<ul className="list-group">
{validations.map((listitem) => (
<li className="list-group-item">{listitem}</li>
{validations.map((listitem, i) => (
<li key={i} className="list-group-item">
{listitem}
</li>
))}
</ul>
);
Expand Down
1 change: 1 addition & 0 deletions src/docs/html.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-undef */
module.exports = `
<!DOCTYPE html>
<html lang="en">
Expand Down
1 change: 1 addition & 0 deletions src/test-cases-app/html.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-undef */
module.exports = `
<!DOCTYPE html>
<html lang='en'>
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"dom.iterable",
"esnext"
],
"emitDeclarationOnly": true,
"outFile": "index.d.ts",
"declaration": true,
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
Expand All @@ -16,7 +19,7 @@
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"isolatedModules": false,
"jsx": "react-jsx"
},
"include": [
Expand Down

0 comments on commit 4cef2cf

Please sign in to comment.