Skip to content

Commit 1b8ce38

Browse files
authored
development environment upgrades (#6059)
* init work to upgrade node and linting * feat: add jest-environment-jsdom * test: refactor remove unused before * fix: add option chain for frame * test: use correct jest spy * skip jsdom broken tests * config: * * config: ignore dist in linting * format: apply transformations * remove repeated config
1 parent 3d1e354 commit 1b8ce38

File tree

231 files changed

+38759
-5955
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

231 files changed

+38759
-5955
lines changed

.editorconfig

-18
This file was deleted.

.eslintrc

-26
This file was deleted.

.eslintrc.js

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
module.exports = {
2+
root: true, // Add this to indicate this is the root ESLint configuration
3+
env: {
4+
browser: true,
5+
node: true,
6+
'jest/globals': true,
7+
},
8+
globals: {
9+
$: true,
10+
grapesjs: true,
11+
},
12+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
13+
plugins: ['@typescript-eslint', 'jest'],
14+
parserOptions: {
15+
ecmaVersion: 2021,
16+
sourceType: 'module',
17+
},
18+
rules: {
19+
'no-var': 'off',
20+
'prefer-const': 'off',
21+
'no-prototype-builtins': 'off',
22+
'no-useless-escape': 'off',
23+
'prefer-rest-params': 'off',
24+
'no-empty': 'off',
25+
'prefer-spread': 'off',
26+
'no-extra-boolean-cast': 'off',
27+
'no-unsafe-optional-chaining': 'off',
28+
'no-shadow-restricted-names': 'off',
29+
'no-cond-assign': 'off',
30+
'no-fallthrough': 'off',
31+
'no-sparse-arrays': 'off',
32+
'no-redeclare': 'off',
33+
'no-control-regex': 'off',
34+
'no-constant-condition': 'off',
35+
'no-misleading-character-class': 'off',
36+
'no-undef': 'off',
37+
'no-func-assign': 'off',
38+
'no-regex-spaces': 'off',
39+
'@typescript-eslint/ban-ts-comment': 'off',
40+
'@typescript-eslint/no-require-imports': 'off',
41+
'@typescript-eslint/no-explicit-any': 'off',
42+
'@typescript-eslint/no-unused-vars': 'off',
43+
'@typescript-eslint/no-unused-expressions': 'off',
44+
'@typescript-eslint/no-unnecessary-type-const': 'off',
45+
'@typescript-eslint/no-empty-object-type': 'off',
46+
'@typescript-eslint/no-unnecessary-type-constraint': 'off',
47+
'@typescript-eslint/no-this-alias': 'off',
48+
'@typescript-eslint/no-unsafe-function-type': 'off',
49+
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
50+
'@typescript-eslint/no-wrapper-object-types': 'off',
51+
'linebreak-style': ['error', 'unix'],
52+
'max-len': ['error', { code: 300 }],
53+
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 1 }],
54+
},
55+
ignorePatterns: ['docs/api/*', 'dist/*'],
56+
};

.github/ISSUE_TEMPLATE/1.bug_report.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: 🐞 Bug report
22
description: Create a bug report for GrapesJS.
3-
title: "BUG: "
3+
title: 'BUG: '
44
labels: []
55
body:
66
- type: markdown
@@ -61,4 +61,4 @@ body:
6161
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/artf/grapesjs/blob/dev/CODE_OF_CONDUCT.md)
6262
options:
6363
- label: I agree to follow this project's Code of Conduct
64-
required: true
64+
required: true

.github/ISSUE_TEMPLATE/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ contact_links:
88
about: 'If you have a question or need help, ask a question on the discussion forums.'
99
- name: 📢 Show and tell
1010
url: https://github.com/artf/grapesjs/discussions/new?category=show-and-tell
11-
about: "Have something nice to say or share about GrapesJS? We'd love to hear it!"
11+
about: "Have something nice to say or share about GrapesJS? We'd love to hear it!"

.github/lock.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ lockComment: >
2323
2424
# Assign `resolved` as the reason for locking. Set to `false` to disable
2525
setLockReason: true
26-
2726
# Limit to only `issues` or `pulls`
2827
# only: issues
2928

@@ -37,4 +36,4 @@ setLockReason: true
3736
# daysUntilLock: 30
3837

3938
# Repository to extend settings from
40-
# _extends: repo
39+
# _extends: repo

.github/workflows/publish.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ jobs:
99
if: ${{ false }}
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
13-
- uses: actions/setup-node@v3
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
1414
with:
15-
node-version: '12.x'
15+
node-version: '20.x'
1616
registry-url: 'https://registry.npmjs.org'
1717
cache: 'yarn'
1818
- run: yarn --frozen-lockfile
1919
- run: yarn build
20-
- run: npm run lint
2120
- run: npm publish
2221
env:
23-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
22+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/build.yml .github/workflows/quailty.yml

+10-8
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,29 @@ name: Tests
22

33
on:
44
push:
5-
branches: [ dev ]
5+
branches: [dev]
66
pull_request:
7-
branches: [ dev ]
7+
branches: [dev]
88

99
jobs:
10-
build:
10+
quailty:
1111
runs-on: ubuntu-latest
1212

1313
strategy:
1414
matrix:
15-
node-version: [14.17, 16.x]
15+
node-version: [18.x, 20.x]
1616

1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919
- name: Use Node.js ${{ matrix.node-version }}
20-
uses: actions/setup-node@v3
20+
uses: actions/setup-node@v4
2121
with:
2222
node-version: ${{ matrix.node-version }}
2323
cache: 'yarn'
2424
- run: yarn --frozen-lockfile
25-
- run: yarn build
2625
- run: npm run lint
26+
- run: npm run lint:ts
27+
- run: npm run format:check
28+
- run: yarn build
2729
- run: npm run ts:build:check
28-
- run: npm test
30+
- run: npm test

.prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
docs/api/*.md
2+
dist/

.prettierrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"endOfLine": "lf",
3+
"insertPragma": false,
4+
"requirePragma": false,
5+
"trailingComma": "all",
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"singleQuote": true,
9+
"printWidth": 120
10+
}

CODE_OF_CONDUCT.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ In the interest of fostering an open and welcoming environment, we as contributo
88

99
Examples of behavior that contributes to creating a positive environment include:
1010

11-
* Using welcoming and inclusive language
12-
* Being respectful of differing viewpoints and experiences
13-
* Gracefully accepting constructive criticism
14-
* Focusing on what is best for the community
15-
* Showing empathy towards other community members
11+
- Using welcoming and inclusive language
12+
- Being respectful of differing viewpoints and experiences
13+
- Gracefully accepting constructive criticism
14+
- Focusing on what is best for the community
15+
- Showing empathy towards other community members
1616

1717
Examples of unacceptable behavior by participants include:
1818

19-
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20-
* Trolling, insulting/derogatory comments, and personal or political attacks
21-
* Public or private harassment
22-
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23-
* Other conduct which could reasonably be considered inappropriate in a professional setting
19+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
- Trolling, insulting/derogatory comments, and personal or political attacks
21+
- Public or private harassment
22+
- Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
- Other conduct which could reasonably be considered inappropriate in a professional setting
2424

2525
## Our Responsibilities
2626

CONTRIBUTING.md

+2-9
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
First of all, thank you for considering contributing to GrapesJS!
66

77
We welcome any type of contribution, not only code. Like for example:
8+
89
- **QA**: file bug reports, the more details you can give the better (e.g. screenshots with the console open)
910
- **Marketing**: writing blog posts, howto's, tutorials, etc.
1011
- **Community**: presenting the project at meetups, organizing a dedicated meetup for the local community, etc.
1112
- **Money**: We welcome financial contributions in full transparency on our [Open Collective].
1213

13-
1414
## Setting up the repository
1515

1616
This is a Node.js project and you need to have Node.js installed on your machine. You can download it from [here](https://nodejs.org/). We test versions 14 and 16 of Node in the CI, so it's recommended to use one of these versions, or the latest of: 16.20.2
@@ -45,7 +45,6 @@ Navigate to `http://localhost:8080/` to see the editor in action. The developmen
4545

4646
Working on your first Pull Request? You can learn how from this **free** series, [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github).
4747

48-
4948
## Submitting code
5049

5150
Any code change should be submitted as a pull request. Before start working on something make always a search in opened issues and pull requests, this might help you to avoid wasting time.
@@ -54,29 +53,23 @@ A pull request could be a bug fix, new feature and much more, but in all cases,
5453

5554
The title should be brief but comprehensive, the description contains a link to the opened issue and the proposed solution. The pull request should contain tests whenever possible. Keep in mind that the bigger is the pull request, the longer it will take to review and merge. Try to break down large pull requests in smaller chunks that are easier to review and merge.
5655

57-
5856
## Styleguide
5957

6058
The code is auto formatted with [prettier](https://github.com/prettier/prettier) on any commit, therefore you can write in any style you prefer
6159

62-
6360
## Expenses
6461

6562
Anyone can file an expense (code, marketing, etc.) via our [Open Collective]. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed.
6663

6764
Before submitting an expense contact core contributors via the current active chat room ([Discord](https://discord.gg/QAbgGXq)) and explain your intents
6865

69-
7066
## Questions
7167

7268
If you have any questions, create an [issue](https://github.com/GrapesJS/grapesjs/issues) (protip: do a quick search first to see if someone else didn't ask the same question before!).
7369

74-
75-
7670
## Credits
7771

7872
Thank you to all the people who have already contributed to GrapesJS!
7973
<a href="/GrapesJS/grapesjs/graphs/contributors"><img src="https://opencollective.com/grapesjs/contributors.svg?width=890" /></a>
8074

81-
82-
[Open Collective]: <https://opencollective.com/grapesjs>
75+
[Open Collective]: https://opencollective.com/grapesjs

0 commit comments

Comments
 (0)