Skip to content

Commit 5e114c7

Browse files
committed
Updated dependencies, broke some unit tests
1 parent 2d7981b commit 5e114c7

15 files changed

+4952
-4331
lines changed

.eslint.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
extends: [
3+
'react-app',
4+
// 'prettier/@typescript-eslint',
5+
// 'plugin:prettier/recommended',
6+
],
7+
};

.eslintrc.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@imaginelearning:registry=https://npm.pkg.github.com
2+
@fortawesome:registry=https://npm.fontawesome.com/
3+
//npm.fontawesome.com/:_authToken=820A812E-C4FC-4313-848E-CC4965165F1E

.vscode/settings.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"workbench.colorCustomizations": {
3+
"activityBar.activeBackground": "#67eb62",
4+
"activityBar.background": "#67eb62",
5+
"activityBar.foreground": "#15202b",
6+
"activityBar.inactiveForeground": "#15202b99",
7+
"activityBarBadge.background": "#7276ed",
8+
"activityBarBadge.foreground": "#15202b",
9+
"commandCenter.border": "#15202b99",
10+
"sash.hoverBorder": "#67eb62",
11+
"sideBar.border": "#67eb62",
12+
"statusBar.background": "#3be535",
13+
"statusBar.border": "#3be535",
14+
"statusBar.foreground": "#15202b",
15+
"statusBarItem.hoverBackground": "#20cd1a",
16+
"statusBarItem.remoteBackground": "#3be535",
17+
"statusBarItem.remoteForeground": "#15202b",
18+
"titleBar.activeBackground": "#3be535",
19+
"titleBar.activeForeground": "#15202b",
20+
"titleBar.border": "#3be535",
21+
"titleBar.inactiveBackground": "#3be53599",
22+
"titleBar.inactiveForeground": "#15202b99"
23+
},
24+
"peacock.color": "#3be535"
25+
}

package.json

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tsdx",
3-
"version": "0.14.1",
3+
"version": "0.15.0",
44
"author": "Jared Palmer <[email protected]>",
55
"description": "Zero-config TypeScript package development",
66
"license": "MIT",
@@ -38,26 +38,29 @@
3838
"templates"
3939
],
4040
"engines": {
41-
"node": ">=14"
41+
"node": ">=16"
4242
},
4343
"dependencies": {
4444
"@babel/core": "^7.4.4",
4545
"@babel/helper-module-imports": "^7.0.0",
4646
"@babel/parser": "^7.11.5",
47-
"@babel/plugin-proposal-class-properties": "^7.4.4",
47+
"@babel/plugin-transform-class-properties": "^7.23.3",
4848
"@babel/preset-env": "^7.11.0",
4949
"@babel/traverse": "^7.11.5",
50-
"@rollup/plugin-babel": "^5.1.0",
51-
"@rollup/plugin-commonjs": "^19.0.0",
52-
"@rollup/plugin-json": "^4.0.0",
53-
"@rollup/plugin-node-resolve": "^13.0.0",
54-
"@rollup/plugin-replace": "^2.2.1",
55-
"@types/jest": "^26.0.24",
56-
"@typescript-eslint/eslint-plugin": "^4.28.2",
57-
"@typescript-eslint/parser": "^4.28.2",
50+
"@edugis/rollup-plugin-sourcemaps": "0.6.4",
51+
"@rollup/plugin-babel": "^6.0.4",
52+
"@rollup/plugin-commonjs": "^25.0.7",
53+
"@rollup/plugin-json": "^6.1.0",
54+
"@rollup/plugin-node-resolve": "^15.2.3",
55+
"@rollup/plugin-replace": "^5.0.5",
56+
"@rollup/plugin-terser": "^0.4.4",
57+
"@types/jest": "^29.5.11",
58+
"@typescript-eslint/eslint-plugin": "^6.2.0",
59+
"@typescript-eslint/parser": "^6.2.0",
5860
"ansi-escapes": "^4.2.1",
5961
"asyncro": "^3.0.0",
6062
"babel-eslint": "^10.0.3",
63+
"babel-jest": "^29.7.0",
6164
"babel-plugin-annotate-pure-calls": "^0.4.0",
6265
"babel-plugin-dev-expression": "^0.2.1",
6366
"babel-plugin-macros": "^3.1.0",
@@ -66,61 +69,60 @@
6669
"camelcase": "^6.0.0",
6770
"chalk": "^4.0.0",
6871
"enquirer": "^2.3.4",
69-
"eslint": "^7.30.0",
70-
"eslint-config-prettier": "^6.0.0",
71-
"eslint-config-react-app": "^6.0.0",
72-
"eslint-plugin-flowtype": "^5.8.0",
72+
"eslint": "^8.56.0",
73+
"eslint-config-react-app": "^7.0.0",
74+
"eslint-plugin-flowtype": "^8.0.3",
7375
"eslint-plugin-import": "^2.18.2",
7476
"eslint-plugin-jsx-a11y": "^6.2.3",
75-
"eslint-plugin-prettier": "^3.1.0",
77+
"eslint-plugin-prettier": "^5.1.0",
7678
"eslint-plugin-react": "^7.14.3",
7779
"eslint-plugin-react-hooks": "^4.2.0",
7880
"execa": "^5.1.1",
7981
"fs-extra": "^10.0.0",
80-
"jest": "^27.0.6",
81-
"jest-watch-typeahead": "^0.6.4",
82+
"jest": "^29.7.0",
83+
"jest-watch-typeahead": "^2.2.2",
8284
"jpjs": "^1.2.1",
8385
"lodash.merge": "^4.6.2",
8486
"ora": "^5.4.1",
8587
"pascal-case": "^3.1.1",
86-
"prettier": "^2.3.2",
88+
"prettier": "^3.2.4",
8789
"progress-estimator": "^0.3.0",
8890
"regenerator-runtime": "^0.13.7",
89-
"rollup": "^2.52.8",
90-
"rollup-plugin-sourcemaps": "^0.6.2",
91-
"rollup-plugin-terser": "^7.0.2",
92-
"rollup-plugin-typescript2": "^0.30.0",
91+
"rollup": "^4.9.6",
92+
"rollup-plugin-typescript2": "^0.36.0",
9393
"sade": "^1.4.2",
9494
"semver": "^7.1.1",
9595
"shelljs": "^0.8.3",
9696
"tiny-glob": "^0.2.6",
97-
"ts-jest": "^27.0.3",
97+
"ts-jest": "^29.1.2",
9898
"tslib": "^2.3.0",
99-
"typescript": "^4.3.5"
99+
"typescript": "^5.3.3"
100100
},
101101
"devDependencies": {
102-
"@types/eslint": "^7.2.14",
102+
"@types/eslint": "^8.56.2",
103103
"@types/fs-extra": "^9.0.1",
104104
"@types/lodash": "^4.14.161",
105-
"@types/node": "^16.0.1",
106-
"@types/react": "^17.0.14",
105+
"@types/node": "^20.11.10",
106+
"@types/react": "^18.2.48",
107+
"@types/react-dom": "^18.2.18",
107108
"@types/rollup-plugin-json": "^3.0.2",
108109
"@types/sade": "^1.6.0",
109110
"@types/semver": "^7.1.0",
110111
"@types/shelljs": "^0.8.5",
111112
"@types/styled-components": "^5.0.1",
112-
"autoprefixer": "^9.7.4",
113+
"autoprefixer": "^10.4.17",
113114
"babel-plugin-replace-identifiers": "^0.1.1",
114-
"cssnano": "^4.1.10",
115+
"cssnano": "^6.0.3",
115116
"doctoc": "^2.0.1",
116117
"husky": "^7.0.1",
117118
"np": "^7.5.0",
119+
"postcss": "^8.4.33",
118120
"pretty-quick": "^3.1.1",
119-
"react": "^17.0.2",
120-
"react-dom": "^17.0.2",
121-
"react-is": "^17.0.2",
122-
"rollup-plugin-postcss": "^2.5.0",
123-
"styled-components": "^5.0.1",
121+
"react": "^18.2.0",
122+
"react-dom": "^18.2.0",
123+
"react-is": "^18.2.0",
124+
"rollup-plugin-postcss": "^4.0.2",
125+
"styled-components": "^6.1.8",
124126
"tiny-invariant": "^1.1.0",
125127
"tiny-warning": "^1.0.3",
126128
"yarn-deduplicate": "^3.1.0"

src/createEslintConfig.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import fs from 'fs-extra';
22
import path from 'path';
3-
import { CLIEngine } from 'eslint';
3+
import { ESLint } from 'eslint';
44
import { PackageJson } from './types';
55
import { getReactVersion } from './utils';
66

@@ -13,14 +13,14 @@ export async function createEslintConfig({
1313
pkg,
1414
rootDir,
1515
writeFile,
16-
}: CreateEslintConfigArgs): Promise<CLIEngine.Options['baseConfig'] | void> {
16+
}: CreateEslintConfigArgs): Promise<ESLint.Options['baseConfig'] | void> {
1717
const isReactLibrary = Boolean(getReactVersion(pkg));
1818

1919
const config = {
2020
extends: [
2121
'react-app',
22-
'prettier/@typescript-eslint',
23-
'plugin:prettier/recommended',
22+
// 'prettier/@typescript-eslint',
23+
// 'plugin:prettier/recommended',
2424
],
2525
settings: {
2626
react: {
@@ -41,8 +41,8 @@ export async function createEslintConfig({
4141
`module.exports = ${JSON.stringify(config, null, 2)}`,
4242
{ flag: 'wx' }
4343
);
44-
} catch (e) {
45-
if (e.code === 'EEXIST') {
44+
} catch (e: any) {
45+
if (e?.code === 'EEXIST') {
4646
console.error(
4747
'Error trying to save the Eslint configuration file:',
4848
`${file} already exists.`

src/createJestConfig.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ export function createJestConfig(
1414
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$'],
1515
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
1616
collectCoverageFrom: ['src/**/*.{ts,tsx,js,jsx}'],
17+
testEnvironment: 'jsdom',
18+
testEnvironmentOptions: {
19+
url: 'https://localhost/',
20+
},
1721
testMatch: ['<rootDir>/**/*.(spec|test).{ts,tsx,js,jsx}'],
18-
testURL: 'http://localhost',
1922
rootDir,
2023
watchPlugins: [
2124
require.resolve('jest-watch-typeahead/filename'),

src/createRollupConfig.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { safeVariableName, safePackageName, external } from './utils';
22
import { paths } from './constants';
3-
import { RollupOptions } from 'rollup';
4-
import { terser } from 'rollup-plugin-terser';
3+
import { InputPluginOption, RollupOptions } from 'rollup';
4+
import terser from '@rollup/plugin-terser';
55
import { DEFAULT_EXTENSIONS as DEFAULT_BABEL_EXTENSIONS } from '@babel/core';
66
import commonjs from '@rollup/plugin-commonjs';
77
import json from '@rollup/plugin-json';
88
import replace from '@rollup/plugin-replace';
99
import resolve, {
1010
DEFAULTS as RESOLVE_DEFAULTS,
1111
} from '@rollup/plugin-node-resolve';
12-
import sourceMaps from 'rollup-plugin-sourcemaps';
12+
import sourceMaps from '@edugis/rollup-plugin-sourcemaps';
1313
import typescript from 'rollup-plugin-typescript2';
1414
import ts from 'typescript';
1515

@@ -120,7 +120,7 @@ export async function createRollupConfig(
120120
}
121121
return { code, map: null };
122122
},
123-
},
123+
} as unknown as InputPluginOption,
124124
resolve({
125125
mainFields: [
126126
'module',
@@ -157,7 +157,7 @@ export async function createRollupConfig(
157157
map: null,
158158
};
159159
},
160-
},
160+
} as unknown as InputPluginOption,
161161
typescript({
162162
typescript: ts,
163163
tsconfig: opts.tsconfig,
@@ -221,14 +221,14 @@ export async function createRollupConfig(
221221
ecma: opts.legacy ? 5 : 2020,
222222
module: isEsm,
223223
toplevel: opts.format === 'cjs' || isEsm,
224-
warnings: true,
224+
// warnings: true,
225225
}),
226226
/**
227227
* Ensure there's an empty default export to prevent runtime errors.
228228
*
229229
* @see https://www.npmjs.com/package/rollup-plugin-export-default
230230
*/
231-
{
231+
{
232232
renderChunk: async (code: string, chunk: any) => {
233233
if (chunk.exports.includes('default') || !isEsm) {
234234
return null;
@@ -239,7 +239,7 @@ export async function createRollupConfig(
239239
map: null,
240240
};
241241
},
242-
},
242+
} as unknown as InputPluginOption,
243243
],
244244
};
245245
}

src/index.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import asyncro from 'asyncro';
1414
import chalk from 'chalk';
1515
import * as fs from 'fs-extra';
1616
import * as jest from 'jest';
17-
import { CLIEngine } from 'eslint';
17+
import { ESLint } from 'eslint';
1818
import logError from './logError';
1919
import path from 'path';
2020
import execa from 'execa';
@@ -599,30 +599,30 @@ prog
599599
writeFile: opts['write-file'],
600600
});
601601

602-
const cli = new CLIEngine({
602+
const cli = new ESLint({
603603
baseConfig: {
604604
...config,
605605
...appPackageJson.eslint,
606606
},
607607
extensions: ['.ts', '.tsx', '.js', '.jsx'],
608-
fix: opts.fix,
609-
ignorePattern: opts['ignore-pattern'],
608+
fix: opts.fix,
609+
// ignorePattern: opts['ignore-pattern'],
610610
});
611-
const report = cli.executeOnFiles(opts['_']);
611+
const results = await cli.lintFiles(opts['_']);
612612
if (opts.fix) {
613-
CLIEngine.outputFixes(report);
613+
ESLint.outputFixes(results);
614614
}
615-
console.log(cli.getFormatter()(report.results));
615+
// console.log(cli.loadFormatter()(results));
616616
if (opts['report-file']) {
617617
await fs.outputFile(
618618
opts['report-file'],
619-
cli.getFormatter('json')(report.results)
619+
cli.loadFormatter('json')//(results)
620620
);
621621
}
622-
if (report.errorCount) {
622+
if (results.length) {
623623
process.exit(1);
624624
}
625-
if (report.warningCount > opts['max-warnings']) {
625+
if ((results.filter(r => r.warningCount > 0)?.length) > opts['max-warnings']) {
626626
process.exit(1);
627627
}
628628
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export const foo = () => !!'bar';
1+
export const foo = () => {
2+
return 'bar';
3+
};

0 commit comments

Comments
 (0)