Skip to content

Commit

Permalink
OM-78: use fe-template
Browse files Browse the repository at this point in the history
  • Loading branch information
olewandowski1 committed Nov 24, 2023
1 parent d91408c commit db2dff9
Show file tree
Hide file tree
Showing 10 changed files with 839 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
["@babel/preset-env", {
"modules": false
}],
["@babel/preset-react"]
],
"plugins": [
"@babel/plugin-transform-runtime",
"@babel/plugin-proposal-class-properties"
]
}
23 changes: 23 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"parser": "babel-eslint",
"extends": [
"standard",
"standard-react"
],
"env": {
"es6": true
},
"plugins": [
"react"
],
"parserOptions": {
"sourceType": "module"
},
"rules": {
// don't force es6 functions to include space before paren
"space-before-function-paren": 0,

// allow specifying true explicitly for boolean props
"react/jsx-boolean-value": 0
}
}
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
node_modules

# builds
build
dist
.rpt2_cache

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

npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn.lock
660 changes: 660 additions & 0 deletions GNU AFFERO GENERAL PUBLIC LICENSE.md

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
The program users must agree to the following terms:

License notices
This program is free software: you can redistribute it and/or modify it under the terms of the GNU AGPL v3 License as published by the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL v3 License for more details www.gnu.org.

Disclaimer of Warranty
There is no warranty for the program, to the extent permitted by applicable law; except when otherwise stated in writing the copyright holders and/or other parties provide the program "as is" without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the program is with you. Should the program prove defective, you assume the cost of all necessary servicing, repair or correction.

Limitation of Liability
In no event unless required by applicable law or agreed to in writing will any copyright holder, or any other party who modifies and/or conveys the program as permitted above, be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use the program (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the program to operate with any other programs), even if such holder or other party has been advised of the possibility of such damages.

In case of dispute arising out or in relation to the use of the program, it is subject to the public law of Switzerland. The place of jurisdiction is Berne.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
# openimis-fe-worker_voucher_js
The openIMIS Frontend Worker Voucher reference module
# openIMIS Frontend Template module
This repository holds the files of the openIMIS Frontend Template module.
It is dedicated to be bootstrap development of [openimis-fe_js](https://github.com/openimis/openimis-fe_js) modules, providing an empty (yet deployable) module.

Please refer to [openimis-fe_js](https://github.com/openimis/openimis-fe_js) to see how to build and and deploy (in developement or server mode).

The module is built with [rollup](https://rollupjs.org/).
In development mode, you can use `yarn link` and `yarn start` to continuously scan for changes and automatically update your development server.

[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/openimis/openimis-fe-template_js.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/openimis/openimis-fe-template_js/alerts/)
45 changes: 45 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "@openimis/fe-template",
"version": "1.2.0-rc1",
"license": "AGPL-3.0-only",
"description": "openIMIS Frontend Template module",
"repository": "openimis/openimis-fe-template_js",
"main": "dist/index.js",
"module": "dist/index.es.js",
"engines": {
"node": ">=8",
"npm": ">=5"
},
"scripts": {
"build": "rollup -c",
"start": "rollup -c -w",
"format": "prettier src -w",
"prepare":"npm run build"
},
"devDependencies": {
"@babel/cli": "^7.8.4",
"@babel/core": "^7.9.6",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.9.6",
"@babel/preset-env": "^7.9.6",
"@babel/preset-react": "^7.9.4",
"@babel/runtime": "^7.9.6",
"@rollup/plugin-babel": "^5.0.0",
"@rollup/plugin-commonjs": "^11.1.0",
"@rollup/plugin-json": "^4.0.3",
"@rollup/plugin-node-resolve": "^7.1.3",
"@rollup/plugin-url": "^5.0.0",
"moment": "^2.25.3",
"prop-types": "^15.7.2",
"react-autosuggest": "^10.0.2",
"react-intl": "^2.9.0",
"react-router-dom": "^5.2.0",
"redux": "^4.0.5",
"redux-api-middleware": "^3.2.1",
"rollup": "^2.10.0"
},
"files": [
"dist"
],
"dependencies": {}
}
40 changes: 40 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import babel from '@rollup/plugin-babel'
import json from '@rollup/plugin-json'
import pkg from './package.json'

export default {
input: 'src/index.js',
output: [
{
file: pkg.module,
format: 'es',
sourcemap: true
},
{
file: 'dist/index.js',
format: 'cjs',
sourcemap: true
}
],
external: [
/^@babel.*/,
/^@date-io\/.*/,
/^@material-ui\/.*/,
/^@openimis.*/,
"classnames",
"clsx",
"history",
/^lodash.*/,
"moment",
"prop-types",
/^react.*/,
/^redux.*/
],
plugins: [
json(),
babel({
exclude: 'node_modules/**',
babelHelpers: 'runtime'
}),
]
}
9 changes: 9 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import messages_en from "./translations/en.json";

const DEFAULT_CONFIG = {
"translations": [{ key: "en", messages: messages_en }],
}

export const TemplateModule = (cfg) => {
return { ...DEFAULT_CONFIG, ...cfg };
}
2 changes: 2 additions & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}

0 comments on commit db2dff9

Please sign in to comment.