Skip to content

Releases: kyle-n/TypeSwift

Includes TypeScript types

21 Nov 19:05
Compare
Choose a tag to compare

Previous versions of the package did not bundle .d.ts files. If you were using Node, React or a similar compiled environment, you might have run into this problem:

import 'typeswift';

const nums = [1, 2];
console.log(nums.first) // .first is underlined with a red squiggle in the IDE

That issue should be fixed. Apologies for the oversight.

Improvements to build and test processes

05 Jan 18:39
Compare
Choose a tag to compare
  • Uses shx to run setup scripts so the package can be developed on non-Unix-like OSes such as Windows (Note: preview-npm-files is not Windows-compatible because shx does not support tar)
  • Moves unit test files and jest config to separate tests file
  • Adds ts-jest as a devDependency to run unit tests. Simplifies previous process of transpiling to a temporary directory.
  • Removes duplicate or unused scripts in package.json
  • Renames NPM deploy GitHub action to cd.yml
  • CI runs only on PRs into main
  • CD runs on merge/push into main

Restores static methods

01 Dec 22:32
Compare
Choose a tag to compare

Figured out how to make TypeScript accept static extensions to base types. This release incldues:

  • Boolean.random()
  • Number.zero

Faster builds

23 Nov 19:47
Compare
Choose a tag to compare

In 1.1.0, TypeSwift actually transpiled the TypeScript source three times - once for Node, and twice for the browser bundles. In 1.1.1, the TS source is transpiled once, then that JS is bundled together by webpack.

This release adds no new user-facing features, but will make developing new ones easier by reducing build times by ~60%.

Fixes faulty naming and removes untyped static vars

16 Nov 17:40
Compare
Choose a tag to compare

Removed

  • myNumber.zero - should be a static variable, Number.zero
  • Boolean.random() - It is extremely difficult to add static variables to TypeScript interfaces. Removed until I come up with a better solution.

Fixed

  • Object.merging() was declared as Object.merged() in the TS interface. The interface property has been renamed to merging to match Swift.

Development

  • Unit tests all variables and functions
  • New build script that automatically runs unit tests, updates the README and sets an NPM version

Removes duplicate browser bundle

12 Nov 05:00
Compare
Choose a tag to compare

For some reason, webpack was generating two JS bundles for use in web browsers. This version fixes the build scripts so the only files in _bundles are:

  • typeswift.js
  • typeswift.js.map
  • typeswift.min.js

This release was also a successful test of a GitHub Action to automatically publish any new versions on NPM.