Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Fixing fable-compiler-js when run from NPM #3795

Merged
merged 3 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/fable-compiler-js/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Changed

* Use `@fable-org/fable-metadata` package instead of `fable-metadata` (by @MangelMaxime)
* Use `@fable-org/fable-standalone` package instead of `fable-standalone` (by @MangelMaxime)
* Make `GetDirectoryName` return `"."` instead of `""` if the path doesn't contain any directory (by @MangelMaxime)

### Fixed

* Fix initialization of `fable-standalone` with the new package format (by @MangelMaxime)

## 1.1.0 - 2024-02-20

* Add `NPM_PACKAGE_FABLE_COMPILER_JAVASCRIPT` compiler directive (by @MangelMaxime)
Expand Down
44 changes: 22 additions & 22 deletions src/fable-compiler-js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/fable-compiler-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
},
"homepage": "https://github.com/fable-compiler/Fable#readme",
"dependencies": {
"fable-metadata": "^2.0.0",
"fable-standalone": "^3.0.0"
"@fable-org/fable-metadata": "^1.0.0",
"@fable-org/fable-standalone": "^1.4.0"
},
"devDependencies": {
"esbuild": "^0.19.5",
Expand Down
2 changes: 1 addition & 1 deletion src/fable-compiler-js/src/Platform.fs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,6 @@ module Path =
let i = normPath.LastIndexOf('/')

if i < 0 then
""
"."
else
normPath.Substring(0, i)
12 changes: 10 additions & 2 deletions src/fable-compiler-js/src/app.fs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,16 @@ let getMetadataDir () : string =
let getFableLibDir () : string = importMember "./util.js"
let getVersion () : string = importMember "./util.js"

let initFable () : Fable.Standalone.IFableManager =
import "init" "@fable-org/fable-standalone"
type IFableInit =
abstract member init: unit -> Fable.Standalone.IFableManager

// Make __FABLE_STANDALONE__ available in the global scope
importSideEffects "@fable-org/fable-standalone"

[<Global("__FABLE_STANDALONE__")>]
let FableInit: IFableInit = jsNative

let initFable () : Fable.Standalone.IFableManager = FableInit.init ()
#endif

let references = Fable.Metadata.coreAssemblies
Expand Down
4 changes: 4 additions & 0 deletions src/fable-metadata/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Fixed

* Make `dirname-filename-esm` a `dependency` instead of a `devDependency`

## 1.0.0 - 2024-02-12

* Release stable version
Expand Down
16 changes: 7 additions & 9 deletions src/fable-metadata/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/fable-metadata/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"author": ".NET Foundation and Contributors",
"license": "MIT",
"devDependencies": {
"dependencies": {
"dirname-filename-esm": "^1.1.1"
}
}
4 changes: 4 additions & 0 deletions src/fable-standalone/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Fixed

* Make `dirname-filename-esm` a `dependency` instead of a `devDependency`

## 1.5.0 - 2024-03-20

### Changed
Expand Down
Loading