Skip to content

Commit

Permalink
chore(release): 0.7.0 [skip ci]
Browse files Browse the repository at this point in the history
# [0.7.0](0.6.8...0.7.0) (2022-12-03)

### Features

* setup esm and cjs builds. ([fc3f381](fc3f381))
  • Loading branch information
semantic-release-bot committed Dec 3, 2022
1 parent e6d9899 commit 6848e82
Show file tree
Hide file tree
Showing 10 changed files with 240 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [0.7.0](https://github.com/dropecho/lib_example/compare/0.6.8...0.7.0) (2022-12-03)


### Features

* setup esm and cjs builds. ([fc3f381](https://github.com/dropecho/lib_example/commit/fc3f381a3e7f59f4f8fab9f4efb6a22585856a7f))

## [0.6.8](https://github.com/dropecho/lib_example/compare/0.6.7...0.6.8) (2022-12-03)


Expand Down
34 changes: 34 additions & 0 deletions dist/js/cjs/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
(function ($hx_exports, $global) { "use strict";
$hx_exports["dropecho"] = $hx_exports["dropecho"] || {};
$hx_exports["dropecho"]["lib_example"] = $hx_exports["dropecho"]["lib_example"] || {};
class dropecho_lib_$example_LibExample {
static test() {
console.log("src/dropecho/lib_example/LibExample.hx:6:","hello world.");
return 2;
}
}
$hx_exports["dropecho"]["lib_example"]["LibExample"] = dropecho_lib_$example_LibExample;
class dropecho_lib_$example_OtherExample {
constructor() {
this.x = 0;
}
banana(b) {
return b + 5 + this.x;
}
}
$hx_exports["dropecho"]["lib_example"]["OtherExample"] = dropecho_lib_$example_OtherExample;
class haxe_iterators_ArrayIterator {
constructor(array) {
this.current = 0;
this.array = array;
}
hasNext() {
return this.current < this.array.length;
}
next() {
return this.array[this.current++];
}
}
{
}
})(typeof exports != "undefined" ? exports : typeof window != "undefined" ? window : typeof self != "undefined" ? self : this, {});
18 changes: 18 additions & 0 deletions dist/js/esm/Std.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import {Register} from "./genes/Register.js"

/**
The Std class provides standard methods for manipulating basic types.
*/
export const Std = Register.global("$hxClasses")["Std"] =
class Std {
static get __name__() {
return "Std"
}
get __class__() {
return Std
}
}


;{
}
16 changes: 16 additions & 0 deletions dist/js/esm/dropecho/lib_example/LibExample.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {Register} from "../../genes/Register.js"

export const LibExample = Register.global("$hxClasses")["dropecho.lib_example.LibExample"] =
class LibExample {
static test() {
console.log("src/dropecho/lib_example/LibExample.hx:6:","hello world.");
return 2;
}
static get __name__() {
return "dropecho.lib_example.LibExample"
}
get __class__() {
return LibExample
}
}

18 changes: 18 additions & 0 deletions dist/js/esm/dropecho/lib_example/OtherExample.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import {Register} from "../../genes/Register.js"

export const OtherExample = Register.global("$hxClasses")["dropecho.lib_example.OtherExample"] =
class OtherExample extends Register.inherits() {
new() {
this.x = 0;
}
banana(b) {
return b + 5 + this.x;
}
static get __name__() {
return "dropecho.lib_example.OtherExample"
}
get __class__() {
return OtherExample
}
}

107 changes: 107 additions & 0 deletions dist/js/esm/genes/Register.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@

export class Register {
static global(name) {
if (Register.globals[name]) {
return Register.globals[name];
} else {
return Register.globals[name] = {};
};
}
static createStatic(obj, name, get) {
var value = null;
Object.defineProperty(obj, name, {"enumerable": true, "get": function () {
if (get != null) {
value = get();
get = null;
};
return value;
}, "set": function (v) {
if (get != null) {
value = get();
get = null;
};
value = v;
}});
}
static iter(a) {
if (!Array.isArray(a)) {
return a.iterator();
} else {
return {"cur": 0, "arr": a, "hasNext": function () {
return this.cur < this.arr.length;
}, "next": function () {
return this.arr[this.cur++];
}};
};
}
static extend(superClass) {

function res() {
this.new.apply(this, arguments)
}
Object.setPrototypeOf(res.prototype, superClass.prototype)
return res
;
}
static inherits(resolve, defer) {
if (defer == null) {
defer = false;
};

function res() {
if (defer && resolve && res.__init__) res.__init__()
this.new.apply(this, arguments)
}
if (!defer) {
if (resolve && resolve.__init__) {
defer = true
res.__init__ = () => {
resolve.__init__()
Object.setPrototypeOf(res.prototype, resolve.prototype)
res.__init__ = undefined
}
} else if (resolve) {
Object.setPrototypeOf(res.prototype, resolve.prototype)
}
} else {
res.__init__ = () => {
const superClass = resolve()
if (superClass.__init__) superClass.__init__()
Object.setPrototypeOf(res.prototype, superClass.prototype)
res.__init__ = undefined
}
}
return res
;
}
static bind(o, m) {
if (m == null) {
return null;
};
if (m.__id__ == null) {
m.__id__ = Register.fid++;
};
var f = null;
if (o.hx__closures__ == null) {
o.hx__closures__ = {};
} else {
f = o.hx__closures__[m.__id__];
};
if (f == null) {
f = m.bind(o);
o.hx__closures__[m.__id__] = f;
};
return f;
}
static get __name__() {
return "genes.Register"
}
get __class__() {
return Register
}
}


Register.$global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : undefined
Register.globals = {}
Register.fid = 0
33 changes: 33 additions & 0 deletions dist/js/esm/haxe/iterators/ArrayIterator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {Register} from "../../genes/Register.js"

/**
This iterator is used only when `Array<T>` is passed to `Iterable<T>`
*/
export const ArrayIterator = Register.global("$hxClasses")["haxe.iterators.ArrayIterator"] =
class ArrayIterator extends Register.inherits() {
new(array) {
this.current = 0;
this.array = array;
}

/**
See `Iterator.hasNext`
*/
hasNext() {
return this.current < this.array.length;
}

/**
See `Iterator.next`
*/
next() {
return this.array[this.current++];
}
static get __name__() {
return "haxe.iterators.ArrayIterator"
}
get __class__() {
return ArrayIterator
}
}

4 changes: 4 additions & 0 deletions dist/js/esm/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import {Register} from "./genes/Register.js"

export {OtherExample} from "./dropecho/lib_example/OtherExample.js"
export {LibExample} from "./dropecho/lib_example/LibExample.js"
4 changes: 2 additions & 2 deletions haxelib.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"contributors": [
"vantreeseba"
],
"version": "0.6.8",
"releasenote": "Release version 0.6.8. See CHANGELOG.md for details.",
"version": "0.7.0",
"releasenote": "Release version 0.7.0. See CHANGELOG.md for details.",
"tags": [
"example"
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dropecho/lib_example",
"version": "0.6.8",
"version": "0.7.0",
"description": "An example haxelib that outputs to multiple targets.",
"author": "vantreeseba <[email protected]>",
"repository": "github:dropecho/lib_example",
Expand Down

0 comments on commit 6848e82

Please sign in to comment.