Skip to content

Commit

Permalink
update v3.9.0 (#249) from HapticX/dev
Browse files Browse the repository at this point in the history
update v3.9.0
  • Loading branch information
Ethosa authored May 5, 2024
2 parents a079117 + b1ecbe4 commit 3a6dc5d
Show file tree
Hide file tree
Showing 59 changed files with 994 additions and 1,246 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true

[*.nim]
indent_style = space
indent_size = 2
177 changes: 89 additions & 88 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -1,88 +1,89 @@
name: Examples 📕

on:
push:
branches:
- 'master'
paths-ignore:
- 'docs/**'
- '.github/ISSUE_TEMPLATE/*'
- '*.md'
- '*.nimble'
- '.gitignore'
- 'LICENSE'
- '**/FUNDING.yml'
- '**/gh-pages.yml'
- '**/tests.yml'
- '**/language_bindings.yml'
- '**/jvm_bindings.yml'
pull_request:
paths-ignore:
- 'docs/**'
- '.github/ISSUE_TEMPLATE/*'
- '*.md'
- '*.nimble'
- '.gitignore'
- 'LICENSE'
- '**/FUNDING.yml'
- '**/gh-pages.yml'
- '**/tests.yml'
- '**/language_bindings.yml'
- '**/jvm_bindings.yml'

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
nim_version:
- '2.0.0'
env:
TIMEOUT_EXIT_STATUS: 124
steps:
- uses: actions/checkout@v3
- name: Cache nimble
id: cache-nimble
uses: actions/cache@v3
with:
path: ~/.nimble
key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}
- uses: jiro4989/setup-nim-action@v1
with:
nim-version: ${{ matrix.nim_version }}

- name: Install Dependencies
run: |
nimble refresh
nimble install -y -d
- name: Hello World 👋
run: |
cd examples/hello_world/src
nim c -d:httpx main
cd ../../../
shell: bash

- name: TODO App ✅
run: |
cd examples/todo/src
nim js --hints:off --warnings:off main
cd ../../../
shell: bash

- name: NimLang 👑
run: |
cd examples/nimlang/src
nimble install highlightjs
nim js --hints:off --warnings:off main
cd ../../../
shell: bash

- name: Website 🌐
run: |
cd examples/website/src
nim js --hints:off --warnings:off main
cd ../../../
shell: bash
name: Examples 📕

on:
push:
branches:
- 'master'
- 'dev'
paths-ignore:
- 'docs/**'
- '.github/ISSUE_TEMPLATE/*'
- '*.md'
- '*.nimble'
- '.gitignore'
- 'LICENSE'
- '**/FUNDING.yml'
- '**/gh-pages.yml'
- '**/tests.yml'
- '**/language_bindings.yml'
- '**/jvm_bindings.yml'
pull_request:
paths-ignore:
- 'docs/**'
- '.github/ISSUE_TEMPLATE/*'
- '*.md'
- '*.nimble'
- '.gitignore'
- 'LICENSE'
- '**/FUNDING.yml'
- '**/gh-pages.yml'
- '**/tests.yml'
- '**/language_bindings.yml'
- '**/jvm_bindings.yml'

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
nim_version:
- '2.0.0'
env:
TIMEOUT_EXIT_STATUS: 124
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path:
~/.nimble
~/.choosenim
key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}
- uses: jiro4989/setup-nim-action@v1
with:
nim-version: ${{ matrix.nim_version }}

- name: Install Dependencies
run: |
nimble refresh
nimble install -y -d
- name: Hello World 👋
run: |
cd examples/hello_world/src
nim c -d:httpx main
cd ../../../
shell: bash

- name: TODO App ✅
run: |
cd examples/todo/src
nim js --hints:off --warnings:off main
cd ../../../
shell: bash

- name: NimLang 👑
run: |
cd examples/nimlang/src
nimble install highlightjs
nim js --hints:off --warnings:off main
cd ../../../
shell: bash

- name: Website 🌐
run: |
cd examples/website/src
nim js --hints:off --warnings:off main
cd ../../../
shell: bash
182 changes: 85 additions & 97 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,97 +1,85 @@
name: Github Pages 🌐

on:
push:
branches:
- 'master'
paths-ignore:
- '.github/ISSUE_TEMPLATE/*'
- '*.md'
- '*.nimble'
- '.gitignore'
- 'LICENSE'
- '**/FUNDING.yml'
- '**/tests.yml'
- '**/examples.yml'
- '**/language_bindings.yml'
- '**/jvm_bindings.yml'
pull_request:
paths-ignore:
- '.github/ISSUE_TEMPLATE/*'
- '*.md'
- '*.nimble'
- '.gitignore'
- 'LICENSE'
- '**/FUNDING.yml'
- '**/tests.yml'
- '**/examples.yml'
- '**/language_bindings.yml'
- '**/jvm_bindings.yml'

permissions:
contents: write

jobs:
before:
runs-on: windows-latest
if: "! contains(github.event.head_commit.message, '[skip ci]')"
steps:
- run: echo "not contains '[skip ci]'"

docs:
runs-on: windows-latest
needs: before
env:
nim_version: '2.0.0'
node_version: '20'
steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ env.node_version }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.node_version }}

- name: Install uglify-js 👀
run: |
npm install uglify-js -g
- name: Cache nimble
id: cache-nimble
uses: actions/cache@v1
with:
path: ~/.nimble
key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}

- uses: jiro4989/setup-nim-action@v1
with:
nim-version: ${{ env.nim_version }}

- name: Install Dependencies 🔃
run: |
nimble refresh
nimble install -y
- name: Generate API documents 📃
run: nim doc --index:on -d:docgen --project --out:docs --hints:off src/happyx.nim

- name: Build HappyX website 🌐
timeout-minutes: 2
run: |
cd ./examples/website/src/
nim js -d:production -d:release --opt:size --hints:off --warnings:off --out:main_full.js main
uglifyjs main_full.js -c -m --mangle-props regex=/N[ST]I\w+/ -o main.js
cd ../../..
mkdir ./docs/happyx/public/
mkdir ./docs/public/
cp ./examples/website/src/index.html ./docs/
cp ./examples/website/src/main.js ./docs/
cp ./examples/website/src/happyx/public/* ./docs/happyx/public/
cp ./examples/website/src/happyx/public/* ./docs/public/
- name: Deploy documents 💨
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
if: github.ref == 'refs/heads/master'
name: Github Pages 🌐

on:
push:
branches:
- 'master'
paths-ignore:
- '.github/ISSUE_TEMPLATE/*'
- '*.md'
- '*.nimble'
- '.gitignore'
- 'LICENSE'
- '**/FUNDING.yml'
- '**/tests.yml'
- '**/examples.yml'
- '**/language_bindings.yml'
- '**/jvm_bindings.yml'

permissions:
contents: write

jobs:
before:
runs-on: windows-latest
if: "! contains(github.event.head_commit.message, '[skip ci]')"
steps:
- run: echo "not contains '[skip ci]'"

docs:
runs-on: windows-latest
needs: before
env:
nim_version: '2.0.0'
node_version: '20'
steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ env.node_version }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.node_version }}

- name: Install uglify-js 👀
run: |
npm install uglify-js -g
- name: Cache nimble
id: cache-nimble
uses: actions/cache@v1
with:
path: ~/.nimble
key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}

- uses: jiro4989/setup-nim-action@v1
with:
nim-version: ${{ env.nim_version }}

- name: Install Dependencies 🔃
run: |
nimble refresh
nimble install -y
- name: Generate API documents 📃
run: nim doc --index:on -d:docgen --project --out:docs --hints:off src/happyx.nim

- name: Build HappyX website 🌐
timeout-minutes: 2
run: |
cd ./examples/website/src/
nim js -d:production -d:release --opt:size --hints:off --warnings:off --out:main_full.js main
uglifyjs main_full.js -c -m --mangle-props regex=/N[ST]I\w+/ -o main.js
cd ../../..
mkdir ./docs/happyx/public/
mkdir ./docs/public/
cp ./examples/website/src/index.html ./docs/
cp ./examples/website/src/main.js ./docs/
cp ./examples/website/src/happyx/public/* ./docs/happyx/public/
cp ./examples/website/src/happyx/public/* ./docs/public/
- name: Deploy documents 💨
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
if: github.ref == 'refs/heads/master'
Loading

0 comments on commit 3a6dc5d

Please sign in to comment.