Skip to content

Commit

Permalink
Revert "Move from webpack to Vite"
Browse files Browse the repository at this point in the history
This reverts commit b1fc7bf.

Workaround for vitejs/vite#11804
  • Loading branch information
SimonBin committed Feb 7, 2023
1 parent b170179 commit 9165e43
Show file tree
Hide file tree
Showing 32 changed files with 4,888 additions and 746 deletions.
4 changes: 2 additions & 2 deletions jena-fuseki2/jena-fuseki-ui/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
module.exports = {
root: true,
env: {
node: true,
es2021: true,
node: true
},
extends: [
'plugin:vue/vue3-recommended'
],
parserOptions: {
parser: '@babel/eslint-parser',
requireConfigFile: false
},
rules: {
Expand Down
23 changes: 23 additions & 0 deletions jena-fuseki2/jena-fuseki-ui/.nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"all": true,
"cache": false,
"check-coverage": false,
"include": ["src/**/*.js", "src/**/*.vue"],
"exclude": [
"**/node_modules/**",
"**/dist/**",
"**/tests/**",
"**/*.spec.js",
"**/*.mock.*.js",
"src/assets/**/*.*",
"src/events/**/*.*",
"src/router/**/*.*",
"src/styles/**/*.*",
"src/main.js"
],
"excludeNodeModules": true,
"extension": [".js", ".ts", ".vue"],
"instrument": true,
"reporter": ["html", "lcov", "text-summary"],
"sourceMap": false
}
34 changes: 0 additions & 34 deletions jena-fuseki2/jena-fuseki-ui/README.md

This file was deleted.

26 changes: 26 additions & 0 deletions jena-fuseki2/jena-fuseki-ui/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
],
plugins: [
'@babel/plugin-transform-runtime',
'istanbul'
]
}
22 changes: 10 additions & 12 deletions jena-fuseki2/jena-fuseki-ui/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/

const { defineConfig } = require('cypress')
const vitePreprocessor = require('cypress-vite')

module.exports = defineConfig({
video: false,
Expand All @@ -26,23 +25,22 @@ module.exports = defineConfig({
pageLoadTimeout: 15000,
requestTimeout: 7500,
responseTimeout: 7500,
fixturesFolder: 'tests/e2e/fixtures',
screenshotsFolder: 'tests/e2e/screenshots',
videosFolder: 'tests/e2e/videos',

e2e: {
baseUrl: 'http://localhost:8080/',
setupNodeEvents (on, config) {
on('file:preprocessor', vitePreprocessor())
return require('./tests/e2e/plugins/index.js')(on, config)
},
specPattern: 'tests/e2e/specs/**/*.cy.{js,jsx,ts,tsx}',
fixturesFolder: 'tests/e2e/fixtures',
screenshotsFolder: 'tests/e2e/screenshots',
videosFolder: 'tests/e2e/videos',
supportFile: 'tests/e2e/support/index.js',
supportFile: 'tests/e2e/support/index.js'
},

env: {
codeCoverage: {
exclude: 'cypress/**/*.*',
},
},
component: {
devServer: {
framework: 'vue-cli',
bundler: 'webpack'
}
}
})
45 changes: 26 additions & 19 deletions jena-fuseki2/jena-fuseki-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@
"author": "Apache Jena Team",
"license": "Apache-2.0",
"scripts": {
"dev": "vite",
"serve": "vite preview --port 8080",
"serve": "vue-cli-service serve",
"prebuild": "patch -F0 -ff -p1 < yasqe.lateral.patch",
"build": "vite build",
"test:unit": "vitest run --environment jsdom",
"test:e2e": "bash -c 'concurrently --names \"SERVER,TESTS\" --prefix-colors \"yellow,blue\" --success \"first\" --kill-others \"yarn run serve:offline\" \"cross-env CYPRESS_COVERAGE=false cypress run ${0}\"'",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src",
"coverage:unit": "vitest run --environment jsdom --coverage",
"coverage:e2e": "bash -c 'concurrently --names \"SERVER,TESTS\" --prefix-colors \"yellow,blue\" --success \"first\" --kill-others \"yarn run serve:offline\" \"cross-env CYPRESS_COVERAGE=true cypress run ${0}\"'",
"build": "vue-cli-service build",
"test:unit": "vue-cli-service test:unit",
"test:e2e": "bash -c 'concurrently --names \"SERVER,TESTS\" --prefix-colors \"yellow,blue\" --success \"first\" --kill-others \"yarn run serve:fuseki\" \"vue-cli-service test:e2e ${0}\"'",
"lint": "vue-cli-service lint",
"coverage:e2e": "bash -c 'concurrently --names \"SERVER,TESTS\" --prefix-colors \"yellow,blue\" --success \"first\" --kill-others \"yarn run serve:fuseki\" \"nyc vue-cli-service test:e2e ${0}\"'",
"coverage:unit": "nyc vue-cli-service test:unit",
"serve:fuseki": "nodemon src/services/mock/json-server.js",
"serve:offline": "concurrently --names 'SERVER,CLIENT' --prefix-colors 'yellow,blue' --success \"first\" --kill-others 'yarn run serve:fuseki' 'yarn run dev'"
"serve:offline": "concurrently --names 'SERVER,CLIENT' --prefix-colors 'yellow,blue' --success \"first\" --kill-others 'yarn run serve:fuseki' 'yarn run serve'"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.2.0",
Expand All @@ -28,6 +27,7 @@
"@vue/compat": "^3.2.39",
"axios": "^0.27.2",
"bootstrap": "^5.2.1",
"core-js": "^3.25.2",
"follow-redirects": "^1.15.2",
"mitt": "^3.0.0",
"nanoid": "^4.0.0",
Expand All @@ -36,33 +36,40 @@
"vue-upload-component": "^3.1.2"
},
"devDependencies": {
"@babel/eslint-parser": "^7.19.1",
"@babel/register": "^7.18.9",
"@cypress/code-coverage": "^3.10.0",
"@cypress/vue": "^4.2.0",
"@vitejs/plugin-vue": "^4.0.0",
"@vitest/coverage-c8": "^0.27.1",
"@cypress/webpack-preprocessor": "^5.12.2",
"@istanbuljs/nyc-config-babel": "^3.0.0",
"@vue/cli-plugin-babel": "~5.0.8",
"@vue/cli-plugin-e2e-cypress": "^5.0.8",
"@vue/cli-plugin-eslint": "~5.0.8",
"@vue/cli-plugin-unit-mocha": "~5.0.8",
"@vue/cli-service": "~5.0.8",
"@vue/compiler-sfc": "^3.2.39",
"@vue/eslint-config-standard": "^8.0.1",
"@vue/test-utils": "^2.0.2",
"babel-plugin-istanbul": "^6.1.1",
"chai": "^4.3.6",
"concurrently": "^7.4.0",
"cross-env": "^7.0.3",
"cypress": "^12.1.0",
"cypress-vite": "^1.3.0",
"cypress": "^10.8.0",
"eslint": "^8.23.1",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.0.1",
"eslint-plugin-standard": "^5.0.0",
"eslint-plugin-vue": "^9.5.1",
"express": "^4.18.1",
"jsdom": "^21.0.0",
"istanbul-instrumenter-loader": "^3.0.1",
"istanbul-lib-coverage": "^3.2.0",
"json-server": "^0.17.0",
"nodemon": "^2.0.20",
"nyc": "^15.1.0",
"sass": "^1.54.9",
"sass-loader": "^13.0.2",
"sinon": "^14.0.0",
"vite": "^4.0.4",
"vite-plugin-istanbul": "^4.0.0",
"vitest": "^0.27.1"
"webpack": "^5.74.0"
},
"overrides": {
"terser": "^5.14.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" href="/favicon.ico">
<title>Apache Jena Fuseki UI</title>
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
<script type="module" src="/src/main.js"></script>
</html>
2 changes: 1 addition & 1 deletion jena-fuseki2/jena-fuseki-ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</template>

<script>
import Menu from '@/components/Menu.vue'
import Menu from '@/components/Menu'
export default {
name: 'App',
Expand Down
2 changes: 1 addition & 1 deletion jena-fuseki2/jena-fuseki-ui/src/components/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
import { library } from '@fortawesome/fontawesome-svg-core'
import { faDatabase, faCogs, faInfoCircle } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import ServerStatus from '@/components/ServerStatus.vue'
import ServerStatus from '@/components/ServerStatus'
library.add(faDatabase, faCogs, faInfoCircle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
</template>

<script>
import JenaTable from '@/components/dataset/JenaTable.vue'
import JenaTable from '@/components/dataset/JenaTable'
import Pagination from '@/components/dataset/Pagination.vue'
export default {
Expand Down
2 changes: 1 addition & 1 deletion jena-fuseki2/jena-fuseki-ui/src/plugins/toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* A plug-in to replace Bootstrap Vue's Toasts.
*/
import { BUS } from '@/events'
import Toast from '@/components/Toast.vue'
import Toast from '@/components/Toast'

export default {
install (vm) {
Expand Down
22 changes: 11 additions & 11 deletions jena-fuseki2/jena-fuseki-ui/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
*/

import * as VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import NotFound from '@/views/NotFound.vue'
import Home from '../views/Home'
import NotFound from '@/views/NotFound'

const routes = [
{
Expand All @@ -28,54 +28,54 @@ const routes = [
{
path: '/dataset/:datasetName/query',
name: 'DatasetQuery',
component: () => import(/* webpackChunkName: "datasetQuery" */ '../views/dataset/Query.vue'),
component: () => import(/* webpackChunkName: "datasetQuery" */ '../views/dataset/Query'),
props: true
},
{
// JENA-2295: we expand the pattern of this path with an `*` to allow for the YASGUI
// query parameter, e.g. /#/dataset/abc/query?query=SELECT...
path: '/dataset/:datasetName/query*',
name: 'DatasetQueryParameters',
component: () => import(/* webpackChunkName: "datasetQuery" */ '../views/dataset/Query.vue'),
component: () => import(/* webpackChunkName: "datasetQuery" */ '../views/dataset/Query'),
props: true
},
{
path: '/dataset/:datasetName/upload',
name: 'DatasetUpload',
component: () => import(/* webpackChunkName: "datasetUpload" */ '../views/dataset/Upload.vue'),
component: () => import(/* webpackChunkName: "datasetUpload" */ '../views/dataset/Upload'),
props: true
},
{
path: '/dataset/:datasetName/edit',
name: 'DatasetEdit',
component: () => import(/* webpackChunkName: "datasetEdit" */ '../views/dataset/Edit.vue'),
component: () => import(/* webpackChunkName: "datasetEdit" */ '../views/dataset/Edit'),
props: true
},
{
path: '/dataset/:datasetName/info',
name: 'DatasetInfo',
component: () => import(/* webpackChunkName: "datasetInfo" */ '../views/dataset/Info.vue'),
component: () => import(/* webpackChunkName: "datasetInfo" */ '../views/dataset/Info'),
props: true
},
{
path: '/manage',
name: 'ManageDatasets',
component: () => import(/* webpackChunkName: "manageDatasets" */ '../views/manage/ExistingDatasets.vue')
component: () => import(/* webpackChunkName: "manageDatasets" */ '../views/manage/ExistingDatasets')
},
{
path: '/manage/new',
name: 'NewDataset',
component: () => import(/* webpackChunkName: "newDataset" */ '../views/manage/NewDataset.vue')
component: () => import(/* webpackChunkName: "newDataset" */ '../views/manage/NewDataset')
},
{
path: '/manage/tasks',
name: 'Tasks',
component: () => import(/* webpackChunkName: "tasks" */ '../views/manage/Tasks.vue')
component: () => import(/* webpackChunkName: "tasks" */ '../views/manage/Tasks')
},
{
path: '/documentation',
name: 'Help',
component: () => import(/* webpackChunkName: "documentation" */ '../views/Help.vue')
component: () => import(/* webpackChunkName: "documentation" */ '../views/Help')
},
{
path: '/:pathMatch(.*)*',
Expand Down
12 changes: 6 additions & 6 deletions jena-fuseki2/jena-fuseki-ui/src/services/mock/json-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ const startTime = new Date()

// Add custom routes before JSON Server router

// GET PING STATUS
server.get('/\\$/ping', (req, res) => {
res.jsonp(new Date().toISOString())
})

// GET SERVER INFO
server.get('/\\$/server', (req, res) => {
res.jsonp({
Expand Down Expand Up @@ -257,13 +262,8 @@ server.get('/:datasetName', (req, res) => {
})

// PING
// GET PING STATUS
server.get('/\\$/ping', (req, res) => {
res
.status(200)
.jsonp({
body: new Date().toISOString()
})
res.sendStatus(200)
})

// RESET TEST DATA
Expand Down
2 changes: 1 addition & 1 deletion jena-fuseki2/jena-fuseki-ui/src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<script>
import listDatasets from '@/mixins/list-datasets'
import listDatasetsNavigationGuards from '@/mixins/list-datasets-navigation-guards'
import TableListing from '@/components/dataset/TableListing.vue'
import TableListing from '@/components/dataset/TableListing'
import { library } from '@fortawesome/fontawesome-svg-core'
import { faQuestionCircle, faUpload, faTachometerAlt, faEdit } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
Expand Down
Loading

0 comments on commit 9165e43

Please sign in to comment.