fable-compiler-js
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -11,8 +11,12 @@ "use strict"; | ||
exports.parseArguments = parseArguments; | ||
exports.CmdLineOptions = exports.metadataPath = exports.references = void 0; | ||
exports.CmdLineOptions = exports.metadataPath = exports.references = exports.getFableLibDir = exports.getMetadataDir = exports.initFable = void 0; | ||
var _fableStandalone = require("fable-standalone"); | ||
var _fableMetadata = _interopRequireDefault(require("fable-metadata")); | ||
var _util = require("./util"); | ||
var _Metadata = require("./src/Metadata"); | ||
var _Platform = require("./Platform"); | ||
var _String = require("./fable-library.2.1.10/String"); | ||
@@ -28,2 +32,4 @@ | ||
var _Platform = require("./Platform"); | ||
var _Seq = require("./fable-library.2.1.10/Seq"); | ||
@@ -37,5 +43,13 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const initFable = _fableStandalone.init; | ||
exports.initFable = initFable; | ||
const getMetadataDir = _fableMetadata.default; | ||
exports.getMetadataDir = getMetadataDir; | ||
const getFableLibDir = _util.getFableLibDir; | ||
exports.getFableLibDir = getFableLibDir; | ||
const references = _Metadata.references_core; | ||
exports.references = references; | ||
const metadataPath = (0, _String.trimEnd)((0, _Platform.getMetadataDir)(), "\\", "/") + "/"; | ||
const metadataPath = (0, _String.trimEnd)(getMetadataDir(), "\\", "/") + "/"; | ||
exports.metadataPath = metadataPath; | ||
@@ -95,6 +109,5 @@ | ||
const fable = (0, _Platform.initFable)(); | ||
const otherOptions$$1 = (0, _Array.append)(patternInput$$1[4], (0, _Array.ofSeq)((0, _Seq.delay)(function () { | ||
return options.optimize ? (0, _Seq.singleton)("--optimize+") : (0, _Seq.empty)(); | ||
}), Array), Array); | ||
const fable = initFable(); | ||
const optimizeFlag = "--optimize" + (options.optimize ? "+" : "-"); | ||
const otherOptions$$1 = (0, _Array.append)([optimizeFlag], patternInput$$1[4], Array); | ||
@@ -138,3 +151,3 @@ const createChecker = function createChecker() { | ||
const projDir = (0, _Platform.Path$$$GetDirectoryName)((0, _Platform.normalizeFullPath)(projectPath)); | ||
const libDir = (0, _Platform.normalizeFullPath)((0, _Platform.getFableLibDir)()); | ||
const libDir = (0, _Platform.normalizeFullPath)(getFableLibDir()); | ||
@@ -147,3 +160,3 @@ for (let idx = 0; idx <= fileNames$$2.length - 1; idx++) { | ||
const outPath = trimPath((0, _Platform.getRelativePath)(projDir, fileName$$1)); | ||
(0, _Platform.transformAndSaveBabelAst)(patternInput$$4[1].BabelAst, outPath, projDir, outDir, libDir, options.commonjs); | ||
(0, _Platform.transformAndSaveBabelAst)()([patternInput$$4[1].BabelAst, outPath, projDir, outDir, libDir, options.commonjs]); | ||
} | ||
@@ -150,0 +163,0 @@ } |
@@ -10,2 +10,7 @@ "use strict"; | ||
exports.measureTime = measureTime; | ||
exports.getVersion = getVersion; | ||
exports.ensureDirExists = ensureDirExists; | ||
exports.copyFolder = copyFolder; | ||
exports.transformAndSaveBabelAst = transformAndSaveBabelAst; | ||
exports.runCmdAndExitIfFails = runCmdAndExitIfFails; | ||
exports.normalizeFullPath = normalizeFullPath; | ||
@@ -17,10 +22,4 @@ exports.getRelativePath = getRelativePath; | ||
exports.Path$$$GetDirectoryName = Path$$$GetDirectoryName; | ||
exports.runCmdAndExitIfFails = exports.transformAndSaveBabelAst = exports.copyFolder = exports.ensureDirExists = exports.getVersion = exports.getFableLibDir = exports.getMetadataDir = exports.initFable = void 0; | ||
exports.JS$$$Util = exports.JS$$$Path = exports.JS$$$Process = exports.JS$$$FileSystem = void 0; | ||
var _fableStandalone = require("fable-standalone"); | ||
var _fableMetadata = _interopRequireDefault(require("fable-metadata")); | ||
var _util = require("./util"); | ||
var fs = _interopRequireWildcard(require("fs")); | ||
@@ -32,2 +31,4 @@ | ||
var util$002Ejs = _interopRequireWildcard(require("./util")); | ||
var _String = require("./fable-library.2.1.10/String"); | ||
@@ -39,50 +40,58 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const JS$$$FileSystem = fs; | ||
exports.JS$$$FileSystem = JS$$$FileSystem; | ||
const JS$$$Process = process; | ||
exports.JS$$$Process = JS$$$Process; | ||
const JS$$$Path = path$$5; | ||
exports.JS$$$Path = JS$$$Path; | ||
const JS$$$Util = util$002Ejs; | ||
exports.JS$$$Util = JS$$$Util; | ||
const initFable = _fableStandalone.init; | ||
exports.initFable = initFable; | ||
const getMetadataDir = _fableMetadata.default; | ||
exports.getMetadataDir = getMetadataDir; | ||
const getFableLibDir = _util.getFableLibDir; | ||
exports.getFableLibDir = getFableLibDir; | ||
const FileSystem = fs; | ||
const Process = process; | ||
const Path = path$$5; | ||
function readAllBytes(filePath) { | ||
return FileSystem.readFileSync(filePath); | ||
return JS$$$FileSystem.readFileSync(filePath); | ||
} | ||
function readAllText(filePath$$1) { | ||
return (0, _String.trimStart)(FileSystem.readFileSync(filePath$$1, "utf8"), ""); | ||
return (0, _String.trimStart)(JS$$$FileSystem.readFileSync(filePath$$1, "utf8"), ""); | ||
} | ||
function writeAllText(filePath$$2, text) { | ||
FileSystem.writeFileSync(filePath$$2, text); | ||
JS$$$FileSystem.writeFileSync(filePath$$2, text); | ||
} | ||
function measureTime(f, x) { | ||
const startTime = Process.hrtime(); | ||
const startTime = JS$$$Process.hrtime(); | ||
const res = f(x); | ||
const elapsed = Process.hrtime(startTime); | ||
const elapsed = JS$$$Process.hrtime(startTime); | ||
return [(0, _Long.fromNumber)(elapsed[0] * 1000 + elapsed[1] / 1000000, false), res]; | ||
} | ||
const getVersion = _util.getVersion; | ||
exports.getVersion = getVersion; | ||
const ensureDirExists = _util.ensureDirExists; | ||
exports.ensureDirExists = ensureDirExists; | ||
const copyFolder = _util.copyFolder; | ||
exports.copyFolder = copyFolder; | ||
const transformAndSaveBabelAst = _util.transformAndSaveBabelAst; | ||
exports.transformAndSaveBabelAst = transformAndSaveBabelAst; | ||
const runCmdAndExitIfFails = _util.runCmdAndExitIfFails; | ||
exports.runCmdAndExitIfFails = runCmdAndExitIfFails; | ||
function getVersion() { | ||
return JS$$$Util.getVersion(); | ||
} | ||
function ensureDirExists(arg00) { | ||
JS$$$Util.ensureDirExists(arg00); | ||
} | ||
function copyFolder(tupledArg) { | ||
JS$$$Util.copyFolder(tupledArg[0], tupledArg[1]); | ||
} | ||
function transformAndSaveBabelAst() { | ||
return function (tupledArg$$1) { | ||
JS$$$Util.transformAndSaveBabelAst(tupledArg$$1[0], tupledArg$$1[1], tupledArg$$1[2], tupledArg$$1[3], tupledArg$$1[4], tupledArg$$1[5]); | ||
}; | ||
} | ||
function runCmdAndExitIfFails(arg00$$3) { | ||
JS$$$Util.runCmdAndExitIfFails(arg00$$3); | ||
} | ||
function normalizeFullPath(path) { | ||
return (0, _String.replace)(Path.resolve(path), "\\", "/"); | ||
return (0, _String.replace)(JS$$$Path.resolve(path), "\\", "/"); | ||
} | ||
function getRelativePath(pathFrom, pathTo) { | ||
return (0, _String.replace)(Path.relative(pathFrom, pathTo), "\\", "/"); | ||
return (0, _String.replace)(JS$$$Path.relative(pathFrom, pathTo), "\\", "/"); | ||
} | ||
@@ -89,0 +98,0 @@ |
@@ -117,11 +117,11 @@ "use strict"; | ||
var $target$$11, path$$1; | ||
const activePatternResult663 = $007CRegex$007C_$007C("^#r\\s+\"(.*?)\"$", matchValue); | ||
const activePatternResult664 = $007CRegex$007C_$007C("^#r\\s+\"(.*?)\"$", matchValue); | ||
if (activePatternResult663 != null) { | ||
if (activePatternResult663.tail != null) { | ||
if (activePatternResult663.tail.tail != null) { | ||
if (activePatternResult663.tail.tail.tail == null) { | ||
if (path = activePatternResult663.tail.head, !(0, _String.endsWith)(path, "Fable.Core.dll")) { | ||
if (activePatternResult664 != null) { | ||
if (activePatternResult664.tail != null) { | ||
if (activePatternResult664.tail.tail != null) { | ||
if (activePatternResult664.tail.tail.tail == null) { | ||
if (path = activePatternResult664.tail.head, !(0, _String.endsWith)(path, "Fable.Core.dll")) { | ||
$target$$11 = 0; | ||
path$$1 = activePatternResult663.tail.head; | ||
path$$1 = activePatternResult664.tail.head; | ||
} else { | ||
@@ -152,10 +152,10 @@ $target$$11 = 1; | ||
var $target$$12, path$$2; | ||
const activePatternResult661 = $007CRegex$007C_$007C("^#load\\s+\"(.*?)\"$", matchValue); | ||
const activePatternResult662 = $007CRegex$007C_$007C("^#load\\s+\"(.*?)\"$", matchValue); | ||
if (activePatternResult661 != null) { | ||
if (activePatternResult661.tail != null) { | ||
if (activePatternResult661.tail.tail != null) { | ||
if (activePatternResult661.tail.tail.tail == null) { | ||
if (activePatternResult662 != null) { | ||
if (activePatternResult662.tail != null) { | ||
if (activePatternResult662.tail.tail != null) { | ||
if (activePatternResult662.tail.tail.tail == null) { | ||
$target$$12 = 0; | ||
path$$2 = activePatternResult661.tail.head; | ||
path$$2 = activePatternResult662.tail.head; | ||
} else { | ||
@@ -201,3 +201,3 @@ $target$$12 = 1; | ||
}, (0, _RegExp.matches)(projectText$$3, "<ProjectReference\\s+[^>]*Include\\s*=\\s*(\"[^\"]*|'[^']*)")), Array); | ||
const projectText$$4 = (0, _String.replace)(projectText$$3, "$(MSBuildProjectDirectory)", __dirname); | ||
const projectText$$4 = (0, _String.replace)(projectText$$3, "$(MSBuildProjectDirectory)", "."); | ||
const m$$9 = (0, _RegExp.match)(projectText$$4, "<FSharpSourcesRoot[^>]*>([^<]*)<\\/FSharpSourcesRoot[^>]*>"); | ||
@@ -204,0 +204,0 @@ const sourcesRoot = m$$9 != null ? (0, _String.replace)(m$$9[1] || "", "\\", "/") : ""; |
{ | ||
"name": "fable-compiler-js", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"main": "index.js", | ||
@@ -27,6 +27,6 @@ "bin": { | ||
"@babel/plugin-transform-modules-commonjs": "^7.2.0", | ||
"fable-babel-plugins": "^2.1.0", | ||
"fable-metadata": "^1.0.0", | ||
"fable-standalone": "^1.0.0" | ||
"fable-babel-plugins": "^2.2.0", | ||
"fable-metadata": "^1.0.1", | ||
"fable-standalone": "^1.0.3" | ||
} | ||
} |
@@ -0,1 +1,5 @@ | ||
### 1.0.3 | ||
* Update dependencies | ||
### 1.0.2 | ||
@@ -2,0 +6,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
362540
10381
Updatedfable-babel-plugins@^2.2.0
Updatedfable-metadata@^1.0.1
Updatedfable-standalone@^1.0.3