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

splits core and app into separate packages, adds complete configuration for dev and production #69

Closed
wants to merge 9 commits into from
Closed
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
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build/
config/
dist/
scripts/
coverage/
31 changes: 31 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"env": {
"jest/globals": true
},
"extends": "airbnb",
"globals": {
"page": true,
"document": true
},
"parser": "babel-eslint",
"plugins": ["jest"],
"rules": {
"no-console": "off",
"import/no-named-export": 0,
"import/no-named-as-default": 0,
"import/prefer-default-export": 0,
"global-require": "off",
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"require-jsdoc": ["error", {
"require": {
"FunctionDeclaration": true,
"MethodDefinition": true,
"ClassDeclaration": true,
"ArrowFunctionExpression": true,
"FunctionExpression": true
}
}],
"react/prefer-stateless-function": "off",
"react/destructuring-assignment": [0, "never"]
}
}
28 changes: 27 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
.DS_Store
# dependencies
node_modules/
/.pnp
.pnp.js
package-lock.json

# testing
coverage
*.mp4
e2e-results.xml

# production
lib
build
dist

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

.idea
24 changes: 22 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
language: node_js
node_js:
- 'node'
- "node"
cache:
npm: true
directories:
- ~/.cache
before_script:
- cd minimal_redux_poc
- npm install
- cd packages/mirador3-core
- npm install
- cd ../mirador3-common
- npm install
- cd ../mirador3-app-base
- npm install
- cd ../..
- lerna run build --ignore=mirador3-e2e-tests
- lerna run lib
- cd packages/mirador3-e2e-tests
- npm install
- npm run build
script:
- cd ../..
- lerna run test --stream
- cd packages/mirador3-e2e-tests
- npm run cypress:record
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
# research-and-demos
Proofs of concept for Mirador 3

1. git clone the repository
2. Navigate to the relevant POC, for example, `cd minimal_redux_poc`
3. Follow the README for that POC.
## lerna
lerna helps manage the Mirador3 "monorepo"

### using lerna

#### `$ lerna bootstrap`

Link local packages together and installs package dependencies

#### `$ lerna run build`

build production packages

#### `$ lerna run start`

start the development mode application

#### `$ lerna run test`

lints and runs tests (use with --stream to see output)

#### `$ lerna run test:coverage`

runs test with coverage
6 changes: 6 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"packages": [
"packages/*"
],
"version": "independent"
}
54 changes: 38 additions & 16 deletions minimal_redux_poc/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions minimal_redux_poc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"sass-loader": "^7.1.0"
},
"devDependencies": {
"@babel/code-frame": "^7.0.0",
"@babel/core": "^7.2.0",
"@babel/preset-env": "^7.2.0",
"@babel/preset-react": "^7.0.0",
Expand Down
17 changes: 17 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "root",
"private": true,
"devDependencies": {
"babel-eslint": "9.0.0",
"eslint": "^5.9.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-react-app": "^3.0.5",
"eslint-loader": "^2.1.1",
"eslint-plugin-flowtype": "2.50.1",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jest": "^22.1.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-react": "^7.11.1",
"lerna": "^3.4.3"
}
}
6 changes: 6 additions & 0 deletions packages/mirador3-app-base/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build/
config/
dist/
scripts/
coverage/
lib/
13 changes: 13 additions & 0 deletions packages/mirador3-app-base/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2018 The Board of Trustees of the Leland Stanford Junior University

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
34 changes: 34 additions & 0 deletions packages/mirador3-app-base/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.<br>
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br>
You will also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.<br>
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.<br>
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.<br>
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).
Loading