Commit 59d91b1f authored by Daniel Caillibaud's avatar Daniel Caillibaud

suite màj à finir

parent 8a8f1d35
......@@ -2,7 +2,7 @@
* paramètres locaux pour npm test
*/
const path = require('path')
const sesatheques = require('sesatheque-client/src/sesatheques')
const {addSesatheque} = require('sesatheque-client/src/sesatheques')
const logDir = path.join(__dirname, '../logs.test')
const appName = 'testSesatheque'
const port = 3013
......@@ -12,7 +12,7 @@ const host = hostname + ':' + port
// on ajoute cette sesatheque
const baseId = 'bibliLocalTest'
const baseUrl = 'http://' + host + '/'
sesatheques.addSesatheque(baseId, baseUrl)
addSesatheque(baseId, baseUrl)
const getLoggerConf = suffix => ({
logLevel: 'error',
......
......@@ -31,4 +31,4 @@
'use strict'
module.exports = require('sesatheque-client/src/constructors/Groupe')
module.exports = require('sesatheque-client/dist/server/constructors/Groupe').default
......@@ -30,4 +30,4 @@
*/
'use strict'
module.exports = require('sesatheque-client/src/constructors/Ref')
module.exports = require('sesatheque-client/dist/server/constructors/Ref').default
......@@ -31,4 +31,4 @@
'use strict'
module.exports = require('sesatheque-client/src/constructors/Ressource')
module.exports = require('sesatheque-client/dist/server/constructors/Ressource').default
......@@ -30,4 +30,4 @@
*/
'use strict'
module.exports = require('sesatheque-client/src/constructors/Resultat')
module.exports = require('sesatheque-client/dist/server/constructors/Resultat').default
......@@ -39,7 +39,7 @@ const log = require('sesajstools/utils/log')
const sjtObj = require('sesajstools/utils/object')
const sjtUrl = require('sesajstools/http/url')
const {addSesatheque, reBaseUrl} = require('sesatheque-client/dist/server/sesatheques')
const {addSesatheque, reBaseUrl} = require('sesatheque-client/dist/server/sesatheques').default
// la conf du composant ressource à part
const configRessource = require('./ressource/config')
const {version} = require('../../package')
......
......@@ -100,7 +100,7 @@ module.exports = function (component) {
} else if (typeof error === 'string') {
message = error
} else if (error instanceof Error) {
log.error(error)
console.error(error)
message = error.toString()
} else if (Array.isArray(error) && error.every(err => typeof err === 'string')) {
message = `Il y a ${error.length} erreurs :\n- ${error.join('\n- ')}`
......
......@@ -30,7 +30,7 @@
*/
'use strict'
const common = require('sesatheque-client/dist/server/config')
const common = require('sesatheque-client/dist/server/config').default
/**
* Nos listes de types & co, qui changent rarement
......
......@@ -3,7 +3,7 @@
*/
const path = require('path')
const uuid = require('an-uuid')
const sesatheques = require('sesatheque-client/src/sesatheques')
const {addSesatheque} = require('sesatheque-client/src/sesatheques')
const logDir = path.join(__dirname, '../logs.test')
// sert de préfixe de log, dbName et redisPrefix
const appName = 'testSesatheque'
......@@ -12,7 +12,7 @@ const hostname = 'localhost'
const port = 3011
const host = `${hostname}:${port}`
const baseUrl = `http://${host}/`
sesatheques.addSesatheque(baseId, baseUrl)
addSesatheque(baseId, baseUrl)
const getLoggerConf = suffix => ({
logLevel: 'error',
......
......@@ -68,8 +68,11 @@
[
"@babel/preset-env",
{
"useBuiltIns": "entry",
"corejs": 3
"useBuiltIns": "usage",
"corejs": {
"version": 3,
"proposals": true
}
}
],
"@babel/preset-react"
......@@ -77,7 +80,8 @@
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"react-hot-loader/babel"
]
],
"sourceType": "unambiguous"
},
"browserslist": [
"ie 11",
......@@ -154,7 +158,7 @@
"chai-as-promised": "^7.1.1",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^5.0.3",
"core-js": "^3.1.4",
"core-js": "^3.2.1",
"css-loader": "^3.0.0",
"enzyme": "^3.6.0",
"enzyme-adapter-react-16": "^1.5.0",
......@@ -171,8 +175,8 @@
"ignore-styles": "^5.0.1",
"ink-docstrap": "^1.3.0",
"jsdoc": "^3.5.5",
"jsdom": "^13.0.0",
"mocha": "^5.2.0",
"jsdom": "^15.1.1",
"mocha": "^6.2.0",
"node-fetch": "^2.2.0",
"node-sass": "^4.11.0",
"nodemon": "^1.18.4",
......@@ -183,8 +187,8 @@
"sass-loader": "^7.1.0",
"sinon": "^7.0.0",
"sinon-chai": "^3.2.0",
"style-loader": "^0.23.1",
"supertest": "^3.3.0",
"style-loader": "^1.0.0",
"supertest": "^4.0.2",
"trace": "^3.1.0",
"uglifyjs-webpack-plugin": "^2.0.1",
"url-loader": "^2.0.1",
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -46,8 +46,7 @@ import app from '../app/server'
import config from '../app/server/config'
import anLog from 'an-log'
// si on a pas de link vers le module on peut pas aller dans src
// import sesatheques from 'sesatheque-client/src/sesatheques'
import sesatheques from 'sesatheque-client/dist/server/sesatheques'
import {addSesatheque} from 'sesatheque-client/dist/server/sesatheques'
import log from 'sesajstools/utils/log'
/**
......@@ -129,7 +128,7 @@ export default function boot () {
}
// on enregistre notre sesatheque de test
sesatheques.addSesatheque(config.application.baseId, config.application.baseUrl)
addSesatheque(config.application.baseId, config.application.baseUrl)
// on configure an-log d'après la conf
// les logs de l'appli sont dans le dossier configuré dans _private/test.js
// possibilité de modifier le logLevel là-bas
......
......@@ -35,9 +35,9 @@ const path = require('path')
/* eslint-env mocha */
// faut ajouter notre sesathèque coté client
const sesatheques = require('sesatheque-client/src/sesatheques')
const {addSesatheque} = require('sesatheque-client/src/sesatheques')
const {baseId, baseUrl} = require('../app/server/config').application
sesatheques.addSesatheque(baseId, baseUrl)
addSesatheque(baseId, baseUrl)
// on peut mettre dans mocha.opts un
// --require babel-core/register
......
......@@ -124,7 +124,18 @@ const conf = {
// Car les plugins peuvent avoir la leur (et pas mal d'extension jquery font leur
// propre import jquery qu'elles augmentent sans le renvoyer)
// ça règle les pbs avec jquery-ui et jstree
jquery: path.resolve(__dirname, 'node_modules/jquery')
jquery: path.resolve(__dirname, 'node_modules/jquery'),
// sans ces alias webpack plante sur les plugins en pnpm link
'prop-types': path.resolve(__dirname, 'node_modules/prop-types'),
'react': path.resolve(__dirname, 'node_modules/react'),
'react-dom': path.resolve(__dirname, 'node_modules/react-dom'),
'react-hot-loader': path.resolve(__dirname, 'node_modules/react-hot-loader'),
'react-redux': path.resolve(__dirname, 'node_modules/react-redux'),
'redux': path.resolve(__dirname, 'node_modules/redux'),
'redux-form': path.resolve(__dirname, 'node_modules/redux-form'),
'redux-thunk': path.resolve(__dirname, 'node_modules/redux-thunk'),
'core-js': path.resolve(__dirname, 'node_modules/core-js'),
'regenerator-runtime': path.resolve(__dirname, 'node_modules/regenerator-runtime'),
}
},
// pour nos loaders perso
......@@ -204,7 +215,7 @@ const conf = {
},
plugins: [
// On vide le dossier de build
new CleanWebpackPlugin([buildDir]),
new CleanWebpackPlugin(),
// statique
new CopyWebpackPlugin([
// {from: './node_modules/sesaeditgraphe/dist'},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment