View on GitHub
File Changes
import 'ace-builds/src-min-noconflict/theme-monokai.js';
import 'node-blockly/browser';

                      
+
import * as monaco from 'monaco-editor';
+
global.monaco = monaco;
+

                      
import './src/Main.purs';
    "file-loader": "^2.0.0",
    "html-webpack-plugin": "^3.2.0",
    "jquery": "^3.3.1",
+
    "monaco-editor": "^0.20.0",
+
    "monaco-editor-webpack-plugin": "^1.8.2",
    "node-blockly": "^1.0.36",
    "node-sass": "^4.12.0",
    "popper.js": "^1.14.4",
    "webpack-dev-server": "^3.1.10",
    "xhr2": "^0.1.4"
  },
-
  "resolutions": { },
+
  "resolutions": {},
  "license": "Apache-2.0"
}
+
module Halogen.Monaco where
module Main where

                      
import Prelude
+

                      
import Control.Coroutine (Consumer, Process, connect, consumer, runProcess, ($$))
import Control.Monad.Reader.Trans (runReaderT)
import Data.Maybe (Maybe(..))
+
import Debug.Trace (trace)
import Effect (Effect)
import Effect.Aff (forkAff, Aff)
import Effect.Class (liftEffect)
import Foreign.Generic (defaultOptions)
import Halogen (hoist)
import Halogen.Aff (awaitBody, runHalogenAff)
+
import Monaco as Monaco
import Halogen.VDom.Driver (runUI)
import LocalStorage (RawStorageEvent)
import LocalStorage as LocalStorage
main ::
  Effect Unit
main = do
+
  monaco <- Monaco.getMonaco
+
  trace monaco \_ -> pure unit
  -- TODO: need to get the proper url, same as the client
  window <- W.window
  location <- WW.location window
+
/*eslint-env node*/
+
'use strict';
+

                      
+
exports.getMonaco = function () {
+
    return global.monaco;
+
}
+

                      
+
exports.create_ = function(monaco, nodeId) {
+
    return function() {
+
        monaco.editor.create(document.getElementById(nodeId), {
+
            value: [
+
              'function x() {',
+
              '\tconsole.log("Hello world!");',
+
              '}'
+
            ].join('\n'),
+
            language: 'javascript'
+
          });
+
    }
+
}
+
module Monaco where
+

                      
+
import Prelude
+

                      
+
import Effect (Effect)
+

                      
+
foreign import data Monaco :: Type
+

                      
+
foreign import getMonaco :: Effect Monaco
+

                      
+
foreign import create_ :: Monaco -> String -> Effect Unit
\ No newline at end of file
          , br_
          , errorList
          , analysisPane state
+
          , div [id_ "monacoPane"] []
          ]
        ]
    )
'use strict';

                      
-
const ExtractTextPlugin = require("extract-text-webpack-plugin");
+
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
const isWatch = process.argv.some(a => a === '--watch');

                      
const plugins =
-
      isWebpackDevServer || !isWatch ? [] : [
-
          function(){
-
              this.plugin('done', function(stats){
-
                  process.stderr.write(stats.toString('errors-only'));
-
              });
-
          }
-
      ]
-
;
+
    isWebpackDevServer || !isWatch ? [] : [
+
        function () {
+
            this.plugin('done', function (stats) {
+
                process.stderr.write(stats.toString('errors-only'));
+
            });
+
        }
+
    ]
+
    ;

                      
module.exports = {
    devtool: 'eval-source-map',
            {
                test: /\.(gif|png|jpe?g|svg)$/i,
                use: 'url-loader'
+
            },
+
            {
+
                test: /\.ttf$/,
+
                use: ['file-loader'],
            }
        ]
    },
        modules: [
            'node_modules'
        ],
-
        extensions: [ '.purs', '.js']
+
        extensions: ['.purs', '.js']
    },

                      
    plugins: [
            productName: 'marlowe-playground',
            googleAnalyticsId: isWebpackDevServer ? 'UA-XXXXXXXXX-X' : 'UA-119953429-7'
        }),
-
        new webpack.NormalModuleReplacementPlugin(/^echarts$/, 'echarts/dist/echarts.min.js')
+
        new webpack.NormalModuleReplacementPlugin(/^echarts$/, 'echarts/dist/echarts.min.js'),
+
        new MonacoWebpackPlugin()
    ].concat(plugins)
};
  dependencies:
    minimist "0.0.8"

                      
+
  version "1.8.2"
+
  resolved "https://registry.yarnpkg.com/monaco-editor-webpack-plugin/-/monaco-editor-webpack-plugin-1.8.2.tgz#3721b8d9a3e2e41b154cf2a2955a7d7246c03714"
+
  integrity sha512-g9G7A/lxQtpPsYaZFBqm73dwVkOziGUXExIR6iW7ksZUaiMkpvdTiE9O8edgdJGo+XtCmjycmIKB1Lt8VKbSTQ==
+
  dependencies:
+
    loader-utils "^1.2.3"
+

                      
+
  version "0.20.0"
+
  resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.20.0.tgz#5d5009343a550124426cb4d965a4d27a348b4dea"
+
  integrity sha512-hkvf4EtPJRMQlPC3UbMoRs0vTAFAYdzFQ+gpMb8A+9znae1c43q8Mab9iVsgTcg/4PNiLGGn3SlDIa8uvK1FIQ==
+

                      
  version "1.0.1"
  resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92"