vxrn 2.13.8 → 2.13.10
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.
- package/dist/cli.mjs +3 -2
- package/dist/cli.mjs.map +1 -1
- package/dist/cli.native.js +5 -2
- package/dist/cli.native.js.map +1 -1
- package/dist/config/getBaseViteConfigOnly.mjs +3 -3
- package/dist/config/getBaseViteConfigOnly.mjs.map +1 -1
- package/dist/config/getBaseViteConfigOnly.native.js +3 -3
- package/dist/config/getBaseViteConfigOnly.native.js.map +1 -1
- package/dist/config/getOptionsFilled.mjs +24 -2
- package/dist/config/getOptionsFilled.mjs.map +1 -1
- package/dist/config/getOptionsFilled.native.js +25 -2
- package/dist/config/getOptionsFilled.native.js.map +1 -1
- package/dist/config/getServerOptionsFilled.mjs +119 -1
- package/dist/config/getServerOptionsFilled.mjs.map +1 -1
- package/dist/config/getServerOptionsFilled.native.js +137 -1
- package/dist/config/getServerOptionsFilled.native.js.map +1 -1
- package/dist/exports/build.mjs +5 -5
- package/dist/exports/build.mjs.map +1 -1
- package/dist/exports/build.native.js +5 -5
- package/dist/exports/build.native.js.map +1 -1
- package/dist/exports/dev.mjs +4 -6
- package/dist/exports/dev.mjs.map +1 -1
- package/dist/exports/dev.native.js +6 -6
- package/dist/exports/dev.native.js.map +1 -1
- package/dist/exports/prebuild.mjs +4 -4
- package/dist/exports/prebuild.mjs.map +1 -1
- package/dist/exports/prebuild.native.js +4 -4
- package/dist/exports/prebuild.native.js.map +1 -1
- package/dist/exports/prebuildWithoutExpo.mjs +95 -88
- package/dist/exports/prebuildWithoutExpo.mjs.map +1 -1
- package/dist/exports/prebuildWithoutExpo.native.js +95 -88
- package/dist/exports/prebuildWithoutExpo.native.js.map +1 -1
- package/dist/plugins/autoDepOptimizePlugin.mjs +3 -3
- package/dist/plugins/autoDepOptimizePlugin.mjs.map +1 -1
- package/dist/plugins/autoDepOptimizePlugin.native.js +3 -3
- package/dist/plugins/autoDepOptimizePlugin.native.js.map +1 -1
- package/dist/plugins/reactNativeDevAssetPlugin.mjs +4 -4
- package/dist/plugins/reactNativeDevAssetPlugin.mjs.map +1 -1
- package/dist/plugins/reactNativeDevAssetPlugin.native.js +4 -4
- package/dist/plugins/reactNativeDevAssetPlugin.native.js.map +1 -1
- package/dist/rn-commands/bundle/buildBundle.mjs +18 -5
- package/dist/rn-commands/bundle/buildBundle.mjs.map +1 -1
- package/dist/rn-commands/bundle/buildBundle.native.js +18 -5
- package/dist/rn-commands/bundle/buildBundle.native.js.map +1 -1
- package/dist/user-interface/index.mjs +1 -1
- package/dist/user-interface/index.mjs.map +1 -1
- package/dist/user-interface/index.native.js +1 -1
- package/dist/user-interface/index.native.js.map +1 -1
- package/dist/utils/env-editor.mjs +198 -0
- package/dist/utils/env-editor.mjs.map +1 -0
- package/dist/utils/env-editor.native.js +266 -0
- package/dist/utils/env-editor.native.js.map +1 -0
- package/dist/utils/fs.mjs +48 -0
- package/dist/utils/fs.mjs.map +1 -0
- package/dist/utils/fs.native.js +48 -0
- package/dist/utils/fs.native.js.map +1 -0
- package/dist/utils/getVitePath.mjs +2 -2
- package/dist/utils/getVitePath.mjs.map +1 -1
- package/dist/utils/getVitePath.native.js +2 -2
- package/dist/utils/getVitePath.native.js.map +1 -1
- package/dist/utils/patches.mjs +38 -29
- package/dist/utils/patches.mjs.map +1 -1
- package/dist/utils/patches.native.js +38 -29
- package/dist/utils/patches.native.js.map +1 -1
- package/dist/utils/scanDepsToOptimize.mjs +12 -11
- package/dist/utils/scanDepsToOptimize.mjs.map +1 -1
- package/dist/utils/scanDepsToOptimize.native.js +12 -11
- package/dist/utils/scanDepsToOptimize.native.js.map +1 -1
- package/dist/utils/state.mjs +5 -5
- package/dist/utils/state.mjs.map +1 -1
- package/dist/utils/state.native.js +5 -5
- package/dist/utils/state.native.js.map +1 -1
- package/dist/utils/utils.mjs +4 -3
- package/dist/utils/utils.mjs.map +1 -1
- package/dist/utils/utils.native.js +4 -3
- package/dist/utils/utils.native.js.map +1 -1
- package/package.json +12 -18
- package/src/cli.ts +5 -4
- package/src/config/getBaseViteConfigOnly.ts +3 -3
- package/src/config/getOptionsFilled.ts +35 -2
- package/src/config/getServerOptionsFilled.test.ts +37 -0
- package/src/config/getServerOptionsFilled.ts +57 -1
- package/src/exports/build.ts +5 -5
- package/src/exports/clean.test.ts +1 -1
- package/src/exports/dev.ts +5 -6
- package/src/exports/prebuild.ts +4 -4
- package/src/exports/prebuildWithoutExpo.ts +102 -89
- package/src/plugins/autoDepOptimizePlugin.ts +3 -3
- package/src/plugins/reactNativeDevAssetPlugin.ts +4 -4
- package/src/rn-commands/bundle/buildBundle.ts +15 -5
- package/src/user-interface/index.ts +1 -1
- package/src/utils/env-editor.LICENSE +9 -0
- package/src/utils/env-editor.ts +214 -0
- package/src/utils/fs.ts +59 -0
- package/src/utils/getVitePath.ts +2 -2
- package/src/utils/patches.test.ts +36 -36
- package/src/utils/patches.ts +39 -27
- package/src/utils/scanDepsToOptimize.test.ts +2 -2
- package/src/utils/scanDepsToOptimize.ts +6 -5
- package/src/utils/state.ts +5 -7
- package/src/utils/utils.ts +5 -5
- package/types/config/getOptionsFilled.d.ts +9 -2
- package/types/config/getOptionsFilled.d.ts.map +1 -1
- package/types/config/getServerOptionsFilled.d.ts.map +1 -1
- package/types/exports/build.d.ts +1 -1
- package/types/exports/dev.d.ts.map +1 -1
- package/types/exports/prebuildWithoutExpo.d.ts.map +1 -1
- package/types/rn-commands/bundle/buildBundle.d.ts.map +1 -1
- package/types/user-interface/index.d.ts.map +1 -1
- package/types/utils/env-editor.d.ts +9 -0
- package/types/utils/env-editor.d.ts.map +1 -0
- package/types/utils/fs.d.ts +9 -0
- package/types/utils/fs.d.ts.map +1 -0
- package/types/utils/patches.d.ts.map +1 -1
- package/types/utils/scanDepsToOptimize.d.ts.map +1 -1
- package/types/utils/state.d.ts.map +1 -1
- package/types/utils/utils.d.ts +2 -2
- package/types/utils/utils.d.ts.map +1 -1
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import process from "node:process";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
function allEditors() {
|
|
5
|
+
return [
|
|
6
|
+
{
|
|
7
|
+
id: "sublime",
|
|
8
|
+
name: "Sublime Text",
|
|
9
|
+
binary: "subl",
|
|
10
|
+
isTerminalEditor: false,
|
|
11
|
+
paths: ["/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl", "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"],
|
|
12
|
+
keywords: []
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: "atom",
|
|
16
|
+
name: "Atom",
|
|
17
|
+
binary: "atom",
|
|
18
|
+
isTerminalEditor: false,
|
|
19
|
+
paths: ["/Applications/Atom.app/Contents/Resources/app/atom.sh"],
|
|
20
|
+
keywords: []
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: "vscode-insiders",
|
|
24
|
+
name: "Visual Studio Code - Insiders",
|
|
25
|
+
binary: "code-insiders",
|
|
26
|
+
isTerminalEditor: false,
|
|
27
|
+
paths: ["/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin/code-insiders"],
|
|
28
|
+
keywords: [
|
|
29
|
+
"vs code insiders",
|
|
30
|
+
"code insiders",
|
|
31
|
+
"insiders"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: "vscode",
|
|
36
|
+
name: "Visual Studio Code",
|
|
37
|
+
binary: "code",
|
|
38
|
+
isTerminalEditor: false,
|
|
39
|
+
paths: ["/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code"],
|
|
40
|
+
keywords: ["vs code"]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: "vscodium",
|
|
44
|
+
name: "VSCodium",
|
|
45
|
+
binary: "codium",
|
|
46
|
+
isTerminalEditor: false,
|
|
47
|
+
paths: ["/Applications/VSCodium.app/Contents/Resources/app/bin/codium"],
|
|
48
|
+
keywords: []
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: "webstorm",
|
|
52
|
+
name: "WebStorm",
|
|
53
|
+
binary: "webstorm",
|
|
54
|
+
isTerminalEditor: false,
|
|
55
|
+
paths: [],
|
|
56
|
+
keywords: ["wstorm"]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: "phpstorm",
|
|
60
|
+
name: "PhpStorm",
|
|
61
|
+
binary: "pstorm",
|
|
62
|
+
isTerminalEditor: false,
|
|
63
|
+
paths: [],
|
|
64
|
+
keywords: ["php"]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: "textmate",
|
|
68
|
+
name: "TextMate",
|
|
69
|
+
binary: "mate",
|
|
70
|
+
isTerminalEditor: false,
|
|
71
|
+
paths: [],
|
|
72
|
+
keywords: []
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: "vim",
|
|
76
|
+
name: "Vim",
|
|
77
|
+
binary: "vim",
|
|
78
|
+
isTerminalEditor: true,
|
|
79
|
+
paths: [],
|
|
80
|
+
keywords: ["vi"]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: "neovim",
|
|
84
|
+
name: "NeoVim",
|
|
85
|
+
binary: "nvim",
|
|
86
|
+
isTerminalEditor: true,
|
|
87
|
+
paths: [],
|
|
88
|
+
keywords: ["vim"]
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: "intellij",
|
|
92
|
+
name: "IntelliJ IDEA",
|
|
93
|
+
binary: "idea",
|
|
94
|
+
isTerminalEditor: false,
|
|
95
|
+
paths: [],
|
|
96
|
+
keywords: [
|
|
97
|
+
"idea",
|
|
98
|
+
"java",
|
|
99
|
+
"jetbrains",
|
|
100
|
+
"ide"
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: "nano",
|
|
105
|
+
name: "GNU nano",
|
|
106
|
+
binary: "nano",
|
|
107
|
+
isTerminalEditor: true,
|
|
108
|
+
paths: [],
|
|
109
|
+
keywords: []
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: "emacs",
|
|
113
|
+
name: "GNU Emacs",
|
|
114
|
+
binary: "emacs",
|
|
115
|
+
isTerminalEditor: true,
|
|
116
|
+
paths: [],
|
|
117
|
+
keywords: []
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: "emacsforosx",
|
|
121
|
+
name: "GNU Emacs for Mac OS X",
|
|
122
|
+
binary: "Emacs",
|
|
123
|
+
isTerminalEditor: false,
|
|
124
|
+
paths: ["/Applications/Emacs.app/Contents/MacOS/Emacs"],
|
|
125
|
+
keywords: []
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: "android-studio",
|
|
129
|
+
name: "Android Studio",
|
|
130
|
+
binary: "studio",
|
|
131
|
+
isTerminalEditor: false,
|
|
132
|
+
paths: [
|
|
133
|
+
"/Applications/Android Studio.app/Contents/MacOS/studio",
|
|
134
|
+
"/usr/local/Android/android-studio/bin/studio.sh",
|
|
135
|
+
"C:\\Program Files (x86)\\Android\\android-studio\\bin\\studio.exe",
|
|
136
|
+
"C:\\Program Files\\Android\\android-studio\\bin\\studio64.exe"
|
|
137
|
+
],
|
|
138
|
+
keywords: ["studio"]
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
id: "xcode",
|
|
142
|
+
name: "Xcode",
|
|
143
|
+
binary: "xed",
|
|
144
|
+
isTerminalEditor: false,
|
|
145
|
+
paths: ["/Applications/Xcode.app/Contents/MacOS/Xcode", "/Applications/Xcode-beta.app/Contents/MacOS/Xcode"],
|
|
146
|
+
keywords: ["xed"]
|
|
147
|
+
}
|
|
148
|
+
];
|
|
149
|
+
}
|
|
150
|
+
function getEditor(editor) {
|
|
151
|
+
editor = editor.trim();
|
|
152
|
+
const needle = editor.toLowerCase();
|
|
153
|
+
const id = needle.split(/[/\\]/).pop().replace(/\s/g, "-");
|
|
154
|
+
const binary = id.split("-")[0];
|
|
155
|
+
for (const editor2 of allEditors()) {
|
|
156
|
+
if (needle === editor2.id || needle === editor2.name.toLowerCase() || id === editor2.binary) {
|
|
157
|
+
return editor2;
|
|
158
|
+
}
|
|
159
|
+
for (const editorPath of editor2.paths) {
|
|
160
|
+
if (path.normalize(needle) === path.normalize(editorPath.toLowerCase())) {
|
|
161
|
+
return editor2;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
for (const keyword of editor2.keywords) {
|
|
165
|
+
if (needle === keyword) {
|
|
166
|
+
return editor2;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
for (const editor2 of allEditors()) {
|
|
171
|
+
if (binary === editor2.binary) {
|
|
172
|
+
return editor2;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return {
|
|
176
|
+
id,
|
|
177
|
+
name: editor,
|
|
178
|
+
binary,
|
|
179
|
+
isTerminalEditor: false,
|
|
180
|
+
paths: [],
|
|
181
|
+
keywords: []
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function defaultEditor() {
|
|
185
|
+
const editor = process.env.EDITOR || process.env.VISUAL;
|
|
186
|
+
if (!editor) {
|
|
187
|
+
throw new Error(`
|
|
188
|
+
Your $EDITOR environment variable is not set.
|
|
189
|
+
Set it to the command/path of your editor in ~/.zshenv or ~/.bashrc:
|
|
190
|
+
|
|
191
|
+
export EDITOR=atom
|
|
192
|
+
`);
|
|
193
|
+
}
|
|
194
|
+
return getEditor(editor);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export { defaultEditor };
|
|
198
|
+
//# sourceMappingURL=env-editor.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-editor.js","names":[],"sources":["utils/env-editor.js"],"sourcesContent":["import process from \"node:process\";\nimport path from \"node:path\";\nfunction allEditors() {\n return [\n {\n id: \"sublime\",\n name: \"Sublime Text\",\n binary: \"subl\",\n isTerminalEditor: false,\n paths: [\n \"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl\",\n \"/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl\"\n ],\n keywords: []\n },\n {\n id: \"atom\",\n name: \"Atom\",\n binary: \"atom\",\n isTerminalEditor: false,\n paths: [\"/Applications/Atom.app/Contents/Resources/app/atom.sh\"],\n keywords: []\n },\n {\n id: \"vscode-insiders\",\n name: \"Visual Studio Code - Insiders\",\n binary: \"code-insiders\",\n isTerminalEditor: false,\n paths: [\n \"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin/code-insiders\"\n ],\n keywords: [\"vs code insiders\", \"code insiders\", \"insiders\"]\n },\n {\n id: \"vscode\",\n name: \"Visual Studio Code\",\n binary: \"code\",\n isTerminalEditor: false,\n paths: [\"/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code\"],\n keywords: [\"vs code\"]\n },\n {\n id: \"vscodium\",\n name: \"VSCodium\",\n binary: \"codium\",\n isTerminalEditor: false,\n paths: [\"/Applications/VSCodium.app/Contents/Resources/app/bin/codium\"],\n keywords: []\n },\n {\n id: \"webstorm\",\n name: \"WebStorm\",\n binary: \"webstorm\",\n isTerminalEditor: false,\n paths: [],\n keywords: [\"wstorm\"]\n },\n {\n id: \"phpstorm\",\n name: \"PhpStorm\",\n binary: \"pstorm\",\n isTerminalEditor: false,\n paths: [],\n keywords: [\"php\"]\n },\n {\n id: \"textmate\",\n name: \"TextMate\",\n binary: \"mate\",\n isTerminalEditor: false,\n paths: [],\n keywords: []\n },\n {\n id: \"vim\",\n name: \"Vim\",\n binary: \"vim\",\n isTerminalEditor: true,\n paths: [],\n keywords: [\"vi\"]\n },\n {\n id: \"neovim\",\n name: \"NeoVim\",\n binary: \"nvim\",\n isTerminalEditor: true,\n paths: [],\n keywords: [\"vim\"]\n },\n {\n id: \"intellij\",\n name: \"IntelliJ IDEA\",\n binary: \"idea\",\n isTerminalEditor: false,\n paths: [],\n keywords: [\"idea\", \"java\", \"jetbrains\", \"ide\"]\n },\n {\n id: \"nano\",\n name: \"GNU nano\",\n binary: \"nano\",\n isTerminalEditor: true,\n paths: [],\n keywords: []\n },\n {\n id: \"emacs\",\n name: \"GNU Emacs\",\n binary: \"emacs\",\n isTerminalEditor: true,\n paths: [],\n keywords: []\n },\n {\n id: \"emacsforosx\",\n name: \"GNU Emacs for Mac OS X\",\n binary: \"Emacs\",\n isTerminalEditor: false,\n paths: [\"/Applications/Emacs.app/Contents/MacOS/Emacs\"],\n keywords: []\n },\n {\n id: \"android-studio\",\n name: \"Android Studio\",\n binary: \"studio\",\n isTerminalEditor: false,\n paths: [\n \"/Applications/Android Studio.app/Contents/MacOS/studio\",\n \"/usr/local/Android/android-studio/bin/studio.sh\",\n \"C:\\\\Program Files (x86)\\\\Android\\\\android-studio\\\\bin\\\\studio.exe\",\n \"C:\\\\Program Files\\\\Android\\\\android-studio\\\\bin\\\\studio64.exe\"\n ],\n keywords: [\"studio\"]\n },\n {\n id: \"xcode\",\n name: \"Xcode\",\n binary: \"xed\",\n isTerminalEditor: false,\n paths: [\n \"/Applications/Xcode.app/Contents/MacOS/Xcode\",\n \"/Applications/Xcode-beta.app/Contents/MacOS/Xcode\"\n ],\n keywords: [\"xed\"]\n }\n ];\n}\nfunction getEditor(editor) {\n editor = editor.trim();\n const needle = editor.toLowerCase();\n const id = needle.split(/[/\\\\]/).pop().replace(/\\s/g, \"-\");\n const binary = id.split(\"-\")[0];\n for (const editor2 of allEditors()) {\n if (needle === editor2.id || needle === editor2.name.toLowerCase() || id === editor2.binary) {\n return editor2;\n }\n for (const editorPath of editor2.paths) {\n if (path.normalize(needle) === path.normalize(editorPath.toLowerCase())) {\n return editor2;\n }\n }\n for (const keyword of editor2.keywords) {\n if (needle === keyword) {\n return editor2;\n }\n }\n }\n for (const editor2 of allEditors()) {\n if (binary === editor2.binary) {\n return editor2;\n }\n }\n return {\n id,\n name: editor,\n binary,\n isTerminalEditor: false,\n paths: [],\n keywords: []\n };\n}\nfunction defaultEditor() {\n const editor = process.env.EDITOR || process.env.VISUAL;\n if (!editor) {\n throw new Error(\n // eslint-disable-next-line indent\n `\nYour $EDITOR environment variable is not set.\nSet it to the command/path of your editor in ~/.zshenv or ~/.bashrc:\n\n export EDITOR=atom\n`\n );\n }\n return getEditor(editor);\n}\nexport {\n defaultEditor\n};\n//# sourceMappingURL=env-editor.js.map\n"],"mappings":"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"}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import process from "process";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
function allEditors() {
|
|
5
|
+
return [
|
|
6
|
+
{
|
|
7
|
+
id: "sublime",
|
|
8
|
+
name: "Sublime Text",
|
|
9
|
+
binary: "subl",
|
|
10
|
+
isTerminalEditor: false,
|
|
11
|
+
paths: ["/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl", "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"],
|
|
12
|
+
keywords: []
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: "atom",
|
|
16
|
+
name: "Atom",
|
|
17
|
+
binary: "atom",
|
|
18
|
+
isTerminalEditor: false,
|
|
19
|
+
paths: ["/Applications/Atom.app/Contents/Resources/app/atom.sh"],
|
|
20
|
+
keywords: []
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: "vscode-insiders",
|
|
24
|
+
name: "Visual Studio Code - Insiders",
|
|
25
|
+
binary: "code-insiders",
|
|
26
|
+
isTerminalEditor: false,
|
|
27
|
+
paths: ["/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin/code-insiders"],
|
|
28
|
+
keywords: [
|
|
29
|
+
"vs code insiders",
|
|
30
|
+
"code insiders",
|
|
31
|
+
"insiders"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: "vscode",
|
|
36
|
+
name: "Visual Studio Code",
|
|
37
|
+
binary: "code",
|
|
38
|
+
isTerminalEditor: false,
|
|
39
|
+
paths: ["/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code"],
|
|
40
|
+
keywords: ["vs code"]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: "vscodium",
|
|
44
|
+
name: "VSCodium",
|
|
45
|
+
binary: "codium",
|
|
46
|
+
isTerminalEditor: false,
|
|
47
|
+
paths: ["/Applications/VSCodium.app/Contents/Resources/app/bin/codium"],
|
|
48
|
+
keywords: []
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: "webstorm",
|
|
52
|
+
name: "WebStorm",
|
|
53
|
+
binary: "webstorm",
|
|
54
|
+
isTerminalEditor: false,
|
|
55
|
+
paths: [],
|
|
56
|
+
keywords: ["wstorm"]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: "phpstorm",
|
|
60
|
+
name: "PhpStorm",
|
|
61
|
+
binary: "pstorm",
|
|
62
|
+
isTerminalEditor: false,
|
|
63
|
+
paths: [],
|
|
64
|
+
keywords: ["php"]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: "textmate",
|
|
68
|
+
name: "TextMate",
|
|
69
|
+
binary: "mate",
|
|
70
|
+
isTerminalEditor: false,
|
|
71
|
+
paths: [],
|
|
72
|
+
keywords: []
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: "vim",
|
|
76
|
+
name: "Vim",
|
|
77
|
+
binary: "vim",
|
|
78
|
+
isTerminalEditor: true,
|
|
79
|
+
paths: [],
|
|
80
|
+
keywords: ["vi"]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: "neovim",
|
|
84
|
+
name: "NeoVim",
|
|
85
|
+
binary: "nvim",
|
|
86
|
+
isTerminalEditor: true,
|
|
87
|
+
paths: [],
|
|
88
|
+
keywords: ["vim"]
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: "intellij",
|
|
92
|
+
name: "IntelliJ IDEA",
|
|
93
|
+
binary: "idea",
|
|
94
|
+
isTerminalEditor: false,
|
|
95
|
+
paths: [],
|
|
96
|
+
keywords: [
|
|
97
|
+
"idea",
|
|
98
|
+
"java",
|
|
99
|
+
"jetbrains",
|
|
100
|
+
"ide"
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: "nano",
|
|
105
|
+
name: "GNU nano",
|
|
106
|
+
binary: "nano",
|
|
107
|
+
isTerminalEditor: true,
|
|
108
|
+
paths: [],
|
|
109
|
+
keywords: []
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: "emacs",
|
|
113
|
+
name: "GNU Emacs",
|
|
114
|
+
binary: "emacs",
|
|
115
|
+
isTerminalEditor: true,
|
|
116
|
+
paths: [],
|
|
117
|
+
keywords: []
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: "emacsforosx",
|
|
121
|
+
name: "GNU Emacs for Mac OS X",
|
|
122
|
+
binary: "Emacs",
|
|
123
|
+
isTerminalEditor: false,
|
|
124
|
+
paths: ["/Applications/Emacs.app/Contents/MacOS/Emacs"],
|
|
125
|
+
keywords: []
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: "android-studio",
|
|
129
|
+
name: "Android Studio",
|
|
130
|
+
binary: "studio",
|
|
131
|
+
isTerminalEditor: false,
|
|
132
|
+
paths: [
|
|
133
|
+
"/Applications/Android Studio.app/Contents/MacOS/studio",
|
|
134
|
+
"/usr/local/Android/android-studio/bin/studio.sh",
|
|
135
|
+
"C:\\Program Files (x86)\\Android\\android-studio\\bin\\studio.exe",
|
|
136
|
+
"C:\\Program Files\\Android\\android-studio\\bin\\studio64.exe"
|
|
137
|
+
],
|
|
138
|
+
keywords: ["studio"]
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
id: "xcode",
|
|
142
|
+
name: "Xcode",
|
|
143
|
+
binary: "xed",
|
|
144
|
+
isTerminalEditor: false,
|
|
145
|
+
paths: ["/Applications/Xcode.app/Contents/MacOS/Xcode", "/Applications/Xcode-beta.app/Contents/MacOS/Xcode"],
|
|
146
|
+
keywords: ["xed"]
|
|
147
|
+
}
|
|
148
|
+
];
|
|
149
|
+
}
|
|
150
|
+
function getEditor(editor) {
|
|
151
|
+
editor = editor.trim();
|
|
152
|
+
var needle = editor.toLowerCase();
|
|
153
|
+
var id = needle.split(/[/\\]/).pop().replace(/\s/g, "-");
|
|
154
|
+
var binary = id.split("-")[0];
|
|
155
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
156
|
+
try {
|
|
157
|
+
for (var _iterator = allEditors()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
158
|
+
var _$editor = _step.value;
|
|
159
|
+
if (needle === _$editor.id || needle === _$editor.name.toLowerCase() || id === _$editor.binary) {
|
|
160
|
+
return _$editor;
|
|
161
|
+
}
|
|
162
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
163
|
+
try {
|
|
164
|
+
for (var _iterator1 = _$editor.paths[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
|
165
|
+
var editorPath = _step1.value;
|
|
166
|
+
if (path.normalize(needle) === path.normalize(editorPath.toLowerCase())) {
|
|
167
|
+
return _$editor;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
} catch (err) {
|
|
171
|
+
_didIteratorError1 = true;
|
|
172
|
+
_iteratorError1 = err;
|
|
173
|
+
} finally {
|
|
174
|
+
try {
|
|
175
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
176
|
+
_iterator1.return();
|
|
177
|
+
}
|
|
178
|
+
} finally {
|
|
179
|
+
if (_didIteratorError1) {
|
|
180
|
+
throw _iteratorError1;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
185
|
+
try {
|
|
186
|
+
for (var _iterator2 = _$editor.keywords[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
187
|
+
var keyword = _step2.value;
|
|
188
|
+
if (needle === keyword) {
|
|
189
|
+
return _$editor;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
} catch (err) {
|
|
193
|
+
_didIteratorError2 = true;
|
|
194
|
+
_iteratorError2 = err;
|
|
195
|
+
} finally {
|
|
196
|
+
try {
|
|
197
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
198
|
+
_iterator2.return();
|
|
199
|
+
}
|
|
200
|
+
} finally {
|
|
201
|
+
if (_didIteratorError2) {
|
|
202
|
+
throw _iteratorError2;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
} catch (err) {
|
|
208
|
+
_didIteratorError = true;
|
|
209
|
+
_iteratorError = err;
|
|
210
|
+
} finally {
|
|
211
|
+
try {
|
|
212
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
213
|
+
_iterator.return();
|
|
214
|
+
}
|
|
215
|
+
} finally {
|
|
216
|
+
if (_didIteratorError) {
|
|
217
|
+
throw _iteratorError;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
var _iteratorNormalCompletion3 = true, _didIteratorError3 = false, _iteratorError3 = void 0;
|
|
222
|
+
try {
|
|
223
|
+
for (var _iterator3 = allEditors()[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
|
|
224
|
+
var _$editor1 = _step3.value;
|
|
225
|
+
if (binary === _$editor1.binary) {
|
|
226
|
+
return _$editor1;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
} catch (err) {
|
|
230
|
+
_didIteratorError3 = true;
|
|
231
|
+
_iteratorError3 = err;
|
|
232
|
+
} finally {
|
|
233
|
+
try {
|
|
234
|
+
if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
|
|
235
|
+
_iterator3.return();
|
|
236
|
+
}
|
|
237
|
+
} finally {
|
|
238
|
+
if (_didIteratorError3) {
|
|
239
|
+
throw _iteratorError3;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return {
|
|
244
|
+
id,
|
|
245
|
+
name: editor,
|
|
246
|
+
binary,
|
|
247
|
+
isTerminalEditor: false,
|
|
248
|
+
paths: [],
|
|
249
|
+
keywords: []
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
function defaultEditor() {
|
|
253
|
+
var editor = process.env.EDITOR || process.env.VISUAL;
|
|
254
|
+
if (!editor) {
|
|
255
|
+
throw new Error(`
|
|
256
|
+
Your $EDITOR environment variable is not set.
|
|
257
|
+
Set it to the command/path of your editor in ~/.zshenv or ~/.bashrc:
|
|
258
|
+
|
|
259
|
+
export EDITOR=atom
|
|
260
|
+
`);
|
|
261
|
+
}
|
|
262
|
+
return getEditor(editor);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export { defaultEditor };
|
|
266
|
+
//# sourceMappingURL=env-editor.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-editor.native.js","names":[],"sources":["utils/env-editor.native.js"],"sourcesContent":["import process from \"process\";\nimport path from \"path\";\nfunction allEditors() {\n return [\n {\n id: \"sublime\",\n name: \"Sublime Text\",\n binary: \"subl\",\n isTerminalEditor: false,\n paths: [\n \"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl\",\n \"/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl\"\n ],\n keywords: []\n },\n {\n id: \"atom\",\n name: \"Atom\",\n binary: \"atom\",\n isTerminalEditor: false,\n paths: [\n \"/Applications/Atom.app/Contents/Resources/app/atom.sh\"\n ],\n keywords: []\n },\n {\n id: \"vscode-insiders\",\n name: \"Visual Studio Code - Insiders\",\n binary: \"code-insiders\",\n isTerminalEditor: false,\n paths: [\n \"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin/code-insiders\"\n ],\n keywords: [\n \"vs code insiders\",\n \"code insiders\",\n \"insiders\"\n ]\n },\n {\n id: \"vscode\",\n name: \"Visual Studio Code\",\n binary: \"code\",\n isTerminalEditor: false,\n paths: [\n \"/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code\"\n ],\n keywords: [\n \"vs code\"\n ]\n },\n {\n id: \"vscodium\",\n name: \"VSCodium\",\n binary: \"codium\",\n isTerminalEditor: false,\n paths: [\n \"/Applications/VSCodium.app/Contents/Resources/app/bin/codium\"\n ],\n keywords: []\n },\n {\n id: \"webstorm\",\n name: \"WebStorm\",\n binary: \"webstorm\",\n isTerminalEditor: false,\n paths: [],\n keywords: [\n \"wstorm\"\n ]\n },\n {\n id: \"phpstorm\",\n name: \"PhpStorm\",\n binary: \"pstorm\",\n isTerminalEditor: false,\n paths: [],\n keywords: [\n \"php\"\n ]\n },\n {\n id: \"textmate\",\n name: \"TextMate\",\n binary: \"mate\",\n isTerminalEditor: false,\n paths: [],\n keywords: []\n },\n {\n id: \"vim\",\n name: \"Vim\",\n binary: \"vim\",\n isTerminalEditor: true,\n paths: [],\n keywords: [\n \"vi\"\n ]\n },\n {\n id: \"neovim\",\n name: \"NeoVim\",\n binary: \"nvim\",\n isTerminalEditor: true,\n paths: [],\n keywords: [\n \"vim\"\n ]\n },\n {\n id: \"intellij\",\n name: \"IntelliJ IDEA\",\n binary: \"idea\",\n isTerminalEditor: false,\n paths: [],\n keywords: [\n \"idea\",\n \"java\",\n \"jetbrains\",\n \"ide\"\n ]\n },\n {\n id: \"nano\",\n name: \"GNU nano\",\n binary: \"nano\",\n isTerminalEditor: true,\n paths: [],\n keywords: []\n },\n {\n id: \"emacs\",\n name: \"GNU Emacs\",\n binary: \"emacs\",\n isTerminalEditor: true,\n paths: [],\n keywords: []\n },\n {\n id: \"emacsforosx\",\n name: \"GNU Emacs for Mac OS X\",\n binary: \"Emacs\",\n isTerminalEditor: false,\n paths: [\n \"/Applications/Emacs.app/Contents/MacOS/Emacs\"\n ],\n keywords: []\n },\n {\n id: \"android-studio\",\n name: \"Android Studio\",\n binary: \"studio\",\n isTerminalEditor: false,\n paths: [\n \"/Applications/Android Studio.app/Contents/MacOS/studio\",\n \"/usr/local/Android/android-studio/bin/studio.sh\",\n \"C:\\\\Program Files (x86)\\\\Android\\\\android-studio\\\\bin\\\\studio.exe\",\n \"C:\\\\Program Files\\\\Android\\\\android-studio\\\\bin\\\\studio64.exe\"\n ],\n keywords: [\n \"studio\"\n ]\n },\n {\n id: \"xcode\",\n name: \"Xcode\",\n binary: \"xed\",\n isTerminalEditor: false,\n paths: [\n \"/Applications/Xcode.app/Contents/MacOS/Xcode\",\n \"/Applications/Xcode-beta.app/Contents/MacOS/Xcode\"\n ],\n keywords: [\n \"xed\"\n ]\n }\n ];\n}\nfunction getEditor(editor) {\n editor = editor.trim();\n var needle = editor.toLowerCase();\n var id = needle.split(/[/\\\\]/).pop().replace(/\\s/g, \"-\");\n var binary = id.split(\"-\")[0];\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = allEditors()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _$editor = _step.value;\n if (needle === _$editor.id || needle === _$editor.name.toLowerCase() || id === _$editor.binary) {\n return _$editor;\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = _$editor.paths[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var editorPath = _step1.value;\n if (path.normalize(needle) === path.normalize(editorPath.toLowerCase())) {\n return _$editor;\n }\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = _$editor.keywords[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var keyword = _step2.value;\n if (needle === keyword) {\n return _$editor;\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var _iteratorNormalCompletion3 = true, _didIteratorError3 = false, _iteratorError3 = void 0;\n try {\n for (var _iterator3 = allEditors()[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var _$editor1 = _step3.value;\n if (binary === _$editor1.binary) {\n return _$editor1;\n }\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return != null) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n return {\n id,\n name: editor,\n binary,\n isTerminalEditor: false,\n paths: [],\n keywords: []\n };\n}\nfunction defaultEditor() {\n var editor = process.env.EDITOR || process.env.VISUAL;\n if (!editor) {\n throw new Error(\n // eslint-disable-next-line indent\n `\nYour $EDITOR environment variable is not set.\nSet it to the command/path of your editor in ~/.zshenv or ~/.bashrc:\n\n export EDITOR=atom\n`\n );\n }\n return getEditor(editor);\n}\nexport {\n defaultEditor\n};\n//# sourceMappingURL=env-editor.js.map\n"],"mappings":"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"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { access, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
3
|
+
import { dirname } from "node:path";
|
|
4
|
+
|
|
5
|
+
async function pathExists(path) {
|
|
6
|
+
try {
|
|
7
|
+
await access(path);
|
|
8
|
+
return true;
|
|
9
|
+
} catch {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function stripBom(content) {
|
|
14
|
+
return content.replace(/^\uFEFF/, "");
|
|
15
|
+
}
|
|
16
|
+
function parseJSON(path, content) {
|
|
17
|
+
try {
|
|
18
|
+
return JSON.parse(stripBom(content));
|
|
19
|
+
} catch (err) {
|
|
20
|
+
;
|
|
21
|
+
err.message = `${path}: ${err.message}`;
|
|
22
|
+
throw err;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async function readJSON(path) {
|
|
26
|
+
return parseJSON(path, await readFile(path, "utf8"));
|
|
27
|
+
}
|
|
28
|
+
function readJSONSync(path) {
|
|
29
|
+
return parseJSON(path, readFileSync(path, "utf8"));
|
|
30
|
+
}
|
|
31
|
+
function stringifyJSON(data) {
|
|
32
|
+
return `${JSON.stringify(data)}
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
async function writeJSON(path, data) {
|
|
36
|
+
await writeFile(path, stringifyJSON(data));
|
|
37
|
+
}
|
|
38
|
+
async function outputJSON(path, data) {
|
|
39
|
+
await mkdir(dirname(path), { recursive: true });
|
|
40
|
+
await writeJSON(path, data);
|
|
41
|
+
}
|
|
42
|
+
function outputFileSync(path, data, options) {
|
|
43
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
44
|
+
writeFileSync(path, data, options);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { outputFileSync, outputJSON, pathExists, readJSON, readJSONSync, writeJSON };
|
|
48
|
+
//# sourceMappingURL=fs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.js","names":[],"sources":["utils/fs.js"],"sourcesContent":["import { mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { access, mkdir, readFile, writeFile } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\nasync function pathExists(path) {\n try {\n await access(path);\n return true;\n } catch {\n return false;\n }\n}\nfunction stripBom(content) {\n return content.replace(/^\\uFEFF/, \"\");\n}\nfunction parseJSON(path, content) {\n try {\n return JSON.parse(stripBom(content));\n } catch (err) {\n ;\n err.message = `${path}: ${err.message}`;\n throw err;\n }\n}\nasync function readJSON(path) {\n return parseJSON(path, await readFile(path, \"utf8\"));\n}\nfunction readJSONSync(path) {\n return parseJSON(path, readFileSync(path, \"utf8\"));\n}\nfunction stringifyJSON(data) {\n return `${JSON.stringify(data)}\n`;\n}\nasync function writeJSON(path, data) {\n await writeFile(path, stringifyJSON(data));\n}\nasync function outputJSON(path, data) {\n await mkdir(dirname(path), { recursive: true });\n await writeJSON(path, data);\n}\nfunction outputFileSync(path, data, options) {\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, data, options);\n}\nexport {\n outputFileSync,\n outputJSON,\n pathExists,\n readJSON,\n readJSONSync,\n writeJSON\n};\n//# sourceMappingURL=fs.js.map\n"],"mappings":";;;;;AAGA,eAAe,WAAW,MAAM;CAC9B,IAAI;EACF,MAAM,OAAO,IAAI;EACjB,OAAO;CACT,QAAQ;EACN,OAAO;CACT;AACF;AACA,SAAS,SAAS,SAAS;CACzB,OAAO,QAAQ,QAAQ,WAAW,EAAE;AACtC;AACA,SAAS,UAAU,MAAM,SAAS;CAChC,IAAI;EACF,OAAO,KAAK,MAAM,SAAS,OAAO,CAAC;CACrC,SAAS,KAAK;EACZ;EACA,IAAI,UAAU,GAAG,KAAK,IAAI,IAAI;EAC9B,MAAM;CACR;AACF;AACA,eAAe,SAAS,MAAM;CAC5B,OAAO,UAAU,MAAM,MAAM,SAAS,MAAM,MAAM,CAAC;AACrD;AACA,SAAS,aAAa,MAAM;CAC1B,OAAO,UAAU,MAAM,aAAa,MAAM,MAAM,CAAC;AACnD;AACA,SAAS,cAAc,MAAM;CAC3B,OAAO,GAAG,KAAK,UAAU,IAAI,EAAE;;AAEjC;AACA,eAAe,UAAU,MAAM,MAAM;CACnC,MAAM,UAAU,MAAM,cAAc,IAAI,CAAC;AAC3C;AACA,eAAe,WAAW,MAAM,MAAM;CACpC,MAAM,MAAM,QAAQ,IAAI,GAAG,EAAE,WAAW,KAAK,CAAC;CAC9C,MAAM,UAAU,MAAM,IAAI;AAC5B;AACA,SAAS,eAAe,MAAM,MAAM,SAAS;CAC3C,UAAU,QAAQ,IAAI,GAAG,EAAE,WAAW,KAAK,CAAC;CAC5C,cAAc,MAAM,MAAM,OAAO;AACnC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
2
|
+
import { access, mkdir, readFile, writeFile } from "fs/promises";
|
|
3
|
+
import { dirname } from "path";
|
|
4
|
+
|
|
5
|
+
async function pathExists(path) {
|
|
6
|
+
try {
|
|
7
|
+
await access(path);
|
|
8
|
+
return true;
|
|
9
|
+
} catch (unused) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function stripBom(content) {
|
|
14
|
+
return content.replace(/^\uFEFF/, "");
|
|
15
|
+
}
|
|
16
|
+
function parseJSON(path, content) {
|
|
17
|
+
try {
|
|
18
|
+
return JSON.parse(stripBom(content));
|
|
19
|
+
} catch (err) {
|
|
20
|
+
;
|
|
21
|
+
err.message = `${path}: ${err.message}`;
|
|
22
|
+
throw err;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async function readJSON(path) {
|
|
26
|
+
return parseJSON(path, await readFile(path, "utf8"));
|
|
27
|
+
}
|
|
28
|
+
function readJSONSync(path) {
|
|
29
|
+
return parseJSON(path, readFileSync(path, "utf8"));
|
|
30
|
+
}
|
|
31
|
+
function stringifyJSON(data) {
|
|
32
|
+
return `${JSON.stringify(data)}
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
async function writeJSON(path, data) {
|
|
36
|
+
await writeFile(path, stringifyJSON(data));
|
|
37
|
+
}
|
|
38
|
+
async function outputJSON(path, data) {
|
|
39
|
+
await mkdir(dirname(path), { recursive: true });
|
|
40
|
+
await writeJSON(path, data);
|
|
41
|
+
}
|
|
42
|
+
function outputFileSync(path, data, options) {
|
|
43
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
44
|
+
writeFileSync(path, data, options);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { outputFileSync, outputJSON, pathExists, readJSON, readJSONSync, writeJSON };
|
|
48
|
+
//# sourceMappingURL=fs.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.native.js","names":[],"sources":["utils/fs.native.js"],"sourcesContent":["import { mkdirSync, readFileSync, writeFileSync } from \"fs\";\nimport { access, mkdir, readFile, writeFile } from \"fs/promises\";\nimport { dirname } from \"path\";\nasync function pathExists(path) {\n try {\n await access(path);\n return true;\n } catch (unused) {\n return false;\n }\n}\nfunction stripBom(content) {\n return content.replace(/^\\uFEFF/, \"\");\n}\nfunction parseJSON(path, content) {\n try {\n return JSON.parse(stripBom(content));\n } catch (err) {\n ;\n err.message = `${path}: ${err.message}`;\n throw err;\n }\n}\nasync function readJSON(path) {\n return parseJSON(path, await readFile(path, \"utf8\"));\n}\nfunction readJSONSync(path) {\n return parseJSON(path, readFileSync(path, \"utf8\"));\n}\nfunction stringifyJSON(data) {\n return `${JSON.stringify(data)}\n`;\n}\nasync function writeJSON(path, data) {\n await writeFile(path, stringifyJSON(data));\n}\nasync function outputJSON(path, data) {\n await mkdir(dirname(path), {\n recursive: true\n });\n await writeJSON(path, data);\n}\nfunction outputFileSync(path, data, options) {\n mkdirSync(dirname(path), {\n recursive: true\n });\n writeFileSync(path, data, options);\n}\nexport {\n outputFileSync,\n outputJSON,\n pathExists,\n readJSON,\n readJSONSync,\n writeJSON\n};\n//# sourceMappingURL=fs.js.map\n"],"mappings":";;;;;AAGA,eAAe,WAAW,MAAM;CAC9B,IAAI;EACF,MAAM,OAAO,IAAI;EACjB,OAAO;CACT,SAAS,QAAQ;EACf,OAAO;CACT;AACF;AACA,SAAS,SAAS,SAAS;CACzB,OAAO,QAAQ,QAAQ,WAAW,EAAE;AACtC;AACA,SAAS,UAAU,MAAM,SAAS;CAChC,IAAI;EACF,OAAO,KAAK,MAAM,SAAS,OAAO,CAAC;CACrC,SAAS,KAAK;EACZ;EACA,IAAI,UAAU,GAAG,KAAK,IAAI,IAAI;EAC9B,MAAM;CACR;AACF;AACA,eAAe,SAAS,MAAM;CAC5B,OAAO,UAAU,MAAM,MAAM,SAAS,MAAM,MAAM,CAAC;AACrD;AACA,SAAS,aAAa,MAAM;CAC1B,OAAO,UAAU,MAAM,aAAa,MAAM,MAAM,CAAC;AACnD;AACA,SAAS,cAAc,MAAM;CAC3B,OAAO,GAAG,KAAK,UAAU,IAAI,EAAE;;AAEjC;AACA,eAAe,UAAU,MAAM,MAAM;CACnC,MAAM,UAAU,MAAM,cAAc,IAAI,CAAC;AAC3C;AACA,eAAe,WAAW,MAAM,MAAM;CACpC,MAAM,MAAM,QAAQ,IAAI,GAAG,EACzB,WAAW,KACb,CAAC;CACD,MAAM,UAAU,MAAM,IAAI;AAC5B;AACA,SAAS,eAAe,MAAM,MAAM,SAAS;CAC3C,UAAU,QAAQ,IAAI,GAAG,EACvB,WAAW,KACb,CAAC;CACD,cAAc,MAAM,MAAM,OAAO;AACnC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { dirname, join } from "node:path";
|
|
2
|
-
import
|
|
2
|
+
import { realpath } from "node:fs/promises";
|
|
3
3
|
import { normalizePath } from "vite";
|
|
4
4
|
|
|
5
5
|
async function getVitePath(rootPath, importer, moduleName, resolver, resolverWithPlugins, absolute = false) {
|
|
@@ -37,7 +37,7 @@ async function getVitePath(rootPath, importer, moduleName, resolver, resolverWit
|
|
|
37
37
|
if (!resolved) {
|
|
38
38
|
throw new Error(` \u274C Path not found ${sourceFile} (rootPath ${rootPath}, importer ${importer}, moduleName ${moduleName})`);
|
|
39
39
|
}
|
|
40
|
-
const real = await
|
|
40
|
+
const real = await realpath(resolved);
|
|
41
41
|
let id = real;
|
|
42
42
|
if (normalizePath(id).endsWith(`/react/jsx-dev-runtime.js`)) {
|
|
43
43
|
id = "react/jsx-runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getVitePath.js","names":[],"sources":["utils/getVitePath.js"],"sourcesContent":["import { dirname, join } from \"node:path\";\nimport
|
|
1
|
+
{"version":3,"file":"getVitePath.js","names":[],"sources":["utils/getVitePath.js"],"sourcesContent":["import { dirname, join } from \"node:path\";\nimport { realpath } from \"node:fs/promises\";\nimport { normalizePath } from \"vite\";\nasync function getVitePath(rootPath, importer, moduleName, resolver, resolverWithPlugins, absolute = false) {\n if (moduleName === \"react-native\") {\n return \"react-native\";\n }\n if (moduleName === \"react\") {\n return \"react\";\n }\n if (moduleName === \"react/jsx-runtime\") {\n return \"react/jsx-runtime\";\n }\n if (moduleName === \"react/jsx-dev-runtime\") {\n return \"react/jsx-dev-runtime\";\n }\n if (moduleName.includes(\"one/dist/esm/index\")) {\n return \"one\";\n }\n if (moduleName[0] === \".\") {\n const rootAt = importer.indexOf(rootPath);\n const base = join(dirname(importer.slice(rootAt)), moduleName);\n return base + \".js\";\n }\n if (moduleName === \"one\") {\n return \"one\";\n }\n if (moduleName === \"one\") {\n return \"one\";\n }\n const sourceFile = join(process.cwd(), \"index.js\");\n const resolved = await resolver(moduleName, sourceFile) || await resolverWithPlugins(\n moduleName,\n importer\n // @zetavg: we cannot use `sourceFile` here since it'll always end with `.js`, and plugins such as `vite-tsconfig-paths` may simply ignore if it doesn't end with `.ts` or `.tsx` (see: https://github.com/aleclarson/vite-tsconfig-paths/blob/v5.0.0/src/index.ts#L307-L310). Actually IDK why we are using the `sourceFile` but not the `importer` here.\n );\n if (!resolved) {\n return \"one\";\n }\n if (!resolved) {\n throw new Error(\n ` \\u274C Path not found ${sourceFile} (rootPath ${rootPath}, importer ${importer}, moduleName ${moduleName})`\n );\n }\n const real = await realpath(resolved);\n let id = real;\n if (normalizePath(id).endsWith(`/react/jsx-dev-runtime.js`)) {\n id = \"react/jsx-runtime\";\n }\n return id;\n}\nexport {\n getVitePath\n};\n//# sourceMappingURL=getVitePath.js.map\n"],"mappings":";;;;;AAGA,eAAe,YAAY,UAAU,UAAU,YAAY,UAAU,qBAAqB,WAAW,OAAO;CAC1G,IAAI,eAAe,gBAAgB;EACjC,OAAO;CACT;CACA,IAAI,eAAe,SAAS;EAC1B,OAAO;CACT;CACA,IAAI,eAAe,qBAAqB;EACtC,OAAO;CACT;CACA,IAAI,eAAe,yBAAyB;EAC1C,OAAO;CACT;CACA,IAAI,WAAW,SAAS,oBAAoB,GAAG;EAC7C,OAAO;CACT;CACA,IAAI,WAAW,OAAO,KAAK;EACzB,MAAM,SAAS,SAAS,QAAQ,QAAQ;EACxC,MAAM,OAAO,KAAK,QAAQ,SAAS,MAAM,MAAM,CAAC,GAAG,UAAU;EAC7D,OAAO,OAAO;CAChB;CACA,IAAI,eAAe,OAAO;EACxB,OAAO;CACT;CACA,IAAI,eAAe,OAAO;EACxB,OAAO;CACT;CACA,MAAM,aAAa,KAAK,QAAQ,IAAI,GAAG,UAAU;CACjD,MAAM,WAAW,MAAM,SAAS,YAAY,UAAU,KAAK,MAAM,oBAC/D,YACA,QAEF;CACA,IAAI,CAAC,UAAU;EACb,OAAO;CACT;CACA,IAAI,CAAC,UAAU;EACb,MAAM,IAAI,MACR,0BAA0B,WAAW,aAAa,SAAS,aAAa,SAAS,eAAe,WAAW,EAC7G;CACF;CACA,MAAM,OAAO,MAAM,SAAS,QAAQ;CACpC,IAAI,KAAK;CACT,IAAI,cAAc,EAAE,CAAC,CAAC,SAAS,2BAA2B,GAAG;EAC3D,KAAK;CACP;CACA,OAAO;AACT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { dirname, join } from "path";
|
|
2
|
-
import
|
|
2
|
+
import { realpath } from "fs/promises";
|
|
3
3
|
import { normalizePath } from "vite";
|
|
4
4
|
|
|
5
5
|
async function getVitePath(rootPath, importer, moduleName, resolver, resolverWithPlugins) {
|
|
@@ -38,7 +38,7 @@ async function getVitePath(rootPath, importer, moduleName, resolver, resolverWit
|
|
|
38
38
|
if (!resolved) {
|
|
39
39
|
throw new Error(` \u274C Path not found ${sourceFile} (rootPath ${rootPath}, importer ${importer}, moduleName ${moduleName})`);
|
|
40
40
|
}
|
|
41
|
-
var real = await
|
|
41
|
+
var real = await realpath(resolved);
|
|
42
42
|
var id = real;
|
|
43
43
|
if (normalizePath(id).endsWith(`/react/jsx-dev-runtime.js`)) {
|
|
44
44
|
id = "react/jsx-runtime";
|