Skip to content

Commit 3b4f4fb

Browse files
authored
Merge pull request AssemblyScript#2 from AssemblyScript/master
Sync from origin
2 parents c48a230 + d62d845 commit 3b4f4fb

File tree

315 files changed

+258019
-322697
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

315 files changed

+258019
-322697
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
bin/* text eol=lf
22
dist/* binary
33
scripts/*.sh eol=lf
4+
lib/binaryen.js binary

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: node_js
22
notifications:
33
email: false
44
before_install: npm config set progress=false && npm i -g npm@latest --no-audit
5-
install: npm i --no-audit
5+
install: npm ci --no-audit
66
cache:
77
directories:
88
- node_modules

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Instructions are similar to those for bug reports. Please provide the following
4242

4343
Before submitting your pull request, please make sure that the following conditions are met:
4444

45-
* Your new code **adheres to the code style** through running `npm run lint`.
45+
* Your new code **adheres to the code style** through running `npm run check`.
4646
* Your new code **passes all existing and new tests** through running `npm run test:pr`.
4747
* Your PR **excludes distribution files** in `dist/**`.
4848
* You appended yourself to the **list of contributors** in the [NOTICE](./NOTICE) file.

NOTICE

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ under the licensing terms detailed in LICENSE:
88
* Igor Sbitnev <[email protected]>
99
* Norton Wang <[email protected]>
1010
* Alan Pierce <[email protected]>
11+
12+
* Linus Unnebäck <[email protected]>
1113

1214
Portions of this software are derived from third-party works licensed under
1315
the following terms:

README.md

+46-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
=================
33

44
[![Build Status](https://travis-ci.org/AssemblyScript/assemblyscript.svg?branch=master)](https://travis-ci.org/AssemblyScript/assemblyscript)
5+
[![Backers on Open Collective](https://opencollective.com/assemblyscript/tiers/backer/badge.svg)](#backers)
6+
[![Sponsors on Open Collective](https://opencollective.com/assemblyscript/tiers/sponsor/badge.svg)](#sponsors)
57

68
**AssemblyScript** compiles strictly typed [TypeScript](http://www.typescriptlang.org) (basically JavaScript with types) to [WebAssembly](http://webassembly.org) using [Binaryen](https://github.com/WebAssembly/binaryen). It generates lean and mean WebAssembly modules while being just an `npm install` away.
79

@@ -58,7 +60,7 @@ Examples
5860
* **[Conway's Game of Life](./examples/game-of-life)** [ [demo](https://rawgit.com/AssemblyScript/assemblyscript/master/examples/game-of-life/index.html) | [fiddle](https://webassembly.studio/?f=gvuw4enb3qk) ]<br />
5961
Continuously updates the cellular automaton and visualizes its state on a canvas.
6062

61-
* **[Mandelbrot Set](./examples/mandelbrot)** [ [demo](https://rawgit.com/AssemblyScript/assemblyscript/master/examples/mandelbrot/index.html) | [fiddle](https://webassembly.studio/?f=pne1undq5g) ]<br />
63+
* **[Mandelbrot Set](./examples/mandelbrot)** [ [demo](https://rawgit.com/AssemblyScript/assemblyscript/master/examples/mandelbrot/index.html) | [fiddle](https://webassembly.studio/?f=m6hbiw9wyq) ]<br />
6264
Renders the Mandelbrot set to a canvas.
6365

6466
* **[i64 polyfill](./examples/i64-polyfill)**<br />
@@ -91,7 +93,7 @@ $> npm run clean
9193
Linting potential changes:
9294

9395
```
94-
$> npm run lint
96+
$> npm run check
9597
```
9698

9799
Running the [tests](./tests):
@@ -105,3 +107,45 @@ Running everything in order (lint, clean, test, build, test):
105107
```
106108
$> npm run all
107109
```
110+
111+
Contributing
112+
------------
113+
114+
This project exists thanks to all the people who [contribute](CONTRIBUTING.md).
115+
116+
<a href="https://github.com/AssemblyScript/assemblyscript/graphs/contributors"><img src="https://opencollective.com/assemblyscript/contributors.svg?width=890&button=false" /></a>
117+
118+
Sponsoring
119+
----------
120+
121+
The core team members and most contributors do this open source work in their free time. If you use AssemblyScript for a serious task or plan to do so, and you'd like us to invest more time on it, [please donate](https://opencollective.com/assemblyscript).
122+
123+
This is how we use the donations:
124+
125+
* Allow the core team to work on AssemblyScript
126+
* Thank contributors if they invested a large amount of time in contributing
127+
* Support projects in the ecosystem that are of great value for us or users
128+
* Fees for money handling
129+
130+
### Sponsors
131+
132+
[Become a sponsor](https://opencollective.com/assemblyscript#sponsor) and get your logo on our README on Github with a link to your site.
133+
134+
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/0/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/0/avatar.svg"></a>
135+
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/1/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/1/avatar.svg"></a>
136+
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/2/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/2/avatar.svg"></a>
137+
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/3/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/3/avatar.svg"></a>
138+
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/4/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/4/avatar.svg"></a>
139+
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/5/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/5/avatar.svg"></a>
140+
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/6/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/6/avatar.svg"></a>
141+
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/7/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/7/avatar.svg"></a>
142+
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/8/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/8/avatar.svg"></a>
143+
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/9/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/9/avatar.svg"></a>
144+
145+
### Backers
146+
147+
[Become a backer](https://opencollective.com/assemblyscript#backer) and get your image on our README on Github with a link to your site.
148+
149+
<a href="https://opencollective.com/assemblyscript#backers" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/backer.svg?width=890"></a>
150+
151+
Thank you for your support!

bin/asinit

+2-2
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ function ensureGitignore() {
206206
function ensurePackageJson() {
207207
console.log("- Making sure that 'package.json' contains the build commands...")
208208
const entryPath = path.relative(projectDir, entryFile).replace(/\\/g, "/");
209-
const buildUntouched = "asc " + entryPath + " -b build/untouched.wasm -t build/untouched.wat --sourceMap --validate";
210-
const buildOptimized = "asc " + entryPath + " -b build/optimized.wasm -t build/optimized.wat --sourceMap --validate --optimize --noDebug";
209+
const buildUntouched = "asc " + entryPath + " -b build/untouched.wasm -t build/untouched.wat --sourceMap --validate --debug";
210+
const buildOptimized = "asc " + entryPath + " -b build/optimized.wasm -t build/optimized.wat --sourceMap --validate --optimize";
211211
const buildAll = "npm run asbuild:untouched && npm run asbuild:optimized";
212212
if (!fs.existsSync(packageFile)) {
213213
fs.writeFileSync(packageFile, JSON.stringify({

cli/asc.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ exports.main = function main(argv, options, callback) {
230230
var parser = null;
231231

232232
// Include library files
233-
if (!args.noLib) { // bundled
233+
if (!args.noLib) {
234234
Object.keys(exports.libraryFiles).forEach(libPath => {
235235
if (libPath.indexOf("/") >= 0) return; // in sub-directory: imported on demand
236236
stats.parseCount++;
@@ -243,6 +243,16 @@ exports.main = function main(argv, options, callback) {
243243
);
244244
});
245245
});
246+
} else { // always include builtins
247+
stats.parseCount++;
248+
stats.parseTime += measure(() => {
249+
parser = assemblyscript.parseFile(
250+
exports.libraryFiles["builtins"],
251+
exports.libraryPrefix + "builtins.ts",
252+
false,
253+
parser
254+
);
255+
});
246256
}
247257
const customLibDirs = [];
248258
if (args.lib) {
@@ -495,7 +505,7 @@ exports.main = function main(argv, options, callback) {
495505

496506
module.setOptimizeLevel(optimizeLevel);
497507
module.setShrinkLevel(shrinkLevel);
498-
module.setDebugInfo(!args.noDebug);
508+
module.setDebugInfo(args.debug);
499509

500510
var runPasses = [];
501511
if (args.runPasses) {

cli/asc.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@
8181
],
8282
"type": "s"
8383
},
84-
"noTreeShaking": {
85-
"description": "Disables compiler-level tree-shaking, compiling everything.",
84+
"debug": {
85+
"description": "Enables debug information in emitted binaries.",
8686
"type": "b",
8787
"default": false
8888
},
89-
"noDebug": {
90-
"description": "Disables maintaining of debug information in binaries.",
89+
"noTreeShaking": {
90+
"description": "Disables compiler-level tree-shaking, compiling everything.",
9191
"type": "b",
9292
"default": false
9393
},

dist/asc.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/asc.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assemblyscript.js

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assemblyscript.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
33 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)