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

🚀 refactor(repo): update tooling and cleaning up builds #20

Closed
wants to merge 5 commits into from
Closed
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
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
src/**/*.snap.js
.eslintrc.json
45 changes: 20 additions & 25 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
{
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaVersion": 2019,
"sourceType": "module"
},
"env": {
"es6": true,
"es2017": true,
"commonjs": true,
"browser": true,
"node": true,
"jest/globals": true
"node": true
},
"plugins": [
"jest",
"svelte3"
],
"extends": [
"eslint:recommended"
],
"ignorePatterns": [
"dist",
"lib"
],
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"plugins": ["vitest"],
"extends": ["eslint:recommended", "plugin:vitest/recommended"],
"ignorePatterns": ["**/*.snap.js"],
"overrides": [
{
"files": [
"src/**/*.svelte"
],
"processor": "svelte3/svelte3"
"files": ["*.svelte"],
"parser": "svelte-eslint-parser"
}
]
],
"rules": {
"eqeqeq": "error",
"no-useless-escape": "off",
"no-unused-expressions": "off",
"no-unused-vars": "off",
"no-self-assign": "off",
"no-undef": "off"
}
}
7 changes: 3 additions & 4 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- run: yarn
- run: yarn install:docs
- run: yarn test:integration
- run: npm i
- run: npm run test:integration
- uses: actions/upload-artifact@v2
if: failure()
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- run: yarn
- run: yarn test
- run: npm i
- run: npm test
- uses: actions/upload-artifact@v2
if: failure()
with:
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

# except
!.editorconfig
!.eslintignore
!.eslintrc.json
!.github
!.gitignore
!.gitkeep
!.lintstagedrc.js
!.lintstagedrc
!.node-version
!.npmignore
!.npmrc
Expand All @@ -20,8 +21,8 @@
# generated
.vercel
/node_modules
/lib
/dist
/cypress

# testing
coverage
Expand Down
2 changes: 1 addition & 1 deletion .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"./src/**/*.{js,svelte,md,mdx,json}": ["eslint --fix", "prettier --write"]
"./src/**/*.{test.js,js,json,svelte}": ["eslint -c ./.eslintrc.json --fix", "prettier --write"]
}
4 changes: 0 additions & 4 deletions .npmignore

This file was deleted.

11 changes: 10 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,14 @@
"svelteSortOrder": "options-scripts-markup-styles",
"svelteStrictMode": false,
"svelteBracketNewLine": true,
"svelteAllowShorthand": true
"svelteAllowShorthand": true,
"plugins": ["prettier-plugin-svelte"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
}
28 changes: 28 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { defineConfig } from 'cypress';
import { setupNodeEvents } from './tests/plugins';

export default defineConfig({
fixturesFolder: 'tests/fixtures',
screenshotsFolder: 'tests/artifacts/screenshots',
videosFolder: 'tests/artifacts/videos',
defaultCommandTimeout: 10000,
pageLoadTimeout: 50000,
requestTimeout: 50000,
responseTimeout: 50000,
chromeWebSecurity: false,
viewportHeight: 768,
viewportWidth: 1024,
retries: {
runMode: 3,
openMode: 0,
},
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return setupNodeEvents(on, config);
},
specPattern: 'tests/integration/**/*.spec.{js,jsx,ts,tsx}',
supportFile: 'tests/support/index.js',
}
});
19 changes: 0 additions & 19 deletions cypress.json

This file was deleted.

7 changes: 3 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@svelte-plugins/viewable</title>

<link rel="icon" type="image/png" href="/favicon.png" />
<link rel="stylesheet" href="/global.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/1.4.6/tailwind.min.css" />
<link rel="icon" type="image/png" href="./favicon.png" />
<link rel="stylesheet" type="text/css" href="./src/styles.scss">

<meta name="description" content="A simple rule-based approach to tracking element viewability." />
<meta name="keywords" content="viewability, viewable, tracking, ads, lazy, lazy-loading, svelte, svelte component, intersection observer, observer" />
Expand All @@ -24,7 +23,7 @@
<meta name="twitter:image" content="favicon.png" />
</head>
<body>
<a href="https://github.com/svelte-plugins/viewable" class="github-ribbon"><img loading="lazy" width="149" height="149" src="https://github.blog/wp-content/uploads/2008/12/forkme_right_darkblue_121621.png?resize=149%2C149" class="attachment-full size-full" alt="Fork me on GitHub" data-recalc-dims="1"></a>
<a href="https://github.com/svelte-plugins/viewable" class="github-ribbon"><img loading="lazy" width="300" height="300" src="https://github.blog/wp-content/uploads/2008/12/forkme_right_darkblue_121621.png?resize=300%2C300" class="attachment-full size-full" alt="Fork me on GitHub" data-recalc-dims="1"></a>
<script type="module" src="/src/index.js"></script>
</body>
</html>
Loading
Loading