prisma 6.19.0 → 6.20.0-dev.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.
Files changed (164) hide show
  1. package/build/index.js +3826 -4207
  2. package/build/prisma_schema_build_bg.wasm +0 -0
  3. package/build/query_compiler_bg.cockroachdb.js +2 -2
  4. package/build/query_compiler_bg.cockroachdb.mjs +2 -2
  5. package/build/query_compiler_bg.cockroachdb.wasm +0 -0
  6. package/build/query_compiler_bg.mysql.js +2 -2
  7. package/build/query_compiler_bg.mysql.mjs +2 -2
  8. package/build/query_compiler_bg.mysql.wasm +0 -0
  9. package/build/query_compiler_bg.postgresql.js +2 -2
  10. package/build/query_compiler_bg.postgresql.mjs +2 -2
  11. package/build/query_compiler_bg.postgresql.wasm +0 -0
  12. package/build/query_compiler_bg.sqlite.js +2 -2
  13. package/build/query_compiler_bg.sqlite.mjs +2 -2
  14. package/build/query_compiler_bg.sqlite.wasm +0 -0
  15. package/build/query_compiler_bg.sqlserver.js +2 -2
  16. package/build/query_compiler_bg.sqlserver.mjs +2 -2
  17. package/build/query_compiler_bg.sqlserver.wasm +0 -0
  18. package/build/schema_engine_bg.wasm +0 -0
  19. package/build/xdg-open +1 -1
  20. package/package.json +38 -23
  21. package/preinstall/index.js +6 -6
  22. package/build/public/assets/alert.60ea9f84.svg +0 -5
  23. package/build/public/assets/array.1a36c222.svg +0 -4
  24. package/build/public/assets/boolean.9188b434.svg +0 -4
  25. package/build/public/assets/chevron-down.24f76e3c.svg +0 -3
  26. package/build/public/assets/cross.c2610cf5.svg +0 -11
  27. package/build/public/assets/datetime.a3bf710a.svg +0 -4
  28. package/build/public/assets/download.8d34b65a.svg +0 -4
  29. package/build/public/assets/ellipsis.a8c5a34a.svg +0 -10
  30. package/build/public/assets/enum.7ec0b64c.svg +0 -6
  31. package/build/public/assets/folder.d77b8eaf.svg +0 -6
  32. package/build/public/assets/hamburger.5fdadeac.svg +0 -4
  33. package/build/public/assets/index.js +0 -1
  34. package/build/public/assets/inter-all-400-normal.4c1f8a0d.woff +0 -0
  35. package/build/public/assets/inter-all-600-normal.d0a7c8a9.woff +0 -0
  36. package/build/public/assets/inter-cyrillic-400-normal.ac97a49e.woff2 +0 -0
  37. package/build/public/assets/inter-cyrillic-600-normal.2c917f10.woff2 +0 -0
  38. package/build/public/assets/inter-cyrillic-ext-400-normal.f21a6a97.woff2 +0 -0
  39. package/build/public/assets/inter-cyrillic-ext-600-normal.bb31f197.woff2 +0 -0
  40. package/build/public/assets/inter-greek-400-normal.e9163df8.woff2 +0 -0
  41. package/build/public/assets/inter-greek-600-normal.e644d70f.woff2 +0 -0
  42. package/build/public/assets/inter-greek-ext-400-normal.43addcc8.woff2 +0 -0
  43. package/build/public/assets/inter-greek-ext-600-normal.7f437016.woff2 +0 -0
  44. package/build/public/assets/inter-latin-400-normal.27ae72da.woff2 +0 -0
  45. package/build/public/assets/inter-latin-600-normal.87d718a2.woff2 +0 -0
  46. package/build/public/assets/inter-latin-ext-400-normal.5b02c69a.woff2 +0 -0
  47. package/build/public/assets/inter-latin-ext-600-normal.88feb9e4.woff2 +0 -0
  48. package/build/public/assets/inter-vietnamese-600-normal.8185dacd.woff2 +0 -0
  49. package/build/public/assets/jetbrains-mono-all-400-normal.f86807b7.woff +0 -0
  50. package/build/public/assets/jetbrains-mono-cyrillic-400-normal.1ae57fe2.woff2 +0 -0
  51. package/build/public/assets/jetbrains-mono-latin-400-normal.80a5dc9e.woff2 +0 -0
  52. package/build/public/assets/jetbrains-mono-latin-ext-400-normal.6315c53c.woff2 +0 -0
  53. package/build/public/assets/logotype.a960b169.svg +0 -4
  54. package/build/public/assets/maximize.ce1a88fc.svg +0 -1
  55. package/build/public/assets/minimize.23fe727a.svg +0 -1
  56. package/build/public/assets/moon.387ab66c.svg +0 -1
  57. package/build/public/assets/number.85ddf96b.svg +0 -7
  58. package/build/public/assets/object.0ba944a6.svg +0 -5
  59. package/build/public/assets/panel-left.a81e4b97.svg +0 -1
  60. package/build/public/assets/play.8811691e.svg +0 -6
  61. package/build/public/assets/plus.8fbf7ad3.svg +0 -4
  62. package/build/public/assets/refresh.d5448ccc.svg +0 -4
  63. package/build/public/assets/search.2ed766ce.svg +0 -7
  64. package/build/public/assets/settings.5ad25af2.svg +0 -8
  65. package/build/public/assets/string.ea615a24.svg +0 -4
  66. package/build/public/assets/sun.89774753.svg +0 -1
  67. package/build/public/assets/tick-indeterminate.aec8a44d.svg +0 -3
  68. package/build/public/assets/tick.8cbb6a93.svg +0 -4
  69. package/build/public/assets/vendor.js +0 -441
  70. package/build/public/favicon.svg +0 -5
  71. package/build/public/http/databrowser.js +0 -1
  72. package/build/public/http/splash.js +0 -1
  73. package/build/public/icon-1024.png +0 -0
  74. package/build/public/index.css +0 -1
  75. package/build/public/pages/http/databrowser.html +0 -21
  76. package/build/public/pages/http/splash.html +0 -21
  77. package/build/query_engine_bg.cockroachdb.js +0 -2
  78. package/build/query_engine_bg.cockroachdb.mjs +0 -2
  79. package/build/query_engine_bg.cockroachdb.wasm +0 -0
  80. package/build/query_engine_bg.mysql.js +0 -2
  81. package/build/query_engine_bg.mysql.mjs +0 -2
  82. package/build/query_engine_bg.mysql.wasm +0 -0
  83. package/build/query_engine_bg.postgresql.js +0 -2
  84. package/build/query_engine_bg.postgresql.mjs +0 -2
  85. package/build/query_engine_bg.postgresql.wasm +0 -0
  86. package/build/query_engine_bg.sqlite.js +0 -2
  87. package/build/query_engine_bg.sqlite.mjs +0 -2
  88. package/build/query_engine_bg.sqlite.wasm +0 -0
  89. package/build/query_engine_bg.sqlserver.js +0 -2
  90. package/build/query_engine_bg.sqlserver.mjs +0 -2
  91. package/build/query_engine_bg.sqlserver.wasm +0 -0
  92. package/prisma-client/README.md +0 -27
  93. package/prisma-client/default.d.ts +0 -1
  94. package/prisma-client/default.js +0 -3
  95. package/prisma-client/edge.d.ts +0 -1
  96. package/prisma-client/edge.js +0 -4
  97. package/prisma-client/extension.d.ts +0 -1
  98. package/prisma-client/extension.js +0 -4
  99. package/prisma-client/generator-build/index.js +0 -18861
  100. package/prisma-client/index-browser.js +0 -3
  101. package/prisma-client/index.d.ts +0 -1
  102. package/prisma-client/index.js +0 -4
  103. package/prisma-client/package.json +0 -328
  104. package/prisma-client/react-native.d.ts +0 -1
  105. package/prisma-client/react-native.js +0 -3
  106. package/prisma-client/runtime/binary.d.ts +0 -1
  107. package/prisma-client/runtime/binary.js +0 -286
  108. package/prisma-client/runtime/binary.js.map +0 -7
  109. package/prisma-client/runtime/binary.mjs +0 -293
  110. package/prisma-client/runtime/binary.mjs.map +0 -7
  111. package/prisma-client/runtime/client.d.mts +0 -3982
  112. package/prisma-client/runtime/client.d.ts +0 -3982
  113. package/prisma-client/runtime/client.js +0 -106
  114. package/prisma-client/runtime/client.js.map +0 -7
  115. package/prisma-client/runtime/client.mjs +0 -113
  116. package/prisma-client/runtime/client.mjs.map +0 -7
  117. package/prisma-client/runtime/edge-esm.js +0 -31
  118. package/prisma-client/runtime/edge-esm.js.map +0 -7
  119. package/prisma-client/runtime/edge.d.ts +0 -3982
  120. package/prisma-client/runtime/edge.js +0 -31
  121. package/prisma-client/runtime/edge.js.map +0 -7
  122. package/prisma-client/runtime/index-browser.d.mts +0 -370
  123. package/prisma-client/runtime/index-browser.d.ts +0 -370
  124. package/prisma-client/runtime/index-browser.js +0 -13
  125. package/prisma-client/runtime/index-browser.js.map +0 -7
  126. package/prisma-client/runtime/index-browser.mjs +0 -13
  127. package/prisma-client/runtime/index-browser.mjs.map +0 -7
  128. package/prisma-client/runtime/library.d.mts +0 -3982
  129. package/prisma-client/runtime/library.d.ts +0 -3982
  130. package/prisma-client/runtime/library.js +0 -143
  131. package/prisma-client/runtime/library.js.map +0 -7
  132. package/prisma-client/runtime/library.mjs +0 -150
  133. package/prisma-client/runtime/library.mjs.map +0 -7
  134. package/prisma-client/runtime/query_compiler_bg.cockroachdb.js +0 -2
  135. package/prisma-client/runtime/query_compiler_bg.cockroachdb.mjs +0 -2
  136. package/prisma-client/runtime/query_compiler_bg.mysql.js +0 -2
  137. package/prisma-client/runtime/query_compiler_bg.mysql.mjs +0 -2
  138. package/prisma-client/runtime/query_compiler_bg.postgresql.js +0 -2
  139. package/prisma-client/runtime/query_compiler_bg.postgresql.mjs +0 -2
  140. package/prisma-client/runtime/query_compiler_bg.sqlite.js +0 -2
  141. package/prisma-client/runtime/query_compiler_bg.sqlite.mjs +0 -2
  142. package/prisma-client/runtime/query_compiler_bg.sqlserver.js +0 -2
  143. package/prisma-client/runtime/query_compiler_bg.sqlserver.mjs +0 -2
  144. package/prisma-client/runtime/query_engine_bg.cockroachdb.js +0 -2
  145. package/prisma-client/runtime/query_engine_bg.cockroachdb.mjs +0 -2
  146. package/prisma-client/runtime/query_engine_bg.mysql.js +0 -2
  147. package/prisma-client/runtime/query_engine_bg.mysql.mjs +0 -2
  148. package/prisma-client/runtime/query_engine_bg.postgresql.js +0 -2
  149. package/prisma-client/runtime/query_engine_bg.postgresql.mjs +0 -2
  150. package/prisma-client/runtime/query_engine_bg.sqlite.js +0 -2
  151. package/prisma-client/runtime/query_engine_bg.sqlite.mjs +0 -2
  152. package/prisma-client/runtime/query_engine_bg.sqlserver.js +0 -2
  153. package/prisma-client/runtime/query_engine_bg.sqlserver.mjs +0 -2
  154. package/prisma-client/runtime/react-native.d.ts +0 -3982
  155. package/prisma-client/runtime/react-native.js +0 -80
  156. package/prisma-client/runtime/react-native.js.map +0 -7
  157. package/prisma-client/scripts/colors.js +0 -176
  158. package/prisma-client/scripts/default-index.d.ts +0 -110
  159. package/prisma-client/scripts/default-index.js +0 -65
  160. package/prisma-client/scripts/postinstall.d.ts +0 -5
  161. package/prisma-client/scripts/postinstall.js +0 -404
  162. package/prisma-client/sql.d.ts +0 -1
  163. package/prisma-client/sql.js +0 -4
  164. package/prisma-client/sql.mjs +0 -1
@@ -1,404 +0,0 @@
1
- // @ts-check
2
- const childProcess = require('child_process')
3
- const { promisify } = require('util')
4
- const fs = require('fs')
5
- const path = require('path')
6
- const c = require('./colors')
7
-
8
- const exec = promisify(childProcess.exec)
9
-
10
- function debug(message, ...optionalParams) {
11
- if (process.env.DEBUG && process.env.DEBUG === 'prisma:postinstall') {
12
- console.log(message, ...optionalParams)
13
- }
14
- }
15
- /**
16
- * Adds `package.json` to the end of a path if it doesn't already exist'
17
- * @param {string} pth
18
- */
19
- function addPackageJSON(pth) {
20
- if (pth.endsWith('package.json')) return pth
21
- return path.join(pth, 'package.json')
22
- }
23
-
24
- /**
25
- * Looks up for a `package.json` which is not `@prisma/cli` or `prisma` and returns the directory of the package
26
- * @param {string | null} startPath - Path to Start At
27
- * @param {number} limit - Find Up limit
28
- * @returns {string | null}
29
- */
30
- function findPackageRoot(startPath, limit = 10) {
31
- if (!startPath || !fs.existsSync(startPath)) return null
32
- let currentPath = startPath
33
- // Limit traversal
34
- for (let i = 0; i < limit; i++) {
35
- const pkgPath = addPackageJSON(currentPath)
36
- if (fs.existsSync(pkgPath)) {
37
- try {
38
- const pkg = require(pkgPath)
39
- if (pkg.name && !['@prisma/cli', 'prisma'].includes(pkg.name)) {
40
- return pkgPath.replace('package.json', '')
41
- }
42
- } catch {} // eslint-disable-line no-empty
43
- }
44
- currentPath = path.join(currentPath, '../')
45
- }
46
- return null
47
- }
48
-
49
- /**
50
- * The `postinstall` hook of client sets up the ground and env vars for the `prisma generate` command,
51
- * and runs it, showing a warning if the schema is not found.
52
- * - initializes the ./node_modules/.prisma/client folder with the default index(-browser).js/index.d.ts,
53
- * which define a `PrismaClient` class stub that throws an error if instantiated before the `prisma generate`
54
- * command is successfully executed.
55
- * - sets the path of the root of the project (TODO: to verify) to the `process.env.PRISMA_GENERATE_IN_POSTINSTALL`
56
- * variable, or `'true'` if the project root cannot be found.
57
- * - runs `prisma generate`, passing through additional information about the command that triggered the generation,
58
- * which is useful for debugging/telemetry. It tries to use the local `prisma` package if it is installed, otherwise it
59
- * falls back to the global `prisma` package. If neither options are available, it warns the user to install `prisma` first.
60
- */
61
- async function main() {
62
- if (process.env.INIT_CWD) {
63
- process.chdir(process.env.INIT_CWD) // necessary, because npm chooses __dirname as process.cwd()
64
- // in the postinstall hook
65
- }
66
-
67
- await createDefaultGeneratedThrowFiles()
68
-
69
- // TODO: consider using the `which` package
70
- const localPath = getLocalPackagePath()
71
-
72
- // Only execute if !localpath
73
- const installedGlobally = localPath ? undefined : await isInstalledGlobally()
74
-
75
- // this is needed, so we can find the correct schemas in yarn workspace projects
76
- const root = findPackageRoot(localPath)
77
-
78
- process.env.PRISMA_GENERATE_IN_POSTINSTALL = root ? root : 'true'
79
-
80
- debug({
81
- localPath,
82
- installedGlobally,
83
- init_cwd: process.env.INIT_CWD,
84
- PRISMA_GENERATE_IN_POSTINSTALL: process.env.PRISMA_GENERATE_IN_POSTINSTALL,
85
- })
86
- try {
87
- if (localPath) {
88
- await run('node', [localPath, 'generate', '--postinstall', doubleQuote(getPostInstallTrigger())])
89
- return
90
- }
91
- if (installedGlobally) {
92
- await run('prisma', ['generate', '--postinstall', doubleQuote(getPostInstallTrigger())])
93
- return
94
- }
95
- } catch (e) {
96
- // if exit code = 1 do not print
97
- if (e && e !== 1) {
98
- console.error(e)
99
- }
100
- debug(e)
101
- }
102
-
103
- if (!localPath && !installedGlobally) {
104
- console.error(
105
- `${c.yellow(
106
- 'warning',
107
- )} In order to use "@prisma/client", please install Prisma CLI. You can install it with "npm add -D prisma".`,
108
- )
109
- }
110
- }
111
-
112
- function getLocalPackagePath() {
113
- try {
114
- const packagePath = require.resolve('prisma/package.json')
115
- if (packagePath) {
116
- return require.resolve('prisma')
117
- }
118
- } catch (e) {} // eslint-disable-line no-empty
119
-
120
- // TODO: consider removing this
121
- try {
122
- const packagePath = require.resolve('@prisma/cli/package.json')
123
- if (packagePath) {
124
- return require.resolve('@prisma/cli')
125
- }
126
- } catch (e) {} // eslint-disable-line no-empty
127
-
128
- return null
129
- }
130
-
131
- async function isInstalledGlobally() {
132
- try {
133
- const result = await exec('prisma -v')
134
- if (result.stdout.includes('@prisma/client')) {
135
- return true
136
- } else {
137
- console.error(`${c.yellow('warning')} You still have the ${c.bold('prisma')} cli (Prisma 1) installed globally.
138
- Please uninstall it with either ${c.green('npm remove -g prisma')} or ${c.green('yarn global remove prisma')}.`)
139
- }
140
- } catch (e) {
141
- return false
142
- }
143
- }
144
-
145
- if (!process.env.PRISMA_SKIP_POSTINSTALL_GENERATE) {
146
- main()
147
- .catch((e) => {
148
- if (e.stderr) {
149
- if (e.stderr.includes(`Can't find schema.prisma`)) {
150
- console.error(
151
- `${c.yellow('warning')} @prisma/client needs a ${c.bold('schema.prisma')} to function, but couldn't find it.
152
- Please either create one manually or use ${c.bold('prisma init')}.
153
- Once you created it, run ${c.bold('prisma generate')}.
154
- To keep Prisma related things separate, we recommend creating it in a subfolder called ${c.underline(
155
- './prisma',
156
- )} like so: ${c.underline('./prisma/schema.prisma')}\n`,
157
- )
158
- } else {
159
- console.error(e.stderr)
160
- }
161
- } else {
162
- console.error(e)
163
- }
164
- process.exit(0)
165
- })
166
- .finally(() => {
167
- debug(`postinstall trigger: ${getPostInstallTrigger()}`)
168
- })
169
- }
170
-
171
- function run(cmd, params, cwd = process.cwd()) {
172
- const child = childProcess.spawn(cmd, params, {
173
- stdio: ['pipe', 'inherit', 'inherit'],
174
- cwd,
175
- })
176
-
177
- return new Promise((resolve, reject) => {
178
- child.on('close', () => {
179
- resolve(undefined)
180
- })
181
- child.on('exit', (code) => {
182
- if (code === 0) {
183
- resolve(undefined)
184
- } else {
185
- reject(code)
186
- }
187
- })
188
- child.on('error', () => {
189
- reject()
190
- })
191
- })
192
- }
193
-
194
- /**
195
- * Copies our default "throw" files into the default generation folder. These
196
- * files are dummy and informative because they just throw an error to let the
197
- * user know that they have forgotten to run `prisma generate` or that they
198
- * don't have a a schema file yet. We only add these files at the default
199
- * location `node_modules/.prisma/client`.
200
- */
201
- async function createDefaultGeneratedThrowFiles() {
202
- try {
203
- const dotPrismaClientDir = path.join(__dirname, '../../../.prisma/client')
204
-
205
- await makeDir(dotPrismaClientDir)
206
-
207
- const defaultFileConfig = {
208
- js: path.join(__dirname, 'default-index.js'),
209
- ts: path.join(__dirname, 'default-index.d.ts'),
210
- }
211
-
212
- /**
213
- * @type {Record<string, { js?: string; ts?: string } | undefined>}
214
- */
215
- const defaultFiles = {
216
- index: defaultFileConfig,
217
- edge: defaultFileConfig,
218
- default: defaultFileConfig,
219
- wasm: defaultFileConfig,
220
- 'index-browser': {
221
- js: path.join(__dirname, 'default-index.js'),
222
- ts: undefined,
223
- },
224
- }
225
-
226
- for (const file of Object.keys(defaultFiles)) {
227
- const { js, ts } = defaultFiles[file] ?? {}
228
- const dotPrismaJsFilePath = path.join(dotPrismaClientDir, `${file}.js`)
229
- const dotPrismaTsFilePath = path.join(dotPrismaClientDir, `${file}.d.ts`)
230
-
231
- if (js && !fs.existsSync(dotPrismaJsFilePath) && fs.existsSync(js)) {
232
- await fs.promises.copyFile(js, dotPrismaJsFilePath)
233
- }
234
-
235
- if (ts && !fs.existsSync(dotPrismaTsFilePath) && fs.existsSync(ts)) {
236
- await fs.promises.copyFile(ts, dotPrismaTsFilePath)
237
- }
238
- }
239
- } catch (e) {
240
- console.error(e)
241
- }
242
- }
243
-
244
- // TODO: can this be replaced some utility eg. mkdir
245
- function makeDir(input) {
246
- const make = async (pth) => {
247
- try {
248
- await fs.promises.mkdir(pth)
249
-
250
- return pth
251
- } catch (error) {
252
- if (error.code === 'EPERM') {
253
- throw error
254
- }
255
-
256
- if (error.code === 'ENOENT') {
257
- if (path.dirname(pth) === pth) {
258
- throw new Error(`operation not permitted, mkdir '${pth}'`)
259
- }
260
-
261
- if (error.message.includes('null bytes')) {
262
- throw error
263
- }
264
-
265
- await make(path.dirname(pth))
266
-
267
- return make(pth)
268
- }
269
-
270
- try {
271
- const stats = await fs.promises.stat(pth)
272
- if (!stats.isDirectory()) {
273
- throw new Error('The path is not a directory')
274
- }
275
- } catch (_) {
276
- throw error
277
- }
278
-
279
- return pth
280
- }
281
- }
282
-
283
- return make(path.resolve(input))
284
- }
285
-
286
- /**
287
- * Get the command that triggered this postinstall script being run. If there is
288
- * an error while attempting to get this value then the string constant
289
- * 'ERROR_WHILE_FINDING_POSTINSTALL_TRIGGER' is returned.
290
- * This information is just necessary for telemetry.
291
- * This is passed to `prisma generate` as a string like `--postinstall value`.
292
- */
293
- function getPostInstallTrigger() {
294
- /*
295
- npm_config_argv` is not officially documented so here are our research notes
296
-
297
- `npm_config_argv` is available to the postinstall script when the containing package has been installed by npm into some project.
298
-
299
- An example of its value:
300
-
301
- ```
302
- npm_config_argv: '{"remain":["../test"],"cooked":["add","../test"],"original":["add","../test"]}',
303
- ```
304
-
305
- We are interesting in the data contained in the "original" field.
306
-
307
- Trivia/Note: `npm_config_argv` is not available when running e.g. `npm install` on the containing package itself (e.g. when working on it)
308
-
309
- Yarn mimics this data and environment variable. Here is an example following `yarn add` for the same package:
310
-
311
- ```
312
- npm_config_argv: '{"remain":[],"cooked":["add"],"original":["add","../test"]}'
313
- ```
314
-
315
- Other package managers like `pnpm` have not been tested.
316
- */
317
-
318
- const maybe_npm_config_argv_string = process.env.npm_config_argv
319
-
320
- if (maybe_npm_config_argv_string === undefined) {
321
- return UNABLE_TO_FIND_POSTINSTALL_TRIGGER__ENVAR_MISSING
322
- }
323
-
324
- let npm_config_argv
325
- try {
326
- npm_config_argv = JSON.parse(maybe_npm_config_argv_string)
327
- } catch (e) {
328
- return `${UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_PARSE_ERROR}: ${maybe_npm_config_argv_string}`
329
- }
330
-
331
- if (typeof npm_config_argv !== 'object' || npm_config_argv === null) {
332
- return `${UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR}: ${maybe_npm_config_argv_string}`
333
- }
334
-
335
- const npm_config_argv_original_arr = npm_config_argv.original
336
-
337
- if (!Array.isArray(npm_config_argv_original_arr)) {
338
- return `${UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR}: ${maybe_npm_config_argv_string}`
339
- }
340
-
341
- const npm_config_argv_original = npm_config_argv_original_arr.filter((arg) => arg !== '').join(' ')
342
-
343
- const command =
344
- npm_config_argv_original === ''
345
- ? getPackageManagerName()
346
- : [getPackageManagerName(), npm_config_argv_original].join(' ')
347
-
348
- return command
349
- }
350
-
351
- /**
352
- * Wrap double quotes around the given string.
353
- */
354
- function doubleQuote(x) {
355
- return `"${x}"`
356
- }
357
-
358
- /**
359
- * Get the package manager name currently being used. If parsing fails, then the following pattern is returned:
360
- * UNKNOWN_NPM_CONFIG_USER_AGENT(<string received>).
361
- */
362
- function getPackageManagerName() {
363
- const userAgent = process.env.npm_config_user_agent
364
- if (!userAgent) return 'MISSING_NPM_CONFIG_USER_AGENT'
365
-
366
- const name = parsePackageManagerName(userAgent)
367
- if (!name) return `UNKNOWN_NPM_CONFIG_USER_AGENT(${userAgent})`
368
-
369
- return name
370
- }
371
-
372
- /**
373
- * Parse package manager name from useragent. If parsing fails, `null` is returned.
374
- */
375
- function parsePackageManagerName(userAgent) {
376
- let packageManager = null
377
-
378
- // example: 'yarn/1.22.4 npm/? node/v13.11.0 darwin x64'
379
- // References:
380
- // - https://pnpm.io/only-allow-pnpm
381
- // - https://github.com/cameronhunter/npm-config-user-agent-parser
382
- if (userAgent) {
383
- const matchResult = userAgent.match(/^([^/]+)\/.+/)
384
- if (matchResult) {
385
- packageManager = matchResult[1].trim()
386
- }
387
- }
388
-
389
- return packageManager
390
- }
391
-
392
- // prettier-ignore
393
- const UNABLE_TO_FIND_POSTINSTALL_TRIGGER__ENVAR_MISSING = 'UNABLE_TO_FIND_POSTINSTALL_TRIGGER__ENVAR_MISSING'
394
- // prettier-ignore
395
- const UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_PARSE_ERROR = 'UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_PARSE_ERROR'
396
- // prettier-ignore
397
- const UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR = 'UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR'
398
-
399
- // expose for testing
400
-
401
- exports.UNABLE_TO_FIND_POSTINSTALL_TRIGGER__ENVAR_MISSING = UNABLE_TO_FIND_POSTINSTALL_TRIGGER__ENVAR_MISSING
402
- exports.UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_PARSE_ERROR = UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_PARSE_ERROR
403
- exports.UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR = UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR
404
- exports.getPostInstallTrigger = getPostInstallTrigger
@@ -1 +0,0 @@
1
- export * from '.prisma/client/sql'
@@ -1,4 +0,0 @@
1
- 'use strict'
2
- module.exports = {
3
- ...require('.prisma/client/sql'),
4
- }
@@ -1 +0,0 @@
1
- export * from '../../.prisma/client/sql/index.mjs'