@promoboxx/react-scripts-vite 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +196 -0
  2. package/package.json +33 -0
package/dist/index.js ADDED
@@ -0,0 +1,196 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.jestConfig = exports.viteConfig = void 0;
7
+ var plugin_react_refresh_1 = __importDefault(require("@vitejs/plugin-react-refresh"));
8
+ var vite_plugin_checker_1 = __importDefault(require("vite-plugin-checker"));
9
+ var vite_plugin_env_compatible_1 = __importDefault(require("vite-plugin-env-compatible"));
10
+ var vite_plugin_svgr_1 = __importDefault(require("vite-plugin-svgr"));
11
+ var vite_react_jsx_1 = __importDefault(require("vite-react-jsx"));
12
+ var vite_tsconfig_paths_1 = __importDefault(require("vite-tsconfig-paths"));
13
+ exports.viteConfig = {
14
+ build: {
15
+ outDir: 'build',
16
+ sourcemap: true,
17
+ },
18
+ plugins: [
19
+ // React specific.
20
+ plugin_react_refresh_1.default(),
21
+ vite_plugin_svgr_1.default(),
22
+ vite_react_jsx_1.default(),
23
+ // import.meta.env -> process.env
24
+ vite_plugin_env_compatible_1.default(),
25
+ // Support TypeScript paths.
26
+ vite_tsconfig_paths_1.default(),
27
+ // Check for issues.
28
+ // TODO
29
+ // https://github.com/fi3ework/vite-plugin-checker/issues/68
30
+ vite_plugin_checker_1.default({
31
+ eslint: {
32
+ files: ['./src'],
33
+ extensions: ['.js', '.jsx', '.ts', '.tsx', '.graphql'],
34
+ // maxWarnings: process.env.CI === 'true' ? 0 : -1,
35
+ },
36
+ typescript: true,
37
+ enableBuild: true,
38
+ }),
39
+ ],
40
+ resolve: {
41
+ alias: {
42
+ // This fixes weird styling issues with material-ui.
43
+ '@material-ui/core': '@material-ui/core/esm',
44
+ '@material-ui/icons': '@material-ui/icons/esm',
45
+ },
46
+ },
47
+ };
48
+ exports.jestConfig = {
49
+ // All imported modules in your tests should be mocked automatically
50
+ // automock: false,
51
+ // Stop running tests after `n` failures
52
+ // bail: 0,
53
+ // The directory where Jest should store its cached dependency information
54
+ // cacheDirectory: "/tmp/jest_rs",
55
+ // Automatically clear mock calls and instances between every test
56
+ clearMocks: true,
57
+ // Indicates whether the coverage information should be collected while executing the test
58
+ // collectCoverage: false,
59
+ // An array of glob patterns indicating a set of files for which coverage information should be collected
60
+ collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}', '!src/**/*.d.ts'],
61
+ // The directory where Jest should output its coverage files
62
+ // coverageDirectory: undefined,
63
+ // An array of regexp pattern strings used to skip coverage collection
64
+ // coveragePathIgnorePatterns: [
65
+ // "/node_modules/"
66
+ // ],
67
+ // Indicates which provider should be used to instrument code for coverage
68
+ coverageProvider: 'v8',
69
+ // A list of reporter names that Jest uses when writing coverage reports
70
+ // coverageReporters: [
71
+ // "json",
72
+ // "text",
73
+ // "lcov",
74
+ // "clover"
75
+ // ],
76
+ // An object that configures minimum threshold enforcement for coverage results
77
+ // coverageThreshold: undefined,
78
+ // A path to a custom dependency extractor
79
+ // dependencyExtractor: undefined,
80
+ // Make calling deprecated APIs throw helpful error messages
81
+ // errorOnDeprecated: false,
82
+ // Force coverage collection from ignored files using an array of glob patterns
83
+ // forceCoverageMatch: [],
84
+ // A path to a module which exports an async function that is triggered once before all test suites
85
+ // globalSetup: undefined,
86
+ // A path to a module which exports an async function that is triggered once after all test suites
87
+ // globalTeardown: undefined,
88
+ // A set of global variables that need to be available in all test environments
89
+ // globals: {},
90
+ // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
91
+ // maxWorkers: "50%",
92
+ // An array of directory names to be searched recursively up from the requiring module's location
93
+ // moduleDirectories: [
94
+ // "node_modules"
95
+ // ],
96
+ // An array of file extensions your modules use
97
+ moduleFileExtensions: [
98
+ 'web.js',
99
+ 'js',
100
+ 'web.ts',
101
+ 'ts',
102
+ 'web.tsx',
103
+ 'tsx',
104
+ 'json',
105
+ 'web.jsx',
106
+ 'jsx',
107
+ 'node',
108
+ 'd.ts',
109
+ ],
110
+ // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
111
+ moduleNameMapper: {
112
+ '^react-native$': 'react-native-web',
113
+ '^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy',
114
+ },
115
+ // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
116
+ // modulePathIgnorePatterns: [],
117
+ // Activates notifications for test results
118
+ // notify: false,
119
+ // An enum that specifies notification mode. Requires { notify: true }
120
+ // notifyMode: "failure-change",
121
+ // A preset that is used as a base for Jest's configuration
122
+ preset: 'ts-jest/presets/js-with-ts',
123
+ // Run tests from one or more projects
124
+ // projects: undefined,
125
+ // Use this configuration option to add custom reporters to Jest
126
+ // reporters: undefined,
127
+ // Automatically reset mock state between every test
128
+ resetMocks: true,
129
+ // Reset the module registry before running each individual test
130
+ // resetModules: false,
131
+ // A path to a custom resolver
132
+ // resolver: undefined,
133
+ // Automatically restore mock state between every test
134
+ // restoreMocks: false,
135
+ // The root directory that Jest should scan for tests and modules within
136
+ // rootDir: undefined,
137
+ // A list of paths to directories that Jest should use to search for files in
138
+ roots: ['<rootDir>/src'],
139
+ // Allows you to use a custom runner instead of Jest's default test runner
140
+ // runner: "jest-runner",
141
+ // The paths to modules that run some code to configure or set up the testing environment before each test
142
+ setupFiles: [require.resolve('react-app-polyfill/jsdom')],
143
+ // A list of paths to modules that run some code to configure or set up the testing framework before each test
144
+ setupFilesAfterEnv: ['src/setupTests'],
145
+ // The number of seconds after which a test is considered as slow and reported as such in the results.
146
+ // slowTestThreshold: 5,
147
+ // A list of paths to snapshot serializer modules Jest should use for snapshot testing
148
+ // snapshotSerializers: [],
149
+ // The test environment that will be used for testing
150
+ testEnvironment: 'jest-environment-jsdom',
151
+ // Options that will be passed to the testEnvironment
152
+ // testEnvironmentOptions: {},
153
+ // Adds a location field to test results
154
+ // testLocationInResults: false,
155
+ // The glob patterns Jest uses to detect test files
156
+ testMatch: [
157
+ '<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}',
158
+ '<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}',
159
+ ],
160
+ // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
161
+ // testPathIgnorePatterns: [
162
+ // "/node_modules/"
163
+ // ],
164
+ // The regexp pattern or array of patterns that Jest uses to detect test files
165
+ // testRegex: [],
166
+ // This option allows the use of a custom results processor
167
+ // testResultsProcessor: undefined,
168
+ // This option allows use of a custom test runner
169
+ testRunner: require.resolve('jest-circus/runner'),
170
+ // This option sets the URL for the jsdom environment. It is reflected in properties such as location.href
171
+ // testURL: "http://localhost",
172
+ // Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"
173
+ // timers: "real",
174
+ // A map from regular expressions to paths to transformers
175
+ transform: {
176
+ '^.+\\.css$': require.resolve('./jest/cssTransform.js'),
177
+ '^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)': require.resolve('./jest/fileTransform.js'),
178
+ },
179
+ // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
180
+ transformIgnorePatterns: [
181
+ '[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$',
182
+ '^.+\\.module\\.(css|sass|scss)$',
183
+ ],
184
+ // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
185
+ // unmockedModulePathPatterns: undefined,
186
+ // Indicates whether each individual test should be reported during the run
187
+ verbose: true,
188
+ // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
189
+ // watchPathIgnorePatterns: [],
190
+ watchPlugins: [
191
+ 'jest-watch-typeahead/filename',
192
+ 'jest-watch-typeahead/testname',
193
+ ],
194
+ // Whether to use watchman for file crawling
195
+ // watchman: true,
196
+ };
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@promoboxx/react-scripts-vite",
3
+ "version": "0.1.0",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "",
11
+ "license": "ISC",
12
+ "devDependencies": {
13
+ "@promoboxx/eslint-config": "^2.5.0",
14
+ "@types/jest": "^27.0.1",
15
+ "prettier": "^2.3.2",
16
+ "typescript": "^4.3.5"
17
+ },
18
+ "dependencies": {
19
+ "@vitejs/plugin-react-refresh": "^1.3.6",
20
+ "eslint": "^7.32.0",
21
+ "jest": "^27.0.6",
22
+ "ts-jest": "^27.0.5",
23
+ "vite": "^2.5.0",
24
+ "vite-plugin-checker": "^0.3.4",
25
+ "vite-plugin-env-compatible": "^1.1.0",
26
+ "vite-plugin-svgr": "^0.4.0",
27
+ "vite-react-jsx": "^1.1.2",
28
+ "vite-tsconfig-paths": "^3.3.13"
29
+ },
30
+ "files": [
31
+ "./dist/index.js"
32
+ ]
33
+ }