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

Check in dist node v4.9.1 #81

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
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
30 changes: 15 additions & 15 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
node-version: [12.x, 16.x]
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand All @@ -25,17 +25,17 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run lint
- run: npm run lint:es6
- run: npm run test:ci

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- run: npm run build:production
- run: npm run test
- run: npm run test:ci
cache: 'yarn'
- run: yarn ci
#- run: yarn lint
#- run: yarn lint:es6
- run: yarn test:ci

#- name: Coveralls
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}

# - run: yarn build:production
# - run: yarn test
# - run: yarn test:ci
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ignore compiled handlebars
release
compiled_handlebars.js
*.handlebars.js
public/bundle.css
# release
# compiled_handlebars.js
# *.handlebars.js
# public/bundle.css

#ignore private config files
config/production.js
Expand All @@ -21,7 +21,7 @@ proguard.cfg

node_modules
gen
dist
# dist
.tmp

# Node #
Expand Down
6 changes: 6 additions & 0 deletions dist/app.css

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

6 changes: 6 additions & 0 deletions dist/public/app.8a32e1bf.css

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

6 changes: 6 additions & 0 deletions dist/public/public/app.8a32e1bf.8a32e1bf.css

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

30 changes: 30 additions & 0 deletions dist/public/public/server-build/app.8f31858a.ce853e96.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import 'babel-polyfill'
import { browserHistory } from 'react-router'
import Immutable from 'immutable'
import { Provider } from 'react-redux'
import React from 'react'
import ReactDOM from 'react-dom'

import configureStore from './components/App/store.cd39673d.55138e2a'
import createRoutes from './components/App/routes.55e1d219.55e1d219'

let reduxState = {}
if (window.__REDUX_STATE__) {
try {
let plain = window.__REDUX_JSON__ = JSON.parse(unescape(window.__REDUX_STATE__))
Object.keys(plain).forEach((key) => {
const val = plain[key]
reduxState[key] = Immutable.fromJS(val)
})
} catch (e) {
console.error(e)
}
}

const store = configureStore(reduxState)

ReactDOM.render((
<Provider store={store}>
{ createRoutes(browserHistory) }
</Provider>
), document.getElementById('root'))
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { connect } from 'react-redux'
import { FieldDBObject } from 'fielddb/api/FieldDBObject'
import Helmet from 'react-helmet'
import Q from 'q'
import React, { Component } from 'react'

FieldDBObject.todo = function () {}
FieldDBObject.warn = function () {}
FieldDBObject.confirm = function (message, optionalLocale) {
const deferred = Q.defer()
console.warn('Not confirming: ', message)
deferred.reject({
message: message,
optionalLocale: optionalLocale,
response: null
})
return deferred.promise
}
FieldDBObject.prompt = function (message, optionalLocale, providedInput) {
const deferred = Q.defer()
console.warn('Not prompting: ', message)
deferred.reject({
message: message,
optionalLocale: optionalLocale,
response: null
})
return deferred.promise
}

class App extends Component {
render () {
return (
<div>
<Helmet
defaultTitle='LingSync.org'
titleTemplate='%s - LingSync.org'
meta={[
{
'name': 'description',
'content': 'Public pages for LingSync.org corpora'
},
{
'name': 'keywords',
'content': 'Lingusitics, Fieldwork, Corpus, LingSync, Database, OpenSoure, XML, JSON'
}
]}
htmlAttributes={{
'lang': 'en'
}}
/>
{this.props.children}
</div>
)
}
}

App.propTypes = {
children: React.PropTypes.object.isRequired
}

function mapStateToProps (state) {
return {}
}

export default connect(mapStateToProps)(App)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { combineReducers } from 'redux'

import corpora from '../Corpora/reducer.a73b209e.cbc08383'
import corpusMaskDetail from '../CorpusMask/reducer.a2f91f7e.89940f0f'
import userMaskDetail from '../UserMask/reducer.301b46b4.2b496824'
import searchResults from '../Search/reducer.b87d5ff2.06816636'

const rootReducer = combineReducers({
corpora,
corpusMaskDetail,
userMaskDetail,
searchResults
})

export default rootReducer
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react'
import { Router, Route } from 'react-router'

import App from '../App'
import Corpora from '../Corpora'
import CorpusMaskContainer from '../CorpusMask'
import UserMaskContainer from '../UserMask'
import SearchContainer from '../Search'

export default function (history) {
return (
<Router history={history}>
<Route path='/' component={App}>
<Route path='corpora' component={Corpora} />
<Route path=':username' component={UserMaskContainer} />
<Route path=':username/' component={UserMaskContainer} />
<Route path=':teamname/:dbname' component={CorpusMaskContainer} />
<Route path=':teamname/:dbname/' component={CorpusMaskContainer}>
<Route path='search' component={SearchContainer} />
<Route path='search/:searchIn' component={SearchContainer} />
</Route>
</Route>
</Router>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { createStore, applyMiddleware } from 'redux'
import createLogger from 'redux-logger'
import thunkMiddleware from 'redux-thunk'

import apiMiddleware from '../../middleware/api.cab420cd.cab420cd'
import rootReducer from './reducer.b8c8f420.d097d80f'

const logger = createLogger({
level: 'info',
collapsed: false,
logger: console,
predicate: (getState, action) => true
})

let middlewares = [
thunkMiddleware,
apiMiddleware
]

if (process.env.NODE_ENV !== 'production') {
middlewares = [...middlewares, logger]
}

const createStoreWithMiddleware = applyMiddleware(
...middlewares
)(createStore)

export default function configureStore (initialState) {
const store = createStoreWithMiddleware(rootReducer, initialState)

if (module.hot) {
// Enable Webpack hot module replacement for reducers
module.hot.accept('./reducer.b8c8f420.d097d80f', () => {
const nextRootReducer = require('./reducer.b8c8f420.d097d80f')
store.replaceReducer(nextRootReducer)
})
}

return store
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import React, { Component } from 'react'
import { Link } from 'react-router'
import { List } from 'immutable'

class Corpora extends Component {
render () {
return (
<div className={this.props.className}>
<h1>Corpora</h1>
{
this.props.corpora.map((connection) => {
let website = connection.get('website') || ''
if (connection.get('searchKeywords')) {
website = `${website}/search/${connection.get('searchKeywords')}`
} else {
website = `${website}/search`
}
return (
<div className='media' key={connection.get('dbname')}>
<Link to={website} className='pull-left'>
<img src={'https://secure.gravatar.com/avatar/' + connection.get('gravatar') + '.jpg?s=96&d=retro&r=pg'} alt='Corpus image' className='media-object' />
</Link>
<div className='media-body'>
<h4 className='media-heading'>
<Link to={website}>
{connection.get('title')}
</Link>
</h4>
<p>{connection.get('description')}</p>
</div>
</div>
)
})
}
</div>
)
}
}

Corpora.propTypes = {
corpora: React.PropTypes.instanceOf(List).isRequired,
className: React.PropTypes.string.isRequired
}

export default Corpora
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import Immutable from 'immutable'
import { Link } from 'react-router'
import React from 'react'
import { shallow } from 'enzyme'

import Corpora from './Corpora.ae1ec4c6.ae1ec4c6.jsx'

describe('Component::Corpora', function () {
let props
beforeEach(function () {
props = {
corpora: Immutable.fromJS([
{
dbname: 1,
title: 'the title 1',
website: 'https://example.org'
},
{
dbname: 2,
title: 'the title 2',
searchKeywords: 'morphemes:nay OR gloss:caus'
},
{
dbname: 3,
title: 'the title 3'
}
])
}
})
function renderDoc () {
return shallow(<Corpora {...props} />)
}

it('renders corpora', function () {
let doc = renderDoc()
let corpusMaskComps = doc.find(Link)

expect(corpusMaskComps.length).to.equal(props.corpora.size * 2)
expect(corpusMaskComps.nodes[0].props.to).to.equal('https://example.org/search')
expect(corpusMaskComps.nodes[1].props.children).to.equal('the title 1')

expect(corpusMaskComps.nodes[2].props.to).to.equal('/search/morphemes:nay OR gloss:caus')
expect(corpusMaskComps.nodes[3].props.children).to.equal('the title 2')
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import Immutable from 'immutable'
import React from 'react'
import { shallow } from 'enzyme'

import Corpora from './Corpora.ae1ec4c6.ae1ec4c6.jsx'
import { CorpusMaskContainer } from './index.f8ab0cb7.d66c11eb.jsx'

describe('Container::Corpora', function () {
let props
beforeEach(function () {
props = {
loadCorpora: sinon.stub(),
corpora: Immutable.fromJS([
{
dbname: 1,
title: 'corpusMask title 1'
},
{
dbname: 2,
title: 'corpusMask title 1'
}
])
}
})

it('renders Corpora with corpora in props', function () {
let doc = shallow(<CorpusMaskContainer {...props} />)
let corporaComp = doc.find(Corpora)

expect(corporaComp.props().corpora).to.equal(props.corpora)
})
})
Loading