Skip to content

Commit aafab1d

Browse files
authored
Use Vite builder (#2300)
* vite builder initial * save * add displayName * add paragraph from npm * fix postcss apply * remove some packages, fix tests * Update cypress.yml * remove logs * remove unused packages * update path to image * update * Update index.html * Update cypress.yml * Update cypress.yml * Update cypress.yml * remove displayName field * update names * Update index.ts * Update index.ts * update packages * remove packages * postcss preserve: true * Update index.html * Update editor-modules.d.ts * use public dir for static * Update vite.config.js * update modules type * Update CHANGELOG.md
1 parent 0491155 commit aafab1d

32 files changed

Lines changed: 2416 additions & 4935 deletions

.babelrc

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/cypress.yml

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,21 @@
1-
name: Tests
1+
name: Cypress
2+
23
on: [pull_request]
4+
35
jobs:
4-
firefox:
6+
run-tests:
7+
strategy:
8+
matrix:
9+
browser: [firefox, chrome, edge]
10+
511
runs-on: ubuntu-latest
612
steps:
713
- uses: actions/setup-node@v3
814
with:
915
node-version: 16
1016
- uses: actions/checkout@v3
11-
- run: yarn ci:pull_paragraph
1217
- uses: cypress-io/github-action@v5
1318
with:
1419
config: video=false
15-
browser: firefox
16-
build: yarn build
17-
chrome:
18-
runs-on: ubuntu-latest
19-
steps:
20-
- uses: actions/setup-node@v3
21-
with:
22-
node-version: 16
23-
- uses: actions/checkout@v3
24-
- run: yarn ci:pull_paragraph
25-
- uses: cypress-io/github-action@v5
26-
with:
27-
config: video=false
28-
browser: chrome
29-
build: yarn build
30-
edge:
31-
runs-on: ubuntu-latest
32-
steps:
33-
- uses: actions/setup-node@v3
34-
with:
35-
node-version: 16
36-
- uses: actions/checkout@v3
37-
- run: yarn ci:pull_paragraph
38-
- uses: cypress-io/github-action@v5
39-
with:
40-
config: video=false
41-
browser: edge
20+
browser: ${{ matrix.browser }}
4221
build: yarn build

.github/workflows/eslint.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ jobs:
1919
${{ runner.OS }}-build-
2020
${{ runner.OS }}-
2121
22-
- run: yarn install
23-
22+
- run: yarn
2423
- run: yarn lint

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
[submodule "example/tools/simple-image"]
1717
path = example/tools/simple-image
1818
url = https://github.com/editor-js/simple-image
19-
[submodule "src/tools/paragraph"]
20-
path = src/tools/paragraph
21-
url = https://github.com/editor-js/paragraph
2219
[submodule "example/tools/marker"]
2320
path = example/tools/marker
2421
url = https://github.com/editor-js/marker

.postcssrc.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
plugins:
2-
# Consumes files by @import rule
3-
# https://github.com/postcss/postcss-import
4-
postcss-import: {}
5-
62
# Apply custom property sets via @apply rule
73
# https://github.com/pascalduez/postcss-apply
84
postcss-apply: {}
@@ -26,24 +22,10 @@ plugins:
2622
# https://github.com/csstools/postcss-preset-env#preserve
2723
preserve: false
2824

29-
# Enable or disable specific polyfills
30-
# https://github.com/csstools/postcss-preset-env#features
31-
#
32-
# List of available plugins
33-
# https://github.com/csstools/postcss-preset-env/blob/master/src/lib/plugins-by-id.js
34-
features:
35-
# Modify colors using the color-mod() function in CSS
36-
# https://github.com/jonathantneal/postcss-color-mod-function
37-
color-mod-function: {}
38-
3925
# Nested rules unwrapper
4026
# https://github.com/postcss/postcss-nested
4127
#
4228
# As you know 'postcss-preset-env' plugin has an ability to process
4329
# 'postcss-nesting' feature but it does not work with BEM
4430
# Report: https://github.com/csstools/postcss-preset-env/issues/40
4531
postcss-nested: {}
46-
47-
# Compression tool
48-
# https://github.com/cssnano/cssnano
49-
cssnano: {}

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- `Fix`*ToolsAPI*`pasteConfig` getter with `false` value could be used to disable paste handling by Editor.js core. Could be useful if your tool has its own paste handler.
1515
- `Improvement`*Dependencies* — Upgrade Cypress to v12, upgrade related libraries to latest versions.
1616
- `CI` — Use Ubuntu container for Edge tests runner.
17+
- `Improvement` — Use Vite as build system instead of Webpack.
1718

1819
### 2.26.5
1920

example/example-dev.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<meta charset="UTF-8">
1111
<title>Editor.js 🤩🧦🤨 example</title>
1212
<link href="https://fonts.googleapis.com/css?family=PT+Mono" rel="stylesheet">
13-
<link href="assets/demo.css" rel="stylesheet">
14-
<script src="assets/json-preview.js"></script>
13+
<link href="../public/assets/demo.css" rel="stylesheet">
14+
<script src="../public/assets/json-preview.js"></script>
1515
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
1616
</head>
1717
<body>
@@ -107,7 +107,7 @@
107107
<script src="./tools/inline-code/dist/bundle.js"></script><!-- Inline Code -->
108108

109109
<!-- Load Editor.js's Core -->
110-
<script src="../dist/editor.js" onload="document.getElementById('hint-core').hidden = true;"></script>
110+
<script src="../dist/editorjs.umd.js" onload="document.getElementById('hint-core').hidden = true;"></script>
111111

112112
<!-- Initialization -->
113113
<script>

example/example-i18n.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<meta charset="UTF-8">
1111
<title>Editor.js 🤩🧦🤨 example</title>
1212
<link href="https://fonts.googleapis.com/css?family=PT+Mono" rel="stylesheet">
13-
<link href="assets/demo.css" rel="stylesheet">
14-
<script src="assets/json-preview.js"></script>
13+
<link href="../public/assets/demo.css" rel="stylesheet">
14+
<script src="../public/assets/json-preview.js"></script>
1515
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
1616
</head>
1717
<body>
@@ -61,7 +61,7 @@
6161
<script src="https://cdn.jsdelivr.net/npm/@editorjs/inline-code@latest"></script><!-- Inline Code -->
6262

6363
<!-- Load Editor.js's Core -->
64-
<script src="../dist/editor.js" onload="document.getElementById('hint-core').hidden = true"></script>
64+
<script src="../dist/editorjs.umd.js" onload="document.getElementById('hint-core').hidden = true"></script>
6565

6666
<!-- Initialization -->
6767
<script>

example/example-multiple.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<head>
1010
<meta charset="UTF-8">
1111
<title>Editor.js 🤩🧦🤨 example: Multiple instances</title>
12-
<link href="assets/demo.css" rel="stylesheet">
12+
<link href="../public/assets/demo.css" rel="stylesheet">
1313
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
1414
</head>
1515
<body>
@@ -41,7 +41,7 @@
4141
</div>
4242

4343
<!-- Load Editor.js's Core -->
44-
<script src="../dist/editor.js" onload="document.getElementById('hint-core').hidden = true"></script>
44+
<script src="../dist/editorjs.umd.js" onload="document.getElementById('hint-core').hidden = true"></script>
4545
<script src="./tools/header/dist/bundle.js"></script><!-- Header -->
4646

4747
<!-- Initialization -->

example/example-popup.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<head>
1010
<meta charset="UTF-8">
1111
<title>Editor.js 🤩🧦🤨 example: Popup</title>
12-
<link href="assets/demo.css" rel="stylesheet">
12+
<link href="../public/assets/demo.css" rel="stylesheet">
1313
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
1414
</head>
1515
<body>
@@ -111,7 +111,7 @@ <h2>
111111
</div>
112112

113113
<!-- Load Editor.js's Core -->
114-
<script src="../dist/editor.js" onload="document.getElementById('hint-core').hidden = true"></script>
114+
<script src="../dist/editorjs.umd.js" onload="document.getElementById('hint-core').hidden = true"></script>
115115
<script src="./tools/header/dist/bundle.js"></script><!-- Header -->
116116

117117
<!-- Initialization -->

0 commit comments

Comments
 (0)