Skip to content

Commit

Permalink
Copy of extensions from web and configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
diocas committed Nov 2, 2021
1 parent 7b55709 commit 94a643f
Show file tree
Hide file tree
Showing 56 changed files with 36,851 additions and 1 deletion.
81 changes: 81 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
release/*

**/l10n/locale
**/l10n/template.pot

build/version.json

/hugo

.idea
*.bundle.js
*.bundle.js.map
*.chunk.js
*.chunk.js.map

config.json
package-lock.json

node_modules
dist
release

*.log
.DS_Store
.envrc

tests/reports
tests/ocis
tests/testing-app

/webpack.json
/webpack-build-log.json

/coverage

# yarn2 with Zero-Installs: https://yarnpkg.com/features/zero-installs
#.yarn/*
#!.yarn/cache
#!.yarn/patches
#!.yarn/plugins
#!.yarn/releases
#!.yarn/sdks
#!.yarn/versions

# yarn2 not using Zero-Installs: https://yarnpkg.com/features/zero-installs
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*

tests/acceptance/.yarn/*
!tests/acceptance/.yarn/patches
!tests/acceptance/.yarn/releases
!tests/acceptance/.yarn/plugins
!tests/acceptance/.yarn/sdks
!tests/acceptance/.yarn/versions

# visual regression testing artifacts
/tests/vrt/diff
/tests/vrt/latest

# acceptance test artifacts
logfile.txt
comments.file

# drone CI is in .drone.star, do not let someone accidentally commit a local .drone.yml
.drone.yml

# Themes
/packages/web-runtime/themes/**
!/packages/web-runtime/themes/owncloud/**

# Report for tests
tests/report/cucumber_report.json
tests/report/cucumber_report.html
.vscode/settings.json
tests/acceptance/report/cucumber_report.json
tests/acceptance/report/cucumber_report.html
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
# web-extensions
Our fully frontend OCIS Web extenions

This repo contains all the CERNBox web extensions for OCIS Web.

## Development

When developing on an extension, just `yarn serve` on it. This will build in watch mode and create a web server to expose the files in `dist`.
To enable the extension in the Web, just add the following to the config:

```json
{
(...)
"external_apps": [
{
"id": "ifc-js",
"path": "http://localhost:9101/main.js"
}
]
}
```

The remaining extensions will have a different port (just look at the output of the `yarn serve` command).
1 change: 1 addition & 0 deletions buildall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ls -d ./*/ | xargs -n1 sh -c 'if [ -e $0Makefile ]; then echo "Building $0" ; cd $0 ; make release; fi'
48 changes: 48 additions & 0 deletions ifc-js/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
module.exports = {
env: {
browser: true,
es6: true,
amd: true
},
extends: [
'standard',
'prettier/standard',
'plugin:prettier/recommended',
'plugin:jest/recommended'
],
parser: "@babel/eslint-parser",
parserOptions: {
requireConfigFile: false,
sourceType: 'module'
},
rules: {
/**
* TODO: fix project import issues and then enable it
* 'sort-imports': 'warn',
*/
'require-await': 'warn',
'no-new': 'off',
'jest/no-standalone-expect': 'off',
'node/no-callback-literal': 'off'
},
globals: {
require: false,
requirejs: false
},
plugins: ['jest'],
overrides: [
{
files: ['**/*.vue'],
extends: ['plugin:vue/recommended', 'prettier/vue']
},
{
files: ['**/*.ts'],
parser: '@typescript-eslint/parser',
extends: ['plugin:@typescript-eslint/recommended'],
rules: {
'@typescript-eslint/no-extra-semi': 'off',
'@typescript-eslint/no-explicit-any': 'off'
}
}
]
}
6 changes: 6 additions & 0 deletions ifc-js/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"printWidth": 100,
"singleQuote": true,
"semi": false,
"trailingComma": "none"
}
14 changes: 14 additions & 0 deletions ifc-js/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
NAME := ifc-js

release: release/$(NAME).tar.gz

clean:
rm -rf dist release node_modules

dist:
yarn install
yarn build

release/$(NAME).tar.gz: dist
mkdir -p release
tar -C dist -czf release/$(NAME).tar.gz .
72 changes: 72 additions & 0 deletions ifc-js/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"name": "ifc-js",
"version": "0.0.0",
"description": "CERNBox web IFC.js integration",
"license": "AGPL-3.0",
"author": "CERNBox",
"private": true,
"homepage": "https://github.com/cernbox/web-extensions",
"scripts": {
"lint": "eslint 'src/**/*.{js,vue}' --color",
"build": "rollup -c",
"watch": "rollup -c -w",
"serve": "SERVER=true yarn watch"
},
"browserslist": [
"last 2 version",
"> .2%",
"not dead",
"not IE 11",
"not IE_Mob 11"
],
"devDependencies": {
"@babel/core": "^7.12.10",
"@babel/eslint-parser": "^7.16.0",
"@erquhart/rollup-plugin-node-builtins": "^2.1.5",
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-json": "^4.1.0",
"@types/jest": "^26.0.23",
"@types/jest-axe": "^3.5.3",
"@typescript-eslint/eslint-plugin": "^5.2.0",
"babel-jest": "^27.0.6",
"eslint": "^7.30.0",
"eslint-config-prettier": "^6.10.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-vue": "^7.13.0",
"eslint-plugin-vuejs-accessibility": "^0.7.1",
"jest": "^26.6.3",
"jest-axe": "^4.1.0",
"jest-fetch-mock": "^3.0.3",
"jest-mock-axios": "^4.4.0",
"jest-serializer-vue": "^2.0.2",
"jest-svg-transformer": "^1.0.0",
"rollup": "^2.52.7",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-copy-watch": "^0.0.1",
"rollup-plugin-embed-css": "^1.0.21",
"rollup-plugin-gzip": "^2.5.0",
"rollup-plugin-livereload": "^2.0.5",
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-serve": "^1.1.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-vue": "^5.1.4",
"ts-jest": "^27.0.7",
"typescript": "^4.4.4",
"vue-jest": "^3.0.7",
"vue-template-compiler": "^2.6.12",
"vuex": "^3.6.2"
},
"engines": {
"node": ">=14 <=16"
},
"dependencies": {
"three": "^0.134.0",
"web-ifc-three": "^0.0.75"
}
}
75 changes: 75 additions & 0 deletions ifc-js/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import vue from 'rollup-plugin-vue'
import { terser } from 'rollup-plugin-terser'
import gzip from 'rollup-plugin-gzip'
import resolve from 'rollup-plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import babel from 'rollup-plugin-babel'
import json from '@rollup/plugin-json'
import builtins from '@erquhart/rollup-plugin-node-builtins'
import globals from 'rollup-plugin-node-globals'
import embedCSS from 'rollup-plugin-embed-css'
import copy from 'rollup-plugin-copy-watch'
import serve from 'rollup-plugin-serve'
import livereload from 'rollup-plugin-livereload'

const production = !process.env.ROLLUP_WATCH

// We can't really do much about circular dependencies in node_modules
function onwarn (warning) {
if (warning.code !== 'CIRCULAR_DEPENDENCY') {
console.error(`(!) ${warning.message}`)
}
}

const plugins = [
vue(),
resolve({
mainFields: ['browser', 'jsnext', 'module', 'main'],
include: 'node_modules/**',
preferBuiltins: true
}),
babel({
exclude: 'node_modules/**',
runtimeHelpers: true
}),
commonjs({
include: 'node_modules/**'
}),
copy({
targets: [
{ src: 'node_modules/web-ifc/web-ifc.wasm', dest: 'dist' }
]
}),
json(),
embedCSS(),
globals(),
builtins(),
production && terser(),
gzip()
]

if (process.env.SERVER === 'true') {
plugins.push(
serve({
host: '0.0.0.0',
contentBase: ['dist'],
port: process.env.PORT || 9101
})
)
plugins.push(
livereload({
watch: 'dist'
})
)
}

export default {
input: 'src/index.js',
output: {
file: 'dist/main.js',
format: 'amd',
sourcemap: production
},
onwarn,
plugins
}
Loading

0 comments on commit 94a643f

Please sign in to comment.