Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
[#167163350] front end setup
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudify committed Jul 23, 2019
2 parents f133c76 + d191eda commit 791a5ca
Show file tree
Hide file tree
Showing 14 changed files with 4,416 additions and 321 deletions.
25 changes: 25 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
"roots": [
"<rootDir>/src"
],
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
],
"testEnvironment": "jsdom",

// Setup Enzyme
"snapshotSerializers": ["enzyme-to-json/serializer"],
"setupFilesAfterEnv": ["<rootDir>/setupEnzyme.ts"],
"moduleNameMapper": {
".+\\.(css|scss)$": "<rootDir>/styleMock.ts"
},
};
51 changes: 31 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,58 @@
{
"name": "TODO",
"name": "io-onboarding-pa-fe",
"version": "0.0.1",
"description": "TODO",
"description": "io-onboarding-pa-fe",
"repository": "https://github.com/teamdigitale/TODO",
"author": "https://teamdigitale.governo.it",
"license": "MIT",
"scripts": {
"start": "parcel ./public/index.html",
"prebuild": "rimraf dist",
"build": "tsc",
"build": "parcel build ./public/index.html --public-url /",
"postversion": "git push && git push --tags",
"test": "jest",
"lint": "tslint --project ."
},
"devDependencies": {
"@types/enzyme": "^3.1.12",
"@types/enzyme-adapter-react-16": "^1.0.2",
"@types/jest": "^24.0.13",
"@types/node": "10.14.1",
"@types/react": "16.8.23",
"@types/react-dom": "16.8.4",
"@types/react-router-dom": "^4.3.4",
"@types/react-test-renderer": "^16.8.2",
"@types/reactstrap": "^8.0.1",
"danger": "^8.0.0",
"danger-plugin-digitalcitizenship": "*",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"enzyme-to-json": "^3.3.4",
"italia-tslint-rules": "*",
"jest": "^24.8.0",
"parcel-bundler": "^1.12.3",
"prettier": "^1.12.1",
"react-test-renderer": "^16.8.6",
"rimraf": "^2.6.2",
"ts-jest": "^24.0.2",
"tslint": "^5.1.0",
"typescript": "^3.5.0"
"typescript": "^3.5.0",
"sass": "^1.22.4"
},
"dependencies": {
"@coreui/coreui": "^2.1.12",
"@coreui/coreui-plugin-chartjs-custom-tooltips": "^1.3.1",
"@coreui/icons": "0.3.0",
"@coreui/react": "^2.5.1",
"bootstrap": "^4.3.1",
"bootstrap-italia": "^1.3.2",
"chart.js": "^2.8.0",
"fp-ts": "1.12.0",
"io-ts": "1.8.5"
},
"jest": {
"testEnvironment": "node",
"collectCoverage": true,
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
"moduleFileExtensions": [
"js",
"json",
"jsx",
"node",
"ts",
"tsx"
],
"preset": "ts-jest",
"testMatch": null
"io-ts": "1.8.5",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-router-config": "^5.0.1",
"react-router-dom": "^5.0.1",
"reactstrap": "^8.0.0"
}
}
14 changes: 14 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Onboarding PA</title>
</head>
<body>
<div id="root"></div>
<script src="../src/index.tsx"></script>
</body>
</html>
4 changes: 4 additions & 0 deletions setupEnzyme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { configure } from "enzyme";
import EnzymeAdapter from "enzyme-adapter-react-16";

configure({ adapter: new EnzymeAdapter() });
7 changes: 7 additions & 0 deletions src/App.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Styles
// CoreUI Icons Set
@import '../node_modules/@coreui/icons/css/coreui-icons.css';
// Bootstrap italia
@import '../node_modules/bootstrap-italia/dist/css/bootstrap-italia.min.css';
// Import Main styles for this applicationsc
@import './scss/style';
11 changes: 11 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as React from "react";

import "./App.scss";

export const App: React.FC = () => {
return (
<div className="App">
<h1 className="primary-bg white-color">Piattaforma Onboard PA</h1>
</div>
);
};
8 changes: 8 additions & 0 deletions src/__tests__/App.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { shallow } from "enzyme";
import * as React from "react";
import { App } from "../App";

it("mounts without crashing", () => {
const wrapper = shallow(<App />);
wrapper.unmount();
});
5 changes: 0 additions & 5 deletions src/__tests__/index.test.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/index.ts

This file was deleted.

5 changes: 5 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import * as React from "react";
import { render } from "react-dom";
import { App } from "./App";

render(<App />, document.getElementById("root"));
6 changes: 6 additions & 0 deletions src/scss/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Import styles
@import "../../node_modules/@coreui/coreui/scss/coreui";

// TODO: Temp fix for reactstrap
// https://www.pivotaltracker.com/story/show/167402768 to keep track
@import '../../node_modules/@coreui/coreui/scss/dropdown-menu-right';
1 change: 1 addition & 0 deletions styleMock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {};
6 changes: 4 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
"strict": true,
"noImplicitAny": true,
"declaration": true,
"sourceMap": true
"sourceMap": true,
"esModuleInterop": true,
"jsx": "react"
},
"lib": [],
"lib": ["dom"],
"include": [
"src/**/*"
],
Expand Down
Loading

0 comments on commit 791a5ca

Please sign in to comment.