Skip to content

Commit

Permalink
Compile package into JavaScript and remove extraneous files
Browse files Browse the repository at this point in the history
  • Loading branch information
Annabelle Thomas Taylor committed Mar 12, 2021
1 parent c14a7b4 commit fd46195
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 69 deletions.
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

53 changes: 28 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"author": "MAPC Digital Services",
"version": "0.2.2",
"private": false,
"main": "src/index.tsx",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"/src/index.tsx",
"/src/components",
"/src/assets"
"/dist"
],
"license": "CDDL-1.0",
"babel": {
"presets": [
"react-app",
"@babel/preset-react"
],
"plugins": [
Expand All @@ -21,36 +21,19 @@
"loose": true
}
]
],
"ignore": [
"./src/stories", "./src/assets"
]
},
"dependencies": {
"@emotion/react": "^11.1.4",
"@fortawesome/fontawesome-svg-core": "^1.2.34",
"@fortawesome/free-brands-svg-icons": "^5.15.2",
"@fortawesome/free-solid-svg-icons": "^5.15.2",
"@fortawesome/react-fontawesome": "^0.1.14",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/jest": "^26.0.15",
"@types/node": "^12.0.0",
"@types/react": "^16.9.53",
"@types/react-dom": "^16.9.8",
"mapbox-gl": "^2.1.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-scripts": "4.0.1",
"typescript": "^4.0.3",
"web-vitals": "^0.2.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"storybook": "start-storybook -p 6006 -s public",
"build-storybook": "build-storybook -o docs -s ./src/assets",
"compile": "rm -rf dist && mkdir dist && yarn autoclean && babel src/components src/assets --out-dir dist --copy-files --ignore __tests__,spec.js,test.js,stories.js,__snapshots__"
"compile": "tsc && rm -rf dist && mkdir dist && NODE_ENV=production babel src --out-dir dist --extensions .ts,.tsx && mkdir -p ./dist/assets/images && cp -a ./src/assets/images ./dist/assets/"
},
"eslintConfig": {
"extends": [
Expand All @@ -70,6 +53,26 @@
"last 1 safari version"
]
},
"dependencies": {
"@emotion/react": "^11.1.4",
"@fortawesome/fontawesome-svg-core": "^1.2.34",
"@fortawesome/free-brands-svg-icons": "^5.15.2",
"@fortawesome/free-solid-svg-icons": "^5.15.2",
"@fortawesome/react-fontawesome": "^0.1.14",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/jest": "^26.0.15",
"@types/node": "^12.0.0",
"@types/react": "^16.9.53",
"@types/react-dom": "^16.9.8",
"mapbox-gl": "^2.1.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-scripts": "4.0.1",
"typescript": "^4.0.3",
"web-vitals": "^0.2.4"
},
"devDependencies": {
"@babel/cli": "^7.12.10",
"@babel/preset-react": "^7.12.10",
Expand Down
File renamed without changes.
15 changes: 15 additions & 0 deletions src/images.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
declare module "*.png" {
const value: string;
export default value;
}

declare module "*.svg" {
const value: string;
export default value;
}

declare module "*.jpg" {
const value: string;
export default value;
}

1 change: 0 additions & 1 deletion src/react-app-env.d.ts

This file was deleted.

15 changes: 0 additions & 15 deletions src/reportWebVitals.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/setupTests.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/stories/Map.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Layer } from '../components/maps/Layer';
import { Source } from '../components/maps/Source';
import { Tooltip } from '../components/maps/Tooltip';
import { MapLegend } from '../components/maps/MapLegend';
import { data } from '../assets/WasteWaterData';
import { data } from '../assets/data/WasteWaterData';

export default {
title: 'Maps/Basemap',
Expand Down
30 changes: 11 additions & 19 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"declaration": true,
"esModuleInterop": true,
"jsx": "react",
"lib": ["dom", "es2015"],
"moduleResolution": "node",
"outDir": "./dist",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
"sourceMap": true,
"strict": true,
"target": "es2019",
"types": ["@emotion/core"]
},
"include": [
"src"
]
"include": ["src"],
"exclude": ["src/stories", "src/assets"]
}

0 comments on commit fd46195

Please sign in to comment.