diff --git a/packages/core-js/README.md b/packages/core-js/README.md index d0d77e85..d0e8e9f5 100644 --- a/packages/core-js/README.md +++ b/packages/core-js/README.md @@ -1,11 +1,38 @@ # `core-js` -> TODO: description +Core-JS defines custom functions for the **Wisemapping** ecosystem. + +## Quick Start + +1. Clone repository with the next command: + +``` +git clone https://[username]@bitbucket.org/wisemapping/wisemapping-frontend.git +``` + +where the variable _username_ is you username of Bitbucket. + +_Note:The project is configured to use the yarn dependency manager_ + +2. Move to folder core-js + +``` +cd packages/core-js +``` + +3. Now you need install all dependence, this is done with command `yarn install` + +4. To start the development enviroment you have to use command `yarn start`. + +## Production + +To build up the package core-js and use in production, you have to use command `yarn build` ## Usage +To start using core-js it has to be required as a module and then intanciarce as a function + ``` const coreJs = require('core-js'); - -// TODO: DEMONSTRATE API +coreJs(); ``` diff --git a/packages/core-js/webpack.common.js b/packages/core-js/webpack.common.js index b5cf5653..198312b9 100644 --- a/packages/core-js/webpack.common.js +++ b/packages/core-js/webpack.common.js @@ -1,9 +1,9 @@ const path = require('path'); // eslint-disable-line -//const { ProvidePlugin } = require('webpack'); const { CleanWebpackPlugin } = require('clean-webpack-plugin'); // eslint-disable-line /** @type {import('webpack').Configuration} */ -module.exports = { // eslint-disable-line +module.exports = { + // eslint-disable-line entry: './lib/core.js', output: { path: path.resolve(__dirname, 'dist'), // eslint-disable-line @@ -28,32 +28,3 @@ module.exports = { // eslint-disable-line }, plugins: [new CleanWebpackPlugin()], }; - -/* - *{ - core: [ - path.resolve(__dirname, '../mindplot/src/main/javascript/Options'), - path.resolve( - __dirname, - '../mindplot/src/main/javascript/libraries/bootstrap/BootstrapDialog' - ), - path.resolve( - __dirname, - '../mindplot/src/main/javascript/libraries/bootstrap/BootstrapDialog.Request' - ), - ], - }, -Options: path.resolve(path.join(__dirname, '../mindplot/src/main/javascript/Options')), - BootstrapDialog: path.resolve( - path.join( - __dirname, - '../mindplot/src/main/javascript/libraries/bootstrap/BootstrapDialog' - ) - ), - BootstrapDialogRequest: path.resolve( - path.join( - __dirname, - '../mindplot/src/main/javascript/libraries/bootstrap/BootstrapDialog.Request' - ) - ), - * */ diff --git a/packages/core-js/webpack.dev.js b/packages/core-js/webpack.dev.js index f63290fe..90b62cf1 100644 --- a/packages/core-js/webpack.dev.js +++ b/packages/core-js/webpack.dev.js @@ -1,14 +1,18 @@ -const { HotModuleReplacementPlugin } = require("webpack"); -const { merge } = require("webpack-merge"); -const common = require("./webpack.common"); +const { HotModuleReplacementPlugin } = require('webpack'); +const { merge } = require('webpack-merge'); +const common = require('./webpack.common'); /** @type {import('webpack').Configuration} */ const devConfig = { - mode: "development", - target: "core", - plugins: [new HotModuleReplacementPlugin()], - devtool: "eval-source-map" + mode: 'development', + target: 'web', + plugins: [new HotModuleReplacementPlugin()], + devtool: 'eval-source-map', + devServer: { + port: 8080, + open: 'google-chrome-stable', + hot: true, + }, }; -module.exports = merge(common, devConfig) - +module.exports = merge(common, devConfig); diff --git a/packages/core-js/webpack.prod.js b/packages/core-js/webpack.prod.js index d4b51f76..0462e9b7 100644 --- a/packages/core-js/webpack.prod.js +++ b/packages/core-js/webpack.prod.js @@ -1,16 +1,15 @@ -const { merge } = require("webpack-merge"); -const common = require("./webpack.common"); +const { merge } = require('webpack-merge'); +const common = require('./webpack.common'); /** @type {import('webpack').Configuration} */ const prodConfig = { - mode: "production", - devtool: "source-map", - optimization: { - splitChunks: { - chunks: "all", + mode: 'production', + devtool: 'source-map', + optimization: { + splitChunks: { + chunks: 'all', + }, }, - } }; module.exports = merge(common, prodConfig); -