Skip to content

Commit bafed87

Browse files
committed
Merge branch 'master' into release
2 parents fb9f00a + 1503f4d commit bafed87

File tree

7 files changed

+74
-58
lines changed

7 files changed

+74
-58
lines changed

.github/workflows/publish.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Publish
22
on:
33
schedule:
4-
- cron: '40 3 * * *'
4+
- cron: '0 0 * * *'
55
jobs:
66
publish:
77
name: "Publish packages"
@@ -30,6 +30,8 @@ jobs:
3030
npm run build
3131
- name: Test distribution files
3232
run: npm test
33+
- name: Reconfigure for release
34+
run: npm run release
3335
- name: Set up version
3436
run: |
3537
VERSION=$(node -e "console.log(require('./package.json').version)")
@@ -50,7 +52,7 @@ jobs:
5052
git commit --allow-empty -m "Release v$VERSION"
5153
fi
5254
echo ::set-env name=VERSION::$VERSION
53-
cd ./lib/loader
55+
cd lib/loader
5456
npm version $VERSION --no-git-tag-version --force
5557
cd ../..
5658
- name: Create tag and push distribution files
@@ -59,17 +61,24 @@ jobs:
5961
git push origin release
6062
git push origin v$VERSION
6163
- name: Publish to npm
64+
env:
65+
NPM_REGISTRY: "registry.npmjs.org"
66+
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6267
run: |
63-
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
68+
npm config set "//${NPM_REGISTRY}/:_authToken=${NPM_AUTH_TOKEN}"
6469
npm publish --tag $CHANNEL
65-
cd ./lib/loader
70+
cd lib/loader
6671
npm publish --tag $CHANNEL --access public
6772
cd ../..
6873
- name: Publish to gpr
74+
env:
75+
NPM_REGISTRY: "npm.pkg.github.com"
76+
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6977
run: |
70-
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
78+
npm config set "//${NPM_REGISTRY}/:_authToken=${NPM_AUTH_TOKEN}""
7179
sed -i 's/"assemblyscript"/"@assemblyscript\/assemblyscript"/' package.json
72-
npm publish --tag $CHANNEL --access public
73-
cd ./lib/loader
74-
npm publish --tag $CHANNEL --access public
80+
sed -i 's/"assemblyscript"/"@assemblyscript\/assemblyscript"/' package-lock.json
81+
npm publish --registry=https://${NPM_REGISTRY}
82+
cd lib/loader
83+
npm publish --registry=https://${NPM_REGISTRY}
7584
cd ../..

README.md

Lines changed: 11 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
![](https://avatars1.githubusercontent.com/u/28916798?s=64) AssemblyScript
22
=================
33

4-
[![Actions Status](https://github.com/AssemblyScript/assemblyscript/workflows/CI/badge.svg)](https://github.com/AssemblyScript/assemblyscript/actions)
4+
[![Actions Status](https://github.com/AssemblyScript/assemblyscript/workflows/CI/badge.svg)](https://github.com/AssemblyScript/assemblyscript/actions) [![npm](https://img.shields.io/npm/v/assemblyscript.svg?color=0074C1)](https://www.npmjs.com/package/assemblyscript) [![npm (tag)](https://img.shields.io/npm/v/assemblyscript/nightly.svg?color=0074C1)](https://www.npmjs.com/package/assemblyscript)
55

66
**AssemblyScript** compiles a strict subset of [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.
77

@@ -45,50 +45,17 @@ Motivation
4545
4646
> I do think [compiling TypeScript into WASM] is tremendously useful. It allows JavaScript developers to create WASM modules without having to learn C. – Colin Eberhardt, [Exploring different approaches to building WebAssembly modules](http://blog.scottlogic.com/2017/10/17/wasm-mandelbrot.html) (Oct 17, 2017)
4747
48-
Instructions
49-
------------
48+
Further resources
49+
-----------------
5050

51-
For general usage instructions, please refer to the [documentation](https://docs.assemblyscript.org) instead. The following sets up a *development environment* of the compiler, for example if you plan to make a pull request:
51+
* [Documentation](https://docs.assemblyscript.org)<br />
52+
Introduction, quick start, examples and general usage instructions.
5253

53-
```
54-
$> git clone https://github.com/AssemblyScript/assemblyscript.git
55-
$> cd assemblyscript
56-
$> npm install
57-
$> npm link
58-
$> npm run clean
59-
```
54+
* [Development instructions](https://docs.assemblyscript.org/details/development)<br />
55+
How to set up a development environment (to submit a pull request).
6056

61-
Note that a fresh clone of the compiler will use the distribution files in `dist/`, but after an `npm run clean` it will run [the sources](./src) directly through ts-node, which is useful in development. This condition can also be checked by running `asc -v` (it is running the sources if it states `-dev`). Also please see our [contribution guidelines](./CONTRIBUTING.md) before making your first pull request.
57+
* [Project governance](https://github.com/AssemblyScript/meta)<br />
58+
Meta information related to the AssemblyScript project.
6259

63-
Building
64-
--------
65-
66-
To build an UMD bundle to `dist/assemblyscript.js` (depends on [binaryen.js](https://github.com/AssemblyScript/binaryen.js)), including a browser version of asc to `dist/asc.js` (depends on assemblyscript.js):
67-
68-
```
69-
$> npm run build
70-
```
71-
72-
Cleaning the distribution files (again):
73-
74-
```
75-
$> npm run clean
76-
```
77-
78-
Linting potential changes:
79-
80-
```
81-
$> npm run check
82-
```
83-
84-
Running the [tests](./tests):
85-
86-
```
87-
$> npm test
88-
```
89-
90-
Running everything in order (lint, clean, test, build, test):
91-
92-
```
93-
$> npm run all
94-
```
60+
* [Media files](./media)<br />
61+
Various media files, like logos etc.

index.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
/// <reference path="./dist/assemblyscript.d.ts" />
2-
export * from "assemblyscript";
1+
export * from "./src";

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
module.exports = require("./dist/assemblyscript");
1+
require("ts-node").register({ project: path.join(__dirname, "src", "tsconfig.json") });
2+
require("./src/glue/js");
3+
module.exports = require("./src");

lib/loader/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
{
22
"name": "@assemblyscript/loader",
33
"version": "0.0.0",
4+
"author": "Daniel Wirtz <[email protected]>",
5+
"license": "Apache-2.0",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/AssemblyScript/assemblyscript.git"
9+
},
10+
"bugs": {
11+
"url": "https://github.com/AssemblyScript/assemblyscript/issues"
12+
},
413
"main": "index.js",
514
"types": "index.d.ts",
615
"scripts": {

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"binaryen": "89.0.0-nightly.20191012",
1616
"glob": "^7.1.5",
1717
"long": "^4.0.0",
18-
"source-map-support": "^0.5.16"
18+
"source-map-support": "^0.5.16",
19+
"ts-node": "^6.2.0"
1920
},
2021
"devDependencies": {
2122
"@types/node": "^12.12.6",
@@ -53,9 +54,10 @@
5354
"test:packages": "cd tests/packages && npm run test",
5455
"make": "npm run clean && npm test && npm run build && npm test",
5556
"all": "npm run check && npm run make",
56-
"docs": "typedoc --tsconfig tsconfig-docs.json --mode modules --name \"AssemblyScript Compiler API\" --out ./docs/api --ignoreCompilerErrors --excludeNotExported --excludePrivate --excludeExternals --exclude **/std/** --includeDeclarations --readme src/README.md"
57+
"docs": "typedoc --tsconfig tsconfig-docs.json --mode modules --name \"AssemblyScript Compiler API\" --out ./docs/api --ignoreCompilerErrors --excludeNotExported --excludePrivate --excludeExternals --exclude **/std/** --includeDeclarations --readme src/README.md",
58+
"release": "node scripts/release"
5759
},
58-
"files": [
60+
"files.release": [
5961
"lib/rtrace/index.d.ts",
6062
"lib/rtrace/index.js",
6163
"lib/rtrace/README.md",

scripts/release.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Reconfigures the repository before publishing a release
2+
3+
const fs = require("fs");
4+
const path = require("path");
5+
const pkg = require("../package.json");
6+
7+
console.log("Updating package.json ...");
8+
delete pkg.dependencies["ts-node"]; // doesn't need ts-node
9+
delete pkg.devDependencies; // or development dependencies
10+
delete pkg.scripts; // or scripts
11+
pkg.files = pkg["files.release"]; // but specifies files
12+
delete pkg["files.release"]; //
13+
fs.writeFileSync(path.join(__dirname, "..", "package.json"), [
14+
JSON.stringify(pkg, null, 2), '\n'
15+
].join(""));
16+
17+
console.log("Updating index.js ...");
18+
fs.writeFileSync(path.join(__dirname, "..", "index.js"), [
19+
'module.exports = require("./dist/assemblyscript");\n'
20+
].join(""));
21+
22+
console.log("Updating index.d.ts ...");
23+
fs.writeFileSync(path.join(__dirname, "..", "index.d.ts"), [
24+
'/// <reference path="./dist/assemblyscript.d.ts" />\n',
25+
'export * from "assemblyscript";\n'
26+
].join(""));
27+
28+
console.log("OK");

0 commit comments

Comments
 (0)