Skip to content

Commit 9f53632

Browse files
committed
build(pkg): add "type": "module"
Signed-off-by: Lexus Drumgold <[email protected]>
1 parent 29883e1 commit 9f53632

File tree

6 files changed

+87
-5
lines changed

6 files changed

+87
-5
lines changed
File renamed without changes.

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
"icon": "eslint"
109109
},
110110
{
111-
"extensions": [".graphqlrc.ts"],
111+
"extensions": [".graphqlrc.cts"],
112112
"format": "svg",
113113
"icon": "graphql"
114114
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
diff --git a/cjs/helpers/cosmiconfig.js b/cjs/helpers/cosmiconfig.js
2+
index bb8b01763792e325e214b90af229da718cc2de07..ffe11ce0d2a05488805499be029a50ce4af8d773 100644
3+
--- a/cjs/helpers/cosmiconfig.js
4+
+++ b/cjs/helpers/cosmiconfig.js
5+
@@ -42,6 +42,7 @@ function prepareCosmiconfig(moduleName, _a) {
6+
'#.config.ts',
7+
'#.config.js',
8+
'#.config.cjs',
9+
+ '#.config.cts',
10+
'#.config.json',
11+
'#.config.yaml',
12+
'#.config.yml',
13+
@@ -50,6 +51,7 @@ function prepareCosmiconfig(moduleName, _a) {
14+
'.#rc.ts',
15+
'.#rc.js',
16+
'.#rc.cjs',
17+
+ '.#rc.cts',
18+
'.#rc.json',
19+
'.#rc.yml',
20+
'.#rc.yaml',
21+
@@ -64,6 +66,7 @@ function prepareCosmiconfig(moduleName, _a) {
22+
return {
23+
searchPlaces: searchPlaces.map(function (place) { return place.replace('#', moduleName); }),
24+
loaders: {
25+
+ '.cts': (0, cosmiconfig_typescript_loader_1.TypeScriptLoader)(),
26+
'.ts': (0, cosmiconfig_typescript_loader_1.TypeScriptLoader)(),
27+
'.js': cosmiconfig_1.defaultLoaders['.js'],
28+
'.json': loadJson,
29+
diff --git a/esm/helpers/cosmiconfig.js b/esm/helpers/cosmiconfig.js
30+
index a656d4c5f8ecccada2f53f5b87c47cd9551e0ac6..7dff32dcc653d58fa20ad88da78ff12a0d608b70 100644
31+
--- a/esm/helpers/cosmiconfig.js
32+
+++ b/esm/helpers/cosmiconfig.js
33+
@@ -36,6 +36,7 @@ function prepareCosmiconfig(moduleName, _a) {
34+
'#.config.ts',
35+
'#.config.js',
36+
'#.config.cjs',
37+
+ '#.config.cts',
38+
'#.config.json',
39+
'#.config.yaml',
40+
'#.config.yml',
41+
@@ -44,6 +45,7 @@ function prepareCosmiconfig(moduleName, _a) {
42+
'.#rc.ts',
43+
'.#rc.js',
44+
'.#rc.cjs',
45+
+ '.#rc.cts',
46+
'.#rc.json',
47+
'.#rc.yml',
48+
'.#rc.yaml',
49+
@@ -58,6 +60,7 @@ function prepareCosmiconfig(moduleName, _a) {
50+
return {
51+
searchPlaces: searchPlaces.map(function (place) { return place.replace('#', moduleName); }),
52+
loaders: {
53+
+ '.cts': TypeScriptLoader(),
54+
'.ts': TypeScriptLoader(),
55+
'.js': defaultLoaders['.js'],
56+
'.json': loadJson,

package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"access": "public",
2727
"directory": "./"
2828
},
29+
"type": "module",
2930
"files": [
3031
"dist",
3132
"src"
@@ -126,7 +127,7 @@
126127
"eslint-plugin-unicorn": "43.0.2",
127128
"eslint-plugin-yml": "1.1.0",
128129
"graphql": "16.6.0",
129-
"graphql-config": "4.3.5",
130+
"graphql-config": "patch:graphql-config@npm%3A4.3.5#~/.yarn/patches/graphql-config-npm-4.3.5-8989a92a82.patch",
130131
"growl": "1.10.5",
131132
"husky": "8.0.1",
132133
"is-ci": "3.0.1",
@@ -153,7 +154,8 @@
153154
},
154155
"resolutions": {
155156
"@ardatan/sync-fetch": "larsgw/sync-fetch#head=worker_threads",
156-
"mkdist": "patch:mkdist@npm:0.3.13#.yarn/patches/mkdist-npm-0.3.13-c41cf41c68.patch"
157+
"mkdist": "patch:mkdist@npm:0.3.13#.yarn/patches/mkdist-npm-0.3.13-c41cf41c68.patch",
158+
"graphql-config": "patch:graphql-config@npm%3A4.3.5#~/.yarn/patches/graphql-config-npm-4.3.5-8989a92a82.patch"
157159
},
158160
"engines": {
159161
"node": ">=14.16",

tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"**/**/*.mjs",
5757
"**/**/*.ts",
5858
"**/**/.*.cjs",
59+
"**/**/.*.cts",
5960
"**/**/.*.ts"
6061
],
6162
// SEE: https://typestrong.org/ts-node/docs/configuration

yarn.lock

+25-2
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ __metadata:
950950
eslint-plugin-unicorn: "npm:43.0.2"
951951
eslint-plugin-yml: "npm:1.1.0"
952952
graphql: "npm:16.6.0"
953-
graphql-config: "npm:4.3.5"
953+
graphql-config: "patch:graphql-config@npm%3A4.3.5#~/.yarn/patches/graphql-config-npm-4.3.5-8989a92a82.patch"
954954
growl: "npm:1.10.5"
955955
husky: "npm:8.0.1"
956956
is-ci: "npm:3.0.1"
@@ -5068,7 +5068,7 @@ __metadata:
50685068
languageName: node
50695069
linkType: hard
50705070

5071-
"graphql-config@npm:4.3.5, graphql-config@npm:^4.3.0":
5071+
"graphql-config@npm:4.3.5":
50725072
version: 4.3.5
50735073
resolution: "graphql-config@npm:4.3.5"
50745074
dependencies:
@@ -5091,6 +5091,29 @@ __metadata:
50915091
languageName: node
50925092
linkType: hard
50935093

5094+
"graphql-config@patch:graphql-config@npm%3A4.3.5#~/.yarn/patches/graphql-config-npm-4.3.5-8989a92a82.patch":
5095+
version: 4.3.5
5096+
resolution: "graphql-config@patch:graphql-config@npm%3A4.3.5#~/.yarn/patches/graphql-config-npm-4.3.5-8989a92a82.patch::version=4.3.5&hash=52aeb2"
5097+
dependencies:
5098+
"@graphql-tools/graphql-file-loader": "npm:^7.3.7"
5099+
"@graphql-tools/json-file-loader": "npm:^7.3.7"
5100+
"@graphql-tools/load": "npm:^7.5.5"
5101+
"@graphql-tools/merge": "npm:^8.2.6"
5102+
"@graphql-tools/url-loader": "npm:^7.9.7"
5103+
"@graphql-tools/utils": "npm:^8.6.5"
5104+
cosmiconfig: "npm:7.0.1"
5105+
cosmiconfig-toml-loader: "npm:1.0.0"
5106+
cosmiconfig-typescript-loader: "npm:^4.0.0"
5107+
minimatch: "npm:4.2.1"
5108+
string-env-interpolation: "npm:1.0.1"
5109+
ts-node: "npm:^10.8.1"
5110+
tslib: "npm:^2.4.0"
5111+
peerDependencies:
5112+
graphql: ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0
5113+
checksum: e0d72ec3217043911414142c5f1946cc7c7866e71e1561cb95187cd8f506c97024f0e45b2250e6846a7b505e351e6b52d5263afe796aea677b3eaf740b1af62b
5114+
languageName: node
5115+
linkType: hard
5116+
50945117
"graphql-depth-limit@npm:^1.1.0":
50955118
version: 1.1.0
50965119
resolution: "graphql-depth-limit@npm:1.1.0"

0 commit comments

Comments
 (0)