Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
feat: rewrite entire code base to vite open-sauced (#140)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: removed astro.build

closes #80
  • Loading branch information
0-vortex authored Mar 4, 2022
1 parent fe3083b commit 570f10f
Show file tree
Hide file tree
Showing 89 changed files with 8,580 additions and 11,394 deletions.
9 changes: 9 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[production]
>0.2%
not dead
not op_mini all

[development]
last 1 chrome version
last 1 firefox version
last 1 safari version
6 changes: 2 additions & 4 deletions .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
PUBLIC_SUPABASE_URL=https://ibcwmlhcimymasokhgvn.supabase.co
PUBLIC_SUPABASE_API_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYyOTkzMDc3OCwiZXhwIjoxOTQ1NTA2Nzc4fQ.zcdbd7kDhk7iNSMo8SjsTaXi0wlLNNQcSZkzZ84NUDg
SITE_URL=http://localhost:3000/
PROD=false
VITE_SUPABASE_URL=https://lkkownkrbkmblczeoyqb.supabase.co
VITE_SUPABASE_API_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJvbGUiOiJhbm9uIiwiaWF0IjoxNjQyNDU2MTc0LCJleHAiOjE5NTgwMzIxNzR9.c6nlkT05GnNacQ6OYuGcjBsILmGsSDwEEtN2zZVXFgY
61 changes: 61 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
process.env.NODE_ENV = "development";

module.exports = {
"root": true,
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:jsx-a11y/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"jsx-a11y",
"import",
"react-hooks",
"@typescript-eslint"
],
"env": {
"browser": true,
"node": true,
"jest": true,
"es2021": true
},
overrides: [
{
files: [
'*.tsx',
'*.ts',
],
},
],
"globals": {
"JSX": "readonly"
},
"settings": {
"react": {
"version": "detect"
},
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
},
"typescript": {}
}
},
"ignorePatterns": [
"__mocks__",
"build",
"public",
"stories",
"/**/node_modules/*"
],
"rules": {
"no-restricted-globals": [1],
},
};
64 changes: 0 additions & 64 deletions .eslintrc.js

This file was deleted.

1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@bdougie
@0-vortex
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,3 @@ build
**/__snapshots__
.env*
!.env

# Supabase
**/supabase/.branches
**/supabase/.temp
**/supabase/.env
12 changes: 12 additions & 0 deletions .jest/cssTransform.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// This is a custom Jest transformer turning style imports into empty objects.
// http://facebook.github.io/jest/docs/en/webpack.html

module.exports = {
process() {
return 'module.exports = {};';
},
getCacheKey() {
// The output is always the same.
return 'cssTransform';
},
};
38 changes: 38 additions & 0 deletions .jest/fileTransform.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const path = require('path');
const camelcase = require('camelcase');

// This is a custom Jest transformer turning file imports into filenames.
// http://facebook.github.io/jest/docs/en/webpack.html

module.exports = {
process(src, filename) {
const assetFilename = JSON.stringify(path.basename(filename));

if (filename.match(/\.svg$/)) {
// Based on how SVGR generates a component name:
// https://github.com/smooth-code/svgr/blob/01b194cf967347d43d4cbe6b434404731b87cf27/packages/core/src/state.js#L6
const pascalCaseFilename = camelcase(path.parse(filename).name, {
pascalCase: true,
});
const componentName = `Svg${pascalCaseFilename}`;
return `const React = require('react');
module.exports = {
__esModule: true,
default: ${assetFilename},
ReactComponent: React.forwardRef(function ${componentName}(props, ref) {
return {
$$typeof: Symbol.for('react.element'),
type: 'svg',
ref: ref,
key: null,
props: Object.assign({}, props, {
children: ${assetFilename}
})
};
}),
};`;
}

return `module.exports = ${assetFilename};`;
},
};
54 changes: 54 additions & 0 deletions .jest/jest.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
const config = {
"rootDir": '../',
"roots": [
'<rootDir>/src'
],
"verbose": true,
"notify": true,
"notifyMode": 'success-change',
"resetMocks": true,
"testEnvironment": 'jsdom',
"setupFilesAfterEnv": [
'<rootDir>/.jest/setupTests.ts'
],
"testMatch": [
'<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}',
'<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}'
],
"transform": {
'^.+\\.[jt]sx?$': 'esbuild-jest',
'^.+\\.css$': '<rootDir>/.jest/cssTransform.cjs',
'^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)': '<rootDir>/.jest/fileTransform.cjs',
},
"transformIgnorePatterns": [
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$',
'^.+\\.module\\.(css|sass|scss)$',
],
"moduleFileExtensions": ['js', 'mjs', 'jsx', 'ts', 'tsx', 'json'],
"moduleNameMapper": {
'^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy',
},
"watchPlugins": [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
],
"collectCoverageFrom": [
'<rootDir>/src/**/*.{js,jsx,ts,tsx}',
'!src/**/*.d.ts',
'!src/(icons|illustrations|images|logos|styles|tests)/**/*'
],
"coverageThreshold": {
'global': {
'branches': 30,
'functions': 30,
'lines': 30,
'statements': 30
}
},
"coverageReporters": [
'text',
'text-summary'
],
}

module.exports = config
51 changes: 0 additions & 51 deletions .jest/jest.config.js

This file was deleted.

27 changes: 0 additions & 27 deletions .jest/jsxTransform.js

This file was deleted.

3 changes: 2 additions & 1 deletion .jest/setupTests.js → .jest/setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import "@testing-library/jest-dom";
import '@testing-library/jest-dom';
import 'whatwg-fetch';
Loading

0 comments on commit 570f10f

Please sign in to comment.