Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
33 changes: 33 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: CI

on:
push:
branches: [ nandenjin/master ]
pull_request:
branches: [ nandenjin/master ]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- run: npm ci
- run: npm run lint

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- run: npm ci
- run: npm run build
63 changes: 63 additions & 0 deletions .github/workflows/shipjs-manual-prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Ship js Manual Prepare
on:
issue_comment:
types: [created]
workflow_dispatch:
jobs:
manual_prepare:
if: |
github.event_name == 'workflow_dispatch' || (github.event_name == 'issue_comment' &&
(github.event.comment.author_association == 'member' || github.event.comment.author_association == 'owner') &&
startsWith(github.event.comment.body, '@shipjs prepare'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: nandenjin/master
- uses: actions/setup-node@v1
- run: |
if [ -f "yarn.lock" ]; then
yarn install
else
npm install
fi
- run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- run: npm run release -- --yes --no-browse
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_INCOMING_HOOK: ${{ secrets.SLACK_INCOMING_HOOK }}

create_done_comment:
if: github.event_name == 'issue_comment' && success()
needs: manual_prepare
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "@${{github.actor}} `shipjs prepare` done"
})

create_fail_comment:
if: github.event_name == 'issue_comment' && (cancelled() || failure())
needs: manual_prepare
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "@${{github.actor}} `shipjs prepare` fail"
})
29 changes: 29 additions & 0 deletions .github/workflows/shipjs-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Ship js trigger
on:
pull_request:
types: [closed]
jobs:
build:
name: Release
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'releases/v')
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: nandenjin/master
- uses: actions/setup-node@v1
with:
registry-url: "https://npm.pkg.github.com"
- run: |
if [ -f "yarn.lock" ]; then
yarn install
else
npm install
fi
- run: npx shipjs trigger
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_INCOMING_HOOK: ${{ secrets.SLACK_INCOMING_HOOK }}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## 0.0.6 (2020-11-10)



31 changes: 26 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
# emcc-loader
# `@nandenjin/emcc-loader`

![LICENSE](https://img.shields.io/github/license/nandenjin/emcc-loader?style=flat-square)
![Version](https://img.shields.io/github/package-json/v/nandenjin/emcc-loader?style=flat-square)
![CI Status](https://img.shields.io/github/workflow/status/nandenjin/emcc-loader/CI?style=flat-square)
[![Dependencies](https://img.shields.io/david/nandenjin/emcc-loader?style=flat-square)](https://david-dm.org/nandenjin/emcc-loader)
[![devDependencies](https://img.shields.io/david/dev/nandenjin/emcc-loader?style=flat-square)](https://david-dm.org/nandenjin/emcc-loader?type=dev)

Webpack loader that compiles some c/c++ files into a wasm using Emscripten.

🙋‍♂️ This is a fork of [`mezum/emcc-loader`](https://www.npmjs.com/package/emcc-loader), and is to implement and contribute for the original package with new features and fixes.

## Install

**⚠️ This is a forked package. For original `emcc-loader`, see [official package page on NPM](https://www.npmjs.com/package/emcc-loader).**

`@nandenjin/emcc-loader` is hosted on GitHub Packages Registry. Add following to `.npmrc` to use it for all `@nandenjin/` packages. [Learn more](https://docs.github.com/en/free-pro-team@latest/packages/using-github-packages-with-your-projects-ecosystem/configuring-npm-for-use-with-github-packages#installing-a-package)

```
registry=https://npm.pkg.github.com/nandenjin
```

Then, install as usual.

```
npm install --save-dev emcc-loader
npm install --save-dev @nandenjin/emcc-loader
```

## Usage
Expand Down Expand Up @@ -86,12 +105,14 @@ emcc-loader is configuable on webpack.config.js.

- buildDir : string
-- [Required] absolute path to temporary directory used by emcc.
- cwd : string
-- [default=undefined] working directory for compilers. If specified, all paths passed to compilers will be relative against cwd.
- cc : string
-- [default=emcc] c compiler path.
-- [default=emcc] c compiler path or command.
- cxx : string
-- [default=em++] c++ compiler path.
-- [default=em++] c++ compiler path or command.
- ld : string
-- [default=emcc] linker path.
-- [default=emcc] linker path or command.
- commonFlags : string[]
-- [default=[]] array of flags passed to all emcc/em++ commands.
- cFlags : string[]
Expand Down
Loading