Skip to content

Commit 20400bd

Browse files
committed
chore: update dependencies
1 parent c334396 commit 20400bd

6 files changed

Lines changed: 1057 additions & 1244 deletions

File tree

babel.config.js

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

doc-theme/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
6262
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
6363
/* Interop Constraints */
64-
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
64+
"isolatedModules": true, // /* Ensure that each file can be safely transpiled without relying on other imports. */
6565
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
6666
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */
6767
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
@@ -90,4 +90,4 @@
9090
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
9191
"skipLibCheck": true // /* Skip type checking all .d.ts files. */
9292
}
93-
}
93+
}

jest.config.ts

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default {
1313
// The directory where Jest should store its cached dependency information
1414
// cacheDirectory: "/private/var/folders/q9/0mns8fgd00b4t5j5lq2wh2yh0000gn/T/jest_dx",
1515

16-
// Automatically clear mock calls and instances between every test
16+
// Automatically clear mock calls, instances, contexts and results before every test
1717
clearMocks: true,
1818

1919
// Indicates whether the coverage information should be collected while executing the test
@@ -50,6 +50,11 @@ export default {
5050
// Make calling deprecated APIs throw helpful error messages
5151
// errorOnDeprecated: false,
5252

53+
// The default configuration for fake timers
54+
// fakeTimers: {
55+
// "enableGlobally": false
56+
// },
57+
5358
// Force coverage collection from ignored files using an array of glob patterns
5459
// forceCoverageMatch: [],
5560

@@ -73,6 +78,8 @@ export default {
7378
// An array of file extensions your modules use
7479
// moduleFileExtensions: [
7580
// "js",
81+
// "mjs",
82+
// "cjs",
7683
// "jsx",
7784
// "ts",
7885
// "tsx",
@@ -82,6 +89,11 @@ export default {
8289

8390
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
8491
// moduleNameMapper: {},
92+
// moduleNameMapper: {
93+
// chalk: "<rootDir>/node_modules/chalk/source/index.js",
94+
// "#ansi-styles": "<rootDir>/node_modules/chalk/source/vendor/ansi-styles/index.js",
95+
// "#supports-color": "<rootDir>/node_modules/chalk/source/vendor/supports-color/index.js",
96+
// },
8597

8698
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
8799
modulePathIgnorePatterns: ["<rootDir>/dist"],
@@ -101,7 +113,7 @@ export default {
101113
// Use this configuration option to add custom reporters to Jest
102114
// reporters: undefined,
103115

104-
// Automatically reset mock state between every test
116+
// Automatically reset mock state before every test
105117
// resetMocks: false,
106118

107119
// Reset the module registry before running each individual test
@@ -110,7 +122,7 @@ export default {
110122
// A path to a custom resolver
111123
// resolver: undefined,
112124

113-
// Automatically restore mock state between every test
125+
// Automatically restore mock state and implementation before every test
114126
// restoreMocks: false,
115127

116128
// The root directory that Jest should scan for tests and modules within
@@ -137,7 +149,7 @@ export default {
137149
// snapshotSerializers: [],
138150

139151
// The test environment that will be used for testing
140-
testEnvironment: "node",
152+
// testEnvironment: "jest-environment-node",
141153

142154
// Options that will be passed to the testEnvironment
143155
// testEnvironmentOptions: {},
@@ -165,21 +177,20 @@ export default {
165177
// This option allows use of a custom test runner
166178
// testRunner: "jest-circus/runner",
167179

168-
// This option sets the URL for the jsdom environment. It is reflected in properties such as location.href
169-
// testURL: "http://localhost",
170-
171-
// Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"
172-
// timers: "real",
173-
174180
// A map from regular expressions to paths to transformers
175-
// transform: {},
181+
// transform: undefined,
176182

177183
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
178184
// transformIgnorePatterns: [
179185
// "/node_modules/",
180186
// "\\.pnp\\.[^\\/]+$"
181187
// ],
182188

189+
// transform: {
190+
// "^.+\\.ts?$": "ts-jest",
191+
// },
192+
// transformIgnorePatterns: ["<rootDir>/node_modules/"],
193+
183194
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
184195
// unmockedModulePathPatterns: undefined,
185196

@@ -191,6 +202,4 @@ export default {
191202

192203
// Whether to use watchman for file crawling
193204
// watchman: true,
194-
195-
// extensionsToTreatAsEsm: [".ts"],
196205
}

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"build": "yarn clean && tsc && chmod -R +x ./dist && cp ./package.json ./README.md ./dist/",
2525
"dev": "tsc --watch",
2626
"start": "node dist/scaffold.js",
27-
"test": "jest --verbose",
27+
"test": "jest",
2828
"cmd": "node --trace-warnings dist/cmd.js",
2929
"build-test": "yarn build && yarn test",
3030
"build-cmd": "yarn build && yarn cmd",
@@ -35,25 +35,25 @@
3535
},
3636
"dependencies": {
3737
"chalk": "^4.1.2",
38-
"date-fns": "^2.28.0",
39-
"glob": "^7.1.3",
38+
"date-fns": "^2.29.3",
39+
"glob": "^9.2.1",
4040
"handlebars": "^4.7.7",
4141
"lodash": "^4.17.21",
42-
"massarg": "^1.0.5",
42+
"massarg": "^1.0.7-pre.1",
4343
"util.promisify": "^1.1.1"
4444
},
4545
"devDependencies": {
46-
"@types/glob": "^7.1.1",
47-
"@types/jest": "^26.0.24",
46+
"@types/glob": "^8.1.0",
47+
"@types/jest": "^29.4.0",
4848
"@types/lodash": "^4.14.171",
4949
"@types/mock-fs": "^4.13.1",
50-
"@types/node": "^14.14.22",
50+
"@types/node": "^18.15.1",
5151
"doc-theme": "file:./doc-theme",
52-
"jest": "^27.0.6",
53-
"mock-fs": "^5.0.0",
54-
"rimraf": "^3.0.2",
55-
"ts-jest": "^27.0.3",
56-
"ts-node": "^10.1.0",
52+
"jest": "^29.5.0",
53+
"mock-fs": "^5.2.0",
54+
"rimraf": "^4.4.0",
55+
"ts-jest": "^29.0.5",
56+
"ts-node": "^10.9.1",
5757
"typedoc": "^0.23.26",
5858
"typescript": "^4.9.5"
5959
}

src/utils.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@ const { stat, access, mkdir } = fsPromises
1212
import dtAdd from "date-fns/add"
1313
import dtFormat from "date-fns/format"
1414
import dtParseISO from "date-fns/parseISO"
15+
import { glob, hasMagic } from "glob"
1516

1617
const dateFns = {
1718
add: dtAdd,
1819
format: dtFormat,
1920
parseISO: dtParseISO,
2021
}
2122

22-
import { glob } from "glob"
23-
import { promisify } from "util"
2423
const { readFile, writeFile } = fsPromises
2524

2625
export const defaultHelpers: Record<DefaultHelpers, Helper> = {
@@ -214,10 +213,10 @@ export function getBasePath(relPath: string): string {
214213

215214
export async function getFileList(config: ScaffoldConfig, template: string): Promise<string[]> {
216215
return (
217-
await promisify(glob)(template, {
216+
await glob(template, {
218217
dot: true,
219-
debug: config.verbose === LogLevel.Debug,
220218
nodir: true,
219+
// debug: config.verbose === LogLevel.Debug,
221220
})
222221
).map((f) => f.replace(/\//g, path.sep))
223222
}
@@ -231,7 +230,7 @@ export interface GlobInfo {
231230
}
232231

233232
export async function getTemplateGlobInfo(config: ScaffoldConfig, template: string): Promise<GlobInfo> {
234-
const isGlob = glob.hasMagic(template)
233+
const isGlob = hasMagic(template)
235234
log(config, LogLevel.Debug, "before isDir", "isGlob:", isGlob, template)
236235
let _template = template
237236
let nonGlobTemplate = isGlob ? removeGlob(template) : template

0 commit comments

Comments
 (0)