@sprucelabs/babel-plugin-schema
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -61,3 +61,3 @@ "use strict"; | ||
const sourceHashSpruce = this.resolvePath(cwd, 'node_modules', '@sprucelabs/schema', 'build', '.spruce'); | ||
const destinationHashSpruce = this.resolvePath(cwd, 'build', '.spruce'); | ||
const destinationHashSpruce = this.resolvePath(cwd, 'src', '.spruce'); | ||
await this.copyDir(sourceHashSpruce, destinationHashSpruce); | ||
@@ -74,2 +74,3 @@ // copy ts config | ||
test_1.assert.doesNotInclude(afterMapContents, '@sprucelabs/schema/build/.spruce/'); | ||
test_1.assert.doesInclude(afterMapContents, 'build/.spruce'); | ||
} | ||
@@ -76,0 +77,0 @@ static async copyDir(source, destination) { |
@@ -60,7 +60,11 @@ "use strict"; | ||
const fullTsConfig = JSON.parse(fs_1.default.readFileSync(config.configFileAbsolutePath).toString()); | ||
const { compilerOptions: { outDir }, } = fullTsConfig; | ||
const { compilerOptions: { baseUrl, outDir }, } = fullTsConfig; | ||
let outResolver; | ||
if (outDir) { | ||
const resolvedOutDir = path_1.default.join(path_1.default.dirname(config.configFileAbsolutePath), outDir); | ||
outResolver = tsconfig_paths_1.createMatchPath(resolvedOutDir, config.paths); | ||
const resolver = tsconfig_paths_1.createMatchPath(config.absoluteBaseUrl, config.paths); | ||
outResolver = (requested, readJson, fileExists, extensions) => { | ||
let resolved = resolver(requested, readJson, fileExists, extensions); | ||
resolved = resolved === null || resolved === void 0 ? void 0 : resolved.replace(`${path_1.default.sep}${baseUrl}${path_1.default.sep}`, `${path_1.default.sep}${outDir}${path_1.default.sep}`); | ||
return resolved; | ||
}; | ||
} | ||
@@ -67,0 +71,0 @@ return outResolver; |
@@ -0,1 +1,3 @@ | ||
## [1.1.1](https://github.com/sprucelabsai/babel-plugin-schema/compare/v1.1.0...v1.1.1) (2020-08-13) | ||
# [1.1.0](https://github.com/sprucelabsai/babel-plugin-schema/compare/v1.0.22...v1.1.0) (2020-08-13) | ||
@@ -2,0 +4,0 @@ |
{ | ||
"name": "@sprucelabs/babel-plugin-schema", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Builds @sprucelabs/schema and generates static paths to #spruce directories.", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -55,3 +55,3 @@ import { exec } from 'child_process' | ||
const destinationHashSpruce = this.resolvePath(cwd, 'build', '.spruce') | ||
const destinationHashSpruce = this.resolvePath(cwd, 'src', '.spruce') | ||
@@ -80,2 +80,3 @@ await this.copyDir(sourceHashSpruce, destinationHashSpruce) | ||
assert.doesNotInclude(afterMapContents, '@sprucelabs/schema/build/.spruce/') | ||
assert.doesInclude(afterMapContents, 'build/.spruce') | ||
} | ||
@@ -82,0 +83,0 @@ |
@@ -97,3 +97,3 @@ import fs from 'fs' | ||
const { | ||
compilerOptions: { outDir }, | ||
compilerOptions: { baseUrl, outDir }, | ||
} = fullTsConfig | ||
@@ -104,8 +104,17 @@ | ||
if (outDir) { | ||
const resolvedOutDir = pathUtil.join( | ||
pathUtil.dirname(config.configFileAbsolutePath), | ||
outDir | ||
) | ||
const resolver = createMatchPath(config.absoluteBaseUrl, config.paths) | ||
outResolver = ( | ||
requested: string, | ||
readJson?: any, | ||
fileExists?: any, | ||
extensions?: readonly string[] | ||
) => { | ||
let resolved = resolver(requested, readJson, fileExists, extensions) | ||
resolved = resolved?.replace( | ||
`${pathUtil.sep}${baseUrl}${pathUtil.sep}`, | ||
`${pathUtil.sep}${outDir}${pathUtil.sep}` | ||
) | ||
outResolver = createMatchPath(resolvedOutDir, config.paths) | ||
return resolved | ||
} | ||
} | ||
@@ -112,0 +121,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
39700
678