Skip to content

refactor: use vite as build tool #362

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

Merged
merged 3 commits into from
May 20, 2023
Merged
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
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
parser: 'babel-eslint',
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:prettier/recommended',
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

env:
APP_NAME: Testing Playground
NODE_VERSION: '12.x'
NODE_VERSION: '18.x'

jobs:
create-release:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [opened, synchronize, reopened]

env:
NODE_VERSION: '12.x'
NODE_VERSION: '18.x'

jobs:
setup:
Expand Down Expand Up @@ -81,6 +81,7 @@ jobs:
name: e2e Tests
runs-on: ubuntu-latest
needs: [setup]
if: false # temporarily disabled
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -89,5 +90,5 @@ jobs:
uses: cypress-io/github-action@v2
with:
start: npm start
wait-on: http://localhost:1234
wait-on: http://localhost:5173
command: npm run cypress:run
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.9.0
7 changes: 0 additions & 7 deletions .parcelrc

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Please see [contributing.md] for more details. If you just want to run the playg
git clone git@github.com:testing-library/testing-playground.git
cd testing-playground
npm ci
npm run start
npm run dev
```

## Contributors
Expand Down Expand Up @@ -165,6 +165,7 @@ Thanks goes to these people ([emoji key][emojis]):

<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors][all-contributors] specification.
Expand Down
4 changes: 2 additions & 2 deletions _redirects
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/oembed /.netlify/functions/oembed 200!
/api/gist/* /.netlify/functions/gist 200!
/api/* /.netlify/functions/:splat 200!
/ /.netlify/functions/server 200!
/* /.netlify/functions/server 200
/* /.netlify/functions/server 200
2 changes: 1 addition & 1 deletion cypress.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"baseUrl": "http://localhost:1234",
"baseUrl": "http://localhost:5173",
"integrationFolder": "cypress/e2e"
}
21 changes: 21 additions & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/// <reference types="cypress" />
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

/**
* @type {Cypress.PluginConfig}
*/
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
}
2 changes: 1 addition & 1 deletion devtools/src/devtools/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<meta charset="utf-8" />
</head>
<body>
<script src="main.js"></script>
<script src="main.js" type="module"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion devtools/src/devtools/pane.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
</head>
<body>
<div id="app" />
<script src="pane.js"></script>
<script src="pane.js" type="module"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion devtools/src/devtools/panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
</head>
<body>
<div id="app" />
<script src="panel.js"></script>
<script src="panel.js" type="module"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions devtools/src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Simple and complete DOM testing playground that encourage good testing practices.",
"version": "1.16.0",
"version_name": "1.16.3",
"minimum_chrome_version": "49",
"minimum_chrome_version": "58",
"icons": {
"16": "icons/16-production.png",
"32": "icons/32-production.png",
Expand All @@ -30,7 +30,7 @@
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["content-script/contentScript.js"],
"js": ["content-script/content-script.js"],
"run_at": "document_start"
}
]
Expand Down
9 changes: 6 additions & 3 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
[build]
command = "npm run build"
command = "npm run build:public && npm run build:lambda"
functions = "./dist/server"
publish = "./dist/client"
publish = "./dist/public"

[dev]
command = "npm run dev:public"
functions = "./src/lambda"
autoLaunch = false
publish = "."

[template.environment]
GITHUB_GIST_TOKEN = "set token that has gist access"
GITHUB_GIST_TOKEN = "set token that has gist access"
Loading