Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
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
12 changes: 12 additions & 0 deletions Composer/packages/extensions/visual-designer/demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<div id="demo"></div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ This folder contains the required source code for running an ObiVisualEditor dev

You can paste your obi json schema and then preview the visualization result.

Make sure your `npm start` command is pointed to the `nwb serve-react-demo` script.
Make sure your `npm start` command is pointed to the `webpack-dev-server --config demo/webpack.config.demo.js --port 3002` script.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"baseUrl": "."
},
"include": ["./src/**/*", "../src/**/*"]
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/* eslint-disable */
const path = require('path');

const webpack = require('webpack');
const autoprefixer = require('autoprefixer');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');

module.exports = {
entry: path.resolve(__dirname, 'src/index.js'),
mode: 'development',
devtool: 'inline-source-map',
devServer: {
contentBase: path.join(__dirname, 'dist'),
port: 3001,
stats: 'errors-only',
},
module: {
rules: [
{
test: /\.(tsx?|jsx?)$/,
loader: 'ts-loader',
exclude: /node_modules/,
options: {
transpileOnly: true,
experimentalWatchApi: true,
},
},
{
test: /\.(gif|png|webp)$/,
loader: 'url-loader',
options: {
limit: 1,
name: '[name].[hash:8].[ext]',
},
},
{ test: /\.svg$/, loader: 'url-loader', options: { limit: 1, name: '[name].[hash:8].[ext]' } },
{ test: /\.jpe?g$/, loader: 'url-loader', options: { limit: 1, name: '[name].[hash:8].[ext]' } },
{
test: /\.(eot|otf|ttf|woff|woff2)$/,
loader: 'url-loader',
options: { limit: 1, name: '[name].[hash:8].[ext]' },
},
{
test: /\.css$/,
use: [
{
loader: 'style-loader',
options: {
hmr: true,
sourceMap: true,
},
},
{ loader: 'css-loader', options: { importLoaders: 1 } },
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: [
autoprefixer({
browsers: ['>1%', 'last 2 versions', 'not ie < 11'],
}),
],
},
},
],
},
{
test: /\.s[ac]ss$/,
use: [
{
loader: 'style-loader',
options: {
hmr: true,
sourceMap: true,
},
},
{ loader: 'css-loader', options: { importLoaders: 1 } },
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: [
autoprefixer({
browsers: ['>1%', 'last 2 versions', 'not ie < 11'],
}),
],
},
},
],
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
plugins: [new TsconfigPathsPlugin({ configFile: path.resolve(__dirname, './tsconfig.json') })],
},

output: {
filename: '[name].[chunkhash:8].js',
chunkFilename: '[name].[chunkhash:8].js',
path: path.resolve('./demo/dist'),
},

plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development'),
}),
new HtmlWebpackPlugin({
title: 'Visual Designer',
chunksSortMode: 'dependency',
template: path.join(__dirname, 'index.html'),
}),
],
};
21 changes: 0 additions & 21 deletions Composer/packages/extensions/visual-designer/nwb.config.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"build:css": "copyfiles --up 1 \"src/**/*.css\" \"src/**/*.scss\" lib",
"clean": "rimraf lib demo/dist",
"prepublishOnly": "npm run build",
"start": "webpack-dev-server --config demo/webpack.config.demo.js --port 3002",
"test": "jest --no-cache",
"lint": "eslint --quiet --ext .js,.jsx,.ts,.tsx ./src",
"lint:fix": "yarn lint --fix"
Expand Down