Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d5e4088
Find version of Node that works
macumber Oct 21, 2023
5bd8dca
Fixing bug when duplicating stories with windows or doors
macumber Oct 21, 2023
2e6f3a4
Update to Node 16
macumber Oct 21, 2023
de11383
Revert changes
macumber Oct 21, 2023
468125d
Revert files
macumber Oct 21, 2023
572273f
Rev
macumber Oct 21, 2023
0fef359
Give up trying to fix error
macumber Oct 21, 2023
1c511ed
Update actions
macumber Oct 21, 2023
e1291b2
Use older runner
macumber Oct 21, 2023
ff94086
Don't try to set up python
macumber Oct 21, 2023
bcd451f
Fix error in unit test
macumber Oct 22, 2023
0bcf357
Update test wait times to be more robust
macumber Oct 22, 2023
ac89817
feat(upgrade): upgrade to wp 5
sibelius Dec 10, 2023
3e45652
fix(vue): fix vue
sibelius Dec 10, 2023
3f029bd
fix(svg): fix svg icons
sibelius Dec 10, 2023
d7d0505
fix(ci): fix npm ci
sibelius Dec 10, 2023
82c0246
fix(npm): fix npm ci
sibelius Dec 10, 2023
fe79726
fix(d3): fix d3 aware throttle
sibelius Dec 10, 2023
f4652b5
Comment out 3DViewer for now
macumber Dec 11, 2023
f242d06
feat(openlayers): rollback to openlayers to fix it
sibelius Dec 11, 2023
969b14b
feat(reorg): reorg
sibelius Dec 11, 2023
7646e50
fix(karma): fix karma
sibelius Dec 11, 2023
03c3457
fix(ci): fix github actions
sibelius Dec 11, 2023
d8066d3
fix(test): fix selenium
sibelius Dec 12, 2023
a6466bb
fix(click): fix click
sibelius Dec 12, 2023
0af0e9e
fix(selenium): fix selenium
sibelius Dec 13, 2023
30001ab
Update readme
macumber Dec 17, 2023
cca903e
Update deploy action
macumber Dec 17, 2023
15c8699
Merge pull request #2 from openstudiocoalition/feat/upgrade
macumber Dec 18, 2023
3b735a3
Temporarily disable e2e tests in CI, will be restored when #3 is reso…
macumber Dec 18, 2023
0c4aa85
Merge pull request #4 from openstudiocoalition/temp_disable_e2e
macumber Dec 18, 2023
38d5501
Remove 3DViewer for now
macumber Dec 18, 2023
e1ea72d
Merge branch 'develop' of github.com:openstudiocoalition/floorspace.j…
macumber Dec 18, 2023
7b7bcf5
Removed 3-selection-multi and check for null d3.event
macumber Dec 22, 2023
7e9a373
Fix issues with doors
macumber Dec 23, 2023
b01aed5
Merge pull request #7 from openstudiocoalition/sf_fix_window_components
macumber Dec 23, 2023
0c6d54c
Fix styling of input fields in settings dialog
manuvarkey Apr 15, 2024
c3bdc2c
Fix column headers not scrolling in library
manuvarkey Apr 15, 2024
7907a10
Merge pull request #11 from manuvarkey/develop
macumber Apr 27, 2024
9a5c23d
Update dependency versions from @sibelius
macumber Jun 11, 2024
ebe9427
Change urls in readme
macumber Jun 11, 2024
4779fa4
Update base branch
macumber Jun 11, 2024
e751721
Merge pull request #12 from openstudiocoalition/minor_tweaks
macumber Jun 11, 2024
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
5 changes: 0 additions & 5 deletions .babelrc

This file was deleted.

8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: npm
directory: '/'
schedule:
interval: daily
time: '01:00'
open-pull-requests-limit: 10
17 changes: 17 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: auto-merge

on:
pull_request_target:
branches:
- develop

jobs:
auto-merge:
runs-on: self-hosted
if: github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]'
steps:
- uses: ahmadnassri/[email protected]
with:
github-token: ${{ secrets.AUTOMERGE_TOKEN }}
command: 'squash and merge'
target: minor
16 changes: 9 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
workflow_run:
workflows: [ 'Test on branch push' ]
branches: [ develop ]
types:
types:
- completed

jobs:
Expand All @@ -15,19 +15,21 @@ jobs:
NODE_ENV: 'PROD'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 15
node-version: 20
- run: sudo apt-get install -y libappindicator1 fonts-liberation ruby-full python3-pip
- run: sudo pip install mkdocs
- run: npm ci
- run: npm run openstudio-build && sed -i 's/\/static/static/g' dist/index.html && sed -i 's/\/static/..\/static/g' dist/3DViewer/index.html
- run: |
yarn config set unsafe-disable-integrity-migration true -g
yarn install --ignore-engines --frozen-lockfile --non-interactive
- run: yarn run wp:build && yarn run openstudio-build && sed -i 's/\/static/static/g' dist/index.html
- run: mkdocs build -d dist/docs
- run: cp -r icons/ dist/ && cp site.webmanifest dist/ && cp browserconfig.xml dist/
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: dist # The folder the action should deploy.
folder: dist # The folder the action should deploy.
29 changes: 22 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,28 @@ jobs:
NODE_ENV: 'PROD'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 15
- run: npm ci
- run: xvfb-run npm run test
env:
node-version: 20
- run: |
yarn config set unsafe-disable-integrity-migration true -g
yarn install --ignore-engines --frozen-lockfile --non-interactive
- run: xvfb-run yarn unit
if: always()
env:
DISPLAY: 99.0
DBUS_SESSION_BUS_ADDRESS: '/dev/null'
DBUS_SESSION_BUS_ADDRESS: '/dev/null'
- name: Install Playwright Browsers
if: always()
run: npx playwright install --with-deps
- name: Run Playwright tests
if: always()
run: npx playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 1
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@ test/e2e/reports
selenium-debug.log
output
.vscode
logs
karma_html
distTs/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
6 changes: 3 additions & 3 deletions 3DViewer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM emscripten/emsdk:2.0.26
FROM emscripten/emsdk:3.1.61

RUN echo "## Start building" \
\
Expand All @@ -21,9 +21,9 @@ RUN echo "## Start building" \
openjdk-8-jre-headless \
\
&& echo "## Installing CMake" \
&& wget https://cmake.org/files/v3.18/cmake-3.18.3-Linux-x86_64.sh -q \
&& wget https://cmake.org/files/v3.29/cmake-3.29.5-linux-x86_64.sh -q \
&& mkdir /opt/cmake \
&& printf "y\nn\n" | sh cmake-3.18.3-Linux-x86_64.sh --prefix=/opt/cmake > /dev/null \
&& printf "y\nn\n" | sh cmake-3.29.5-linux-x86_64.sh --prefix=/opt/cmake > /dev/null \
&& rm -fr cmake*.sh /opt/cmake/doc \
&& rm -fr /opt/cmake/bin/cmake-gui \
&& rm -fr /opt/cmake/bin/ccmake \
Expand Down
2 changes: 2 additions & 0 deletions 3DViewer/viewer/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
import 'core-js/stable';
import 'regenerator-runtime/runtime';
import './styles.css';
import './main';
38 changes: 21 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,42 @@

## Getting Started

Read [the docs](https://nrel.github.io/floorspace.js/docs) then try out the [latest development version](https://nrel.github.io/floorspace.js/) in your browser.
Read [the docs](https://openstudiocoalition.org/floorspace.js/docs) then try out the [latest development version](https://openstudiocoalition.org/floorspace.js/) in your browser.

## Build Setup

``` bash
# install dependencies
npm install
# install node using nvm
$ nvm install 20
$ nvm use 20
$ npm install --global yarn

# install locked dependencies
yarn install --frozen-lockfile

# install and update dependencies (optional)
yarn install

# serve with hot reload at localhost:8080
npm run dev
yarn wp:dev

# build for production with minification
npm run build
yarn wp:build

# build single page output for openstudio
npm run openstudio-build

# alternative if `npm run openstudio-build` does not work, build single page output for openstudio
npm run build
ruby build/build.rb
yarn openstudio-build

# run unit tests
npm run unit
yarn run unit

# run e2e tests
npm run e2e
yarn run e2e

# run all tests
npm test
# run performance tests (optional)
yarn perf

# run test playwright watch mode interactive
yarn playwright test --ui test/playwright
```

For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).

[Tests](https://travis-ci.org/NREL/floorspace.js) are run on each pull request. Current status: [![Build Status](https://travis-ci.org/NREL/floorspace.js.svg?branch=develop)](https://travis-ci.org/NREL/floorspace.js)

13 changes: 13 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
presets: [
'@babel/preset-typescript',
[
'@babel/preset-env',
{
corejs: 3,
modules: false,
useBuiltIns: 'usage',
},
],
],
};
6 changes: 3 additions & 3 deletions build/build-embeddable.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const srcPath = './src';
const webpack_output = readFileSync(distPath + '/index.html', { encoding: 'utf-8' });

const scripts = webpack_output.split('src=').slice(1).map(scriptChunk => {
const jsPath = scriptChunk.split('></script>')[0];
const jsPath = scriptChunk.split('></script>')[0].replace(/['"]+/g, '');
console.log(`Loading scripts from: ${jsPath}\n\n`);
return readFileSync(distPath + jsPath, { encoding: 'utf-8' });
}).join('\n\t');
Expand Down Expand Up @@ -36,8 +36,8 @@ const standaloneHtml = baseHtml + `
</html>`

writeFileSync(distPath + '/standalone_geometry_editor.html', standaloneHtml);
console.log(`Loading floorspace.js API script from: ${srcPath + '/api.js'}\n\n`);
const apiScripts = readFileSync(srcPath + '/api.js', { encoding: 'utf-8' });
console.log(`Loading floorspace.js API script from: ${srcPath + '/api.ts'}\n\n`);
const apiScripts = readFileSync(srcPath + '/api.ts', { encoding: 'utf-8' });
const lodash = readFileSync('./node_modules/lodash/lodash.min.js', { encoding: 'utf-8' });

const embeddableHtml = baseHtml + `
Expand Down
10 changes: 5 additions & 5 deletions build/dev-client.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable */
require('eventsource-polyfill')
var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
require("eventsource-polyfill");
const hotClient = require("webpack-hot-middleware/client?noInfo=true&reload=true");

hotClient.subscribe(function (event) {
if (event.action === 'reload') {
window.location.reload()
if (event.action === "reload") {
window.location.reload();
}
})
});
99 changes: 47 additions & 52 deletions build/dev-server.js
Original file line number Diff line number Diff line change
@@ -1,79 +1,74 @@
require('./check-versions')()
var config = require('../config')
if (!process.env.NODE_ENV) process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
var path = require('path')
var express = require('express')
var webpack = require('webpack')
var opn = require('opn')
var proxyMiddleware = require('http-proxy-middleware')
var webpackConfig = process.env.NODE_ENV === 'testing'
? require('./webpack.prod.conf')
: require('./webpack.dev.conf')
require("./check-versions")();
const config = require("../config");
if (!process.env.NODE_ENV)
process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV);
const path = require("path");
const express = require("express");
const webpack = require("webpack");
const opn = require("opn");
const proxyMiddleware = require("http-proxy-middleware");
const webpackConfig =
process.env.NODE_ENV === "testing"
? require("./webpack.prod.conf")
: require("./webpack.dev.conf");

// default port where dev server listens for incoming traffic
var port = process.env.PORT || config.dev.port
const port = process.env.PORT || config.dev.port;
// Define HTTP proxies to your custom API backend
// https://github.com/chimurai/http-proxy-middleware
var proxyTable = config.dev.proxyTable
const proxyTable = config.dev.proxyTable;

var app = express()
var compiler = webpack(webpackConfig)
const app = express();
const compiler = webpack(webpackConfig);

// serve pure static assets
var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
app.use(staticPath, express.static('./static'))
app.use(path.posix.join(config.dev.assetsPublicPath, '3DViewer/'), express.static('./3DViewer/build/'))
const staticPath = path.posix.join(
config.dev.assetsPublicPath,
config.dev.assetsSubDirectory
);
app.use(staticPath, express.static("./static"));
app.use(
path.posix.join(config.dev.assetsPublicPath, "3DViewer/"),
express.static("./3DViewer/build/")
);

var devMiddleware = require('webpack-dev-middleware')(compiler, {
var devMiddleware = require("webpack-dev-middleware")(compiler, {
publicPath: webpackConfig.output.publicPath,
stats: {
colors: true,
chunks: false
chunks: false,
},
})

var hotMiddleware = require('webpack-hot-middleware')(compiler)
// force page reload when html-webpack-plugin template changes
compiler.plugin('compilation', function (compilation) {
compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
hotMiddleware.publish({ action: 'reload' })
cb()
})
})
});

// proxy api requests
Object.keys(proxyTable).forEach(function (context) {
var options = proxyTable[context]
if (typeof options === 'string') {
options = { target: options }
var options = proxyTable[context];
if (typeof options === "string") {
options = { target: options };
}
app.use(proxyMiddleware(context, options))
})
app.use(proxyMiddleware(context, options));
});

// handle fallback for HTML5 history API
app.use(require('connect-history-api-fallback')({
rewrites: [
{ from: /\/3DViewer/, to: '/3DViewer/index.html'}
]
}))
app.use(
require("connect-history-api-fallback")({
rewrites: [{ from: /\/3DViewer/, to: "/3DViewer/index.html" }],
})
);

// serve webpack bundle output
app.use(devMiddleware)

// enable hot-reload and state-preserving
// compilation error display
app.use(hotMiddleware)
app.use(devMiddleware);

module.exports = app.listen(port, function (err) {
if (err) {
console.log(err)
return
console.log(err);
return;
}
var uri = 'http://localhost:' + port
console.log('Listening at ' + uri + '\n')
var uri = "http://localhost:" + port;
console.log("Listening at " + uri + "\n");

// when env is testing, don't need open it
if (process.env.NODE_ENV !== 'testing') {
opn(uri)
if (process.env.NODE_ENV !== "testing") {
opn(uri);
}
})
});
20 changes: 20 additions & 0 deletions build/getBundleAnalyzer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

const getBundleAnalyzer = () => {
if (process.env.BUNDLE_ANALYZER === 'true') {
// eslint-disable-next-line
console.log('bundle analyzer enabled');

return [
new BundleAnalyzerPlugin(),
];
}

// eslint-disable-next-line
console.log('bundle analyzer disabled');

return [
];
};

module.exports = getBundleAnalyzer;
Loading