@orion-js/core 3.11.14 → 4.0.0-next.1
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/build/compile.d.ts +3 -0
- package/dist/build/getOptions.d.ts +7 -0
- package/dist/build/index.d.ts +3 -0
- package/dist/create/index.d.ts +4 -0
- package/dist/fsevents-hj42pnne.node +0 -0
- package/dist/handleErrors.d.ts +1 -0
- package/dist/helpers/ensureDirectory.d.ts +2 -0
- package/dist/helpers/execute.d.ts +1 -0
- package/dist/helpers/getFileContents.d.ts +1 -0
- package/dist/helpers/getModulesToWatch.d.ts +1 -0
- package/dist/helpers/isPortInUse.d.ts +1 -0
- package/dist/helpers/runOnce.d.ts +1 -0
- package/dist/helpers/sleep.d.ts +2 -0
- package/dist/helpers/writeFile.d.ts +1 -0
- package/dist/index.cjs +196340 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +196332 -0
- package/dist/start/copyCursorRule/index.d.ts +1 -0
- package/dist/start/copyMCP/consts.d.ts +2 -0
- package/dist/start/copyMCP/index.d.ts +1 -0
- package/dist/start/copyMCP/isValidMCPRepo.d.ts +5 -0
- package/dist/start/index.d.ts +2 -0
- package/dist/start/runner/getArgs.d.ts +5 -0
- package/dist/start/runner/index.d.ts +12 -0
- package/dist/start/runner/startProcess.d.ts +1 -0
- package/dist/start/watchAndCompile/cleanDirectory.d.ts +1 -0
- package/dist/start/watchAndCompile/ensureConfigComplies.d.ts +1 -0
- package/dist/start/watchAndCompile/getConfigPath.d.ts +1 -0
- package/dist/start/watchAndCompile/getHost.d.ts +3 -0
- package/dist/start/watchAndCompile/index.d.ts +2 -0
- package/dist/start/watchAndCompile/reports.d.ts +2 -0
- package/dist/start/watchAndCompile/watchDeletes.d.ts +1 -0
- package/dist/start/watchAndCompile/writeEnvFile.d.ts +2 -0
- package/dist/start/watchAndCompile/writeIndex/index.d.ts +3 -0
- package/dist/test/index.d.ts +1 -0
- package/dist/version.d.ts +2 -0
- package/package.json +22 -10
- package/LICENSE +0 -21
- package/lib/build/compile.js +0 -28
- package/lib/build/getOptions.js +0 -36
- package/lib/build/index.js +0 -21
- package/lib/create/index.js +0 -20
- package/lib/handleErrors.js +0 -20
- package/lib/helpers/ensureDirectory.js +0 -15
- package/lib/helpers/execute.js +0 -16
- package/lib/helpers/getFileContents.js +0 -12
- package/lib/helpers/getModulesToWatch.js +0 -39
- package/lib/helpers/isPortInUse.js +0 -26
- package/lib/helpers/runOnce.js +0 -14
- package/lib/helpers/sleep.js +0 -3
- package/lib/helpers/writeFile.js +0 -12
- package/lib/index.js +0 -52
- package/lib/start/copyCursorRule/index.js +0 -66
- package/lib/start/copyMCP/consts.js +0 -6
- package/lib/start/copyMCP/index.js +0 -87
- package/lib/start/copyMCP/isValidMCPRepo.js +0 -56
- package/lib/start/index.js +0 -25
- package/lib/start/runner/getArgs.js +0 -19
- package/lib/start/runner/index.js +0 -42
- package/lib/start/runner/startProcess.js +0 -18
- package/lib/start/watchAndCompile/cleanDirectory.js +0 -34
- package/lib/start/watchAndCompile/ensureConfigComplies.js +0 -31
- package/lib/start/watchAndCompile/getConfigPath.js +0 -19
- package/lib/start/watchAndCompile/getHost.js +0 -38
- package/lib/start/watchAndCompile/index.js +0 -18
- package/lib/start/watchAndCompile/reports.js +0 -16
- package/lib/start/watchAndCompile/watchDeletes.js +0 -29
- package/lib/start/watchAndCompile/writeEnvFile.js +0 -22
- package/lib/start/watchAndCompile/writeIndex/index.js +0 -28
- package/lib/test/index.js +0 -12
- package/lib/version.js +0 -3
- package/moduleAlias.js.txt +0 -224
- package/tsconfig.json +0 -15
package/moduleAlias.js.txt
DELETED
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
// https://github.com/ilearnio/module-alias/blob/dev/index.js
|
|
2
|
-
|
|
3
|
-
'use strict'
|
|
4
|
-
|
|
5
|
-
var BuiltinModule = require('module')
|
|
6
|
-
|
|
7
|
-
// Guard against poorly mocked module constructors
|
|
8
|
-
var Module = module.constructor.length > 1 ? module.constructor : BuiltinModule
|
|
9
|
-
|
|
10
|
-
var nodePath = require('path')
|
|
11
|
-
|
|
12
|
-
var modulePaths = []
|
|
13
|
-
var moduleAliases = {}
|
|
14
|
-
var moduleAliasNames = []
|
|
15
|
-
|
|
16
|
-
var oldNodeModulePaths = Module._nodeModulePaths
|
|
17
|
-
Module._nodeModulePaths = function (from) {
|
|
18
|
-
var paths = oldNodeModulePaths.call(this, from)
|
|
19
|
-
|
|
20
|
-
// Only include the module path for top-level modules
|
|
21
|
-
// that were not installed:
|
|
22
|
-
if (from.indexOf('node_modules') === -1) {
|
|
23
|
-
paths = modulePaths.concat(paths)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return paths
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
var oldResolveFilename = Module._resolveFilename
|
|
30
|
-
Module._resolveFilename = function (request, parentModule, isMain, options) {
|
|
31
|
-
for (var i = moduleAliasNames.length; i-- > 0; ) {
|
|
32
|
-
var alias = moduleAliasNames[i]
|
|
33
|
-
if (isPathMatchesAlias(request, alias)) {
|
|
34
|
-
var aliasTarget = moduleAliases[alias]
|
|
35
|
-
// Custom function handler
|
|
36
|
-
if (typeof moduleAliases[alias] === 'function') {
|
|
37
|
-
var fromPath = parentModule.filename
|
|
38
|
-
aliasTarget = moduleAliases[alias](fromPath, request, alias)
|
|
39
|
-
if (!aliasTarget || typeof aliasTarget !== 'string') {
|
|
40
|
-
throw new Error('[module-alias] Expecting custom handler function to return path.')
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
request = nodePath.join(aliasTarget, request.substr(alias.length))
|
|
44
|
-
// Only use the first match
|
|
45
|
-
break
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return oldResolveFilename.call(this, request, parentModule, isMain, options)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function isPathMatchesAlias(path, alias) {
|
|
53
|
-
// Matching /^alias(\/|$)/
|
|
54
|
-
if (path.indexOf(alias) === 0) {
|
|
55
|
-
if (path.length === alias.length) return true
|
|
56
|
-
if (path[alias.length] === '/') return true
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return false
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function addPathHelper(path, targetArray) {
|
|
63
|
-
path = nodePath.normalize(path)
|
|
64
|
-
if (targetArray && targetArray.indexOf(path) === -1) {
|
|
65
|
-
targetArray.unshift(path)
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function removePathHelper(path, targetArray) {
|
|
70
|
-
if (targetArray) {
|
|
71
|
-
var index = targetArray.indexOf(path)
|
|
72
|
-
if (index !== -1) {
|
|
73
|
-
targetArray.splice(index, 1)
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function addPath(path) {
|
|
79
|
-
var parent
|
|
80
|
-
path = nodePath.normalize(path)
|
|
81
|
-
|
|
82
|
-
if (modulePaths.indexOf(path) === -1) {
|
|
83
|
-
modulePaths.push(path)
|
|
84
|
-
// Enable the search path for the current top-level module
|
|
85
|
-
var mainModule = getMainModule()
|
|
86
|
-
if (mainModule) {
|
|
87
|
-
addPathHelper(path, mainModule.paths)
|
|
88
|
-
}
|
|
89
|
-
parent = module.parent
|
|
90
|
-
|
|
91
|
-
// Also modify the paths of the module that was used to load the
|
|
92
|
-
// app-module-paths module and all of it's parents
|
|
93
|
-
while (parent && parent !== mainModule) {
|
|
94
|
-
addPathHelper(path, parent.paths)
|
|
95
|
-
parent = parent.parent
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function addAliases(aliases) {
|
|
101
|
-
for (var alias in aliases) {
|
|
102
|
-
addAlias(alias, aliases[alias])
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function addAlias(alias, target) {
|
|
107
|
-
moduleAliases[alias] = target
|
|
108
|
-
// Cost of sorting is lower here than during resolution
|
|
109
|
-
moduleAliasNames = Object.keys(moduleAliases)
|
|
110
|
-
moduleAliasNames.sort()
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Reset any changes maded (resets all registered aliases
|
|
115
|
-
* and custom module directories)
|
|
116
|
-
* The function is undocumented and for testing purposes only
|
|
117
|
-
*/
|
|
118
|
-
function reset() {
|
|
119
|
-
var mainModule = getMainModule()
|
|
120
|
-
|
|
121
|
-
// Reset all changes in paths caused by addPath function
|
|
122
|
-
modulePaths.forEach(function (path) {
|
|
123
|
-
if (mainModule) {
|
|
124
|
-
removePathHelper(path, mainModule.paths)
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// Delete from require.cache if the module has been required before.
|
|
128
|
-
// This is required for node >= 11
|
|
129
|
-
Object.getOwnPropertyNames(require.cache).forEach(function (name) {
|
|
130
|
-
if (name.indexOf(path) !== -1) {
|
|
131
|
-
delete require.cache[name]
|
|
132
|
-
}
|
|
133
|
-
})
|
|
134
|
-
|
|
135
|
-
var parent = module.parent
|
|
136
|
-
while (parent && parent !== mainModule) {
|
|
137
|
-
removePathHelper(path, parent.paths)
|
|
138
|
-
parent = parent.parent
|
|
139
|
-
}
|
|
140
|
-
})
|
|
141
|
-
|
|
142
|
-
modulePaths = []
|
|
143
|
-
moduleAliases = {}
|
|
144
|
-
moduleAliasNames = []
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Import aliases from package.json
|
|
149
|
-
* @param {object} options
|
|
150
|
-
*/
|
|
151
|
-
function init(options) {
|
|
152
|
-
if (typeof options === 'string') {
|
|
153
|
-
options = {base: options}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
options = options || {}
|
|
157
|
-
|
|
158
|
-
var candidatePackagePaths
|
|
159
|
-
if (options.base) {
|
|
160
|
-
candidatePackagePaths = [nodePath.resolve(options.base.replace(/\/package\.json$/, ''))]
|
|
161
|
-
} else {
|
|
162
|
-
// There is probably 99% chance that the project root directory in located
|
|
163
|
-
// above the node_modules directory,
|
|
164
|
-
// Or that package.json is in the node process' current working directory (when
|
|
165
|
-
// running a package manager script, e.g. `yarn start` / `npm run start`)
|
|
166
|
-
candidatePackagePaths = [nodePath.join(__dirname, '../..'), process.cwd()]
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
var npmPackage
|
|
170
|
-
var base
|
|
171
|
-
for (var i in candidatePackagePaths) {
|
|
172
|
-
try {
|
|
173
|
-
base = candidatePackagePaths[i]
|
|
174
|
-
|
|
175
|
-
npmPackage = require(nodePath.join(base, 'package.json'))
|
|
176
|
-
break
|
|
177
|
-
} catch (e) {
|
|
178
|
-
// noop
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
if (typeof npmPackage !== 'object') {
|
|
183
|
-
var pathString = candidatePackagePaths.join(',\n')
|
|
184
|
-
throw new Error('Unable to find package.json in any of:\n[' + pathString + ']')
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
//
|
|
188
|
-
// Import aliases
|
|
189
|
-
//
|
|
190
|
-
|
|
191
|
-
var aliases = npmPackage._moduleAliases || {}
|
|
192
|
-
|
|
193
|
-
for (var alias in aliases) {
|
|
194
|
-
if (aliases[alias][0] !== '/') {
|
|
195
|
-
aliases[alias] = nodePath.join(base, aliases[alias])
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
addAliases(aliases)
|
|
200
|
-
|
|
201
|
-
//
|
|
202
|
-
// Register custom module directories (like node_modules)
|
|
203
|
-
//
|
|
204
|
-
|
|
205
|
-
if (npmPackage._moduleDirectories instanceof Array) {
|
|
206
|
-
npmPackage._moduleDirectories.forEach(function (dir) {
|
|
207
|
-
if (dir === 'node_modules') return
|
|
208
|
-
|
|
209
|
-
var modulePath = nodePath.join(base, dir)
|
|
210
|
-
addPath(modulePath)
|
|
211
|
-
})
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
function getMainModule() {
|
|
216
|
-
return require.main._simulateRepl ? undefined : require.main
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
module.exports = init
|
|
220
|
-
module.exports.addPath = addPath
|
|
221
|
-
module.exports.addAlias = addAlias
|
|
222
|
-
module.exports.addAliases = addAliases
|
|
223
|
-
module.exports.isPathMatchesAlias = isPathMatchesAlias
|
|
224
|
-
module.exports.reset = reset
|
package/tsconfig.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"strict": false,
|
|
4
|
-
"outDir": "./lib",
|
|
5
|
-
"rootDir": "./src",
|
|
6
|
-
"module": "commonjs",
|
|
7
|
-
"target": "es2020",
|
|
8
|
-
"moduleResolution": "node",
|
|
9
|
-
"lib": ["es2020"],
|
|
10
|
-
|
|
11
|
-
"esModuleInterop": true,
|
|
12
|
-
"skipLibCheck": true,
|
|
13
|
-
"forceConsistentCasingInFileNames": true
|
|
14
|
-
}
|
|
15
|
-
}
|