@sprucelabs/resolve-path-aliases 1.1.190 → 1.1.192
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/build/index.js +3 -5
- package/build/posixPath.js +10 -0
- package/package.json +96 -95
package/build/index.js
CHANGED
|
@@ -9,6 +9,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
9
9
|
const chalk_1 = __importDefault(require("chalk"));
|
|
10
10
|
const globby_1 = __importDefault(require("globby"));
|
|
11
11
|
const tsconfig_paths_1 = require("tsconfig-paths");
|
|
12
|
+
const posixPath_1 = __importDefault(require("./posixPath"));
|
|
12
13
|
const logStub = {
|
|
13
14
|
info: () => { },
|
|
14
15
|
warning: () => { },
|
|
@@ -35,10 +36,7 @@ function resolvePathAliases(destination, options = {}, globUtil = globby_1.defau
|
|
|
35
36
|
const log = isVerbose ? logLive : logStub;
|
|
36
37
|
let totalMappedPaths = 0;
|
|
37
38
|
let totalFilesWithMappedPaths = 0;
|
|
38
|
-
const files = globUtil.sync(patterns.map((pattern) => path_1.default.posix
|
|
39
|
-
.join(destination, '/', pattern)
|
|
40
|
-
.split(path_1.default.sep)
|
|
41
|
-
.join(path_1.default.posix.sep)), {
|
|
39
|
+
const files = globUtil.sync(patterns.map((pattern) => (0, posixPath_1.default)(path_1.default.posix.join(destination, '/', pattern))), {
|
|
42
40
|
dot: true,
|
|
43
41
|
});
|
|
44
42
|
log.info(`Checking ${files.length} files for path aliases...`);
|
|
@@ -63,7 +61,7 @@ function resolvePathAliases(destination, options = {}, globUtil = globby_1.defau
|
|
|
63
61
|
const relative = absoluteOrRelative === 'relative'
|
|
64
62
|
? './' + path_1.default.relative(path_1.default.dirname(file), resolved)
|
|
65
63
|
: resolved;
|
|
66
|
-
return `${requireOrImport}"${relative}"
|
|
64
|
+
return (0, posixPath_1.default)(`${requireOrImport}"${relative}"`);
|
|
67
65
|
});
|
|
68
66
|
if (found) {
|
|
69
67
|
totalFilesWithMappedPaths++;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const path_1 = __importDefault(require("path"));
|
|
7
|
+
function posixPath(path) {
|
|
8
|
+
return path.split(path_1.default.sep).join(path_1.default.posix.sep);
|
|
9
|
+
}
|
|
10
|
+
exports.default = posixPath;
|
package/package.json
CHANGED
|
@@ -1,97 +1,98 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
2
|
+
"name": "@sprucelabs/resolve-path-aliases",
|
|
3
|
+
"version": "1.1.192",
|
|
4
|
+
"description": "Script that resolves paths from your tsconfig",
|
|
5
|
+
"main": "build/index.js",
|
|
6
|
+
"repository": "git@github.com:sprucelabsai/resolve-path-aliases.git",
|
|
7
|
+
"author": "Spruce Labs",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"skill": {
|
|
10
|
+
"namespace": "resolve-path-aliases",
|
|
11
|
+
"upgradeIgnoreList": [
|
|
12
|
+
"chalk",
|
|
13
|
+
"globby",
|
|
14
|
+
"@sprucelabs/resolve-path-aliases",
|
|
15
|
+
"@types/node"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"bin": {
|
|
19
|
+
"resolve-path-aliases": "./build/resolve-path-aliases.js"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"build/index.js",
|
|
23
|
+
"build/resolve-path-aliases.js",
|
|
24
|
+
"build/posixPath.js"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build.ci": "yarn build.tsc && yarn copy-for-tests && yarn lint",
|
|
28
|
+
"build.copy-files": "true",
|
|
29
|
+
"build.dev": "npm run clean && npm run build.tsc --sourceMap && yarn copy-for-tests",
|
|
30
|
+
"build.dist": "npm run clean && npm run build.tsc && yarn copy-for-tests",
|
|
31
|
+
"build.resolve-paths": "true",
|
|
32
|
+
"build.tsc": "tsc",
|
|
33
|
+
"clean": "yarn clean.build",
|
|
34
|
+
"clean.all": "yarn clean.dependencies && yarn clean.build",
|
|
35
|
+
"clean.build": "rm -rf build/",
|
|
36
|
+
"clean.dependencies": "rm -rf node_modules/ package-lock.json yarn.lock",
|
|
37
|
+
"copy-for-tests": "yarn copy-test-files",
|
|
38
|
+
"copy-test-empty-skill": "rm -rf ./build/__tests__/empty_skill && mkdirp ./build/__tests__/empty_skill",
|
|
39
|
+
"copy-test-files": "rm -rf ./build/__tests__/files && mkdirp ./build/__tests__/files && cp -r ./src/__tests__/files/* ./build/__tests__/files",
|
|
40
|
+
"lint": "eslint --cache '**/*.ts'",
|
|
41
|
+
"lint.tsc": "tsc -p . --noEmit",
|
|
42
|
+
"fix.lint": "eslint --fix --cache '**/*.ts'",
|
|
43
|
+
"lint.watch": "chokidar 'src/**/*' '../spruce-templates/src/**' -c 'yarn lint.tsc'",
|
|
44
|
+
"post.watch.build": "yarn copy-for-tests",
|
|
45
|
+
"rebuild": "yarn clean.all && yarn && yarn build.dev",
|
|
46
|
+
"release": "semantic-release",
|
|
47
|
+
"resolve-paths.lint": "yarn build.resolve-paths ; yarn lint",
|
|
48
|
+
"test": "jest",
|
|
49
|
+
"test.watch": "jest --watch",
|
|
50
|
+
"update.dependencies": "yarn clean.dependencies && yarn",
|
|
51
|
+
"upgrade.packages": "yarn-upgrade-all && rm -f yarn.lock ; yarn ; yarn fix.lint | true",
|
|
52
|
+
"upgrade.packages.all": "yarn install && yarn upgrade.packages",
|
|
53
|
+
"upgrade.packages.test": "yarn upgrade.packages.all && yarn lint && yarn build.dev && yarn test",
|
|
54
|
+
"watch.build.dev": "tsc-watch --sourceMap --onCompilationComplete 'yarn post.watch.build'",
|
|
55
|
+
"watch.lint": "concurrently 'yarn lint' \"chokidar 'src/**/*' -c 'yarn lint.tsc'\"",
|
|
56
|
+
"watch.rebuild": "yarn clean.all && yarn && yarn watch.build.dev",
|
|
57
|
+
"watch.tsc": "tsc -w"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"chalk": "^4.1.2",
|
|
61
|
+
"globby": "^11.0.4",
|
|
62
|
+
"tsconfig-paths": "^4.1.2",
|
|
63
|
+
"yargs": "^17.7.1"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@sprucelabs/semantic-release": "^4.0.8",
|
|
67
|
+
"@sprucelabs/test": "^7.7.424",
|
|
68
|
+
"@types/fs-extra": "^11.0.1",
|
|
69
|
+
"chokidar-cli": "^3.0.0",
|
|
70
|
+
"concurrently": "^7.6.0",
|
|
71
|
+
"eslint": "^8.35.0",
|
|
72
|
+
"eslint-config-spruce": "^10.12.0",
|
|
73
|
+
"fs-extra": "^11.1.0",
|
|
74
|
+
"jest": "^29.5.0",
|
|
75
|
+
"prettier": "^2.8.4",
|
|
76
|
+
"rimraf": "^4.4.0",
|
|
77
|
+
"ts-node": "^10.9.1",
|
|
78
|
+
"tsc-watch": "^6.0.0",
|
|
79
|
+
"typescript": "^4.9.5"
|
|
80
|
+
},
|
|
81
|
+
"jest": {
|
|
82
|
+
"maxWorkers": 4,
|
|
83
|
+
"testTimeout": 120000,
|
|
84
|
+
"testEnvironment": "node",
|
|
85
|
+
"testPathIgnorePatterns": [
|
|
86
|
+
"<rootDir>/tmp/",
|
|
87
|
+
"<rootDir>/src/",
|
|
88
|
+
"<rootDir>/node_modules/",
|
|
89
|
+
"<rootDir>/build/__tests__/testDirsAndFiles/"
|
|
90
|
+
],
|
|
91
|
+
"testMatch": [
|
|
92
|
+
"**/__tests__/**/*.test.js?(x)"
|
|
93
|
+
],
|
|
94
|
+
"moduleNameMapper": {
|
|
95
|
+
"^#spruce/(.*)$": "<rootDir>/build/.spruce/$1"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
97
98
|
}
|