Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modeler vite upgrade #1802

Open
wants to merge 16 commits into
base: next
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules/
dist/
husky/
cypress/
cypress-coverage/
jest-coverage
public/
test_summary_reports/
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ jobs:
uses: cypress-io/github-action@v6
with:
install: true
start: npm run serve
wait-on: http://localhost:8080/
start: npm run dev
wait-on: http://localhost:5173/
config-file: cypress.config.js
spec: "tests/e2e/specs/**/*"
record: true
Expand Down
File renamed without changes.
33 changes: 33 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh

# =================================================================
# Check that we never commit a .only on a test
# Also check that we never pass a --spec directive in package.json
# =================================================================

stagedFiles=$(git status --porcelain | grep '^M' | awk '{print $2}')

for file in $stagedFiles; do
if [[ $file == "checkForOnly.sh" ]]; then
continue
fi

if [[ $file == "package.json" ]]; then
specDirectiveCount=$(grep "\-\-spec" package.json | wc -l)
if [[ $specDirectiveCount -gt 0 ]]; then
echo "package.json contains a spec directive."
exit 255
else
echo "package.json is OK"
fi
fi

numberOfOnlys=$(grep "\.only" $file | wc -l)
if [[ $numberOfOnlys -gt 0 ]]; then
echo "$file contains .only(s)"
grep -n "\.only" $file --color=auto
exit 255
fi
done

echo "No staged files contain .only"
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run lint
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16-alpine
FROM node:20-alpine

RUN apk add python3 make g++\
&& rm -rf /var/cache/apk/*
Expand All @@ -11,4 +11,4 @@ RUN npm install

COPY . .

EXPOSE 8080
EXPOSE 5173
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset',
'@babel/preset-env',
],
plugins: ['istanbul'],
sourceType: 'unambiguous',
Expand Down
6 changes: 3 additions & 3 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ module.exports = defineConfig({
setupNodeEvents(on, config) {
return require('./tests/e2e/plugins/index.js')(on, config);
},
baseUrl: 'http://localhost:8080',
baseUrl: 'http://localhost:5173',
specPattern: 'tests/e2e/specs/**/*.cy.{js,jsx,ts,tsx}',
supportFile: 'tests/e2e/support/index.js',
},

component: {
devServer: {
framework: 'vue-cli',
bundler: 'webpack',
framework: 'vue',
bundler: 'vite',
},
},
});
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
build:
dockerfile: Dockerfile
ports:
- "8080:8080"
- "5173:5173"
volumes:
- .:/app
- /app/node_modules
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion public/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="icon" href="favicon.ico">
<title>modeler</title>
</head>
<body>
Expand All @@ -13,5 +13,6 @@
</noscript>
<div id="modeler-app"></div>
<!-- built files will be auto injected -->
<script src="src/main.js" type="module"></script>
</body>
</html>
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@ module.exports = {
collectCoverage: false,
coverageDirectory: 'jest-coverage',
testEnvironment: 'jsdom',
preset: '@vue/cli-plugin-unit-jest',
};
Loading
Loading