-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADDED] ci @produck/range-axis: [ADDED] script: build
- Loading branch information
Showing
6 changed files
with
108 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# This workflow will do a clean installation of node dependencies, cache/restore them, 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: Node.js CI | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- "**" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x, 18.x] | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "npm" | ||
|
||
- name: Install npm dependencies | ||
run: npm run deps:install | ||
|
||
- name: Run tests | ||
run: npm run coverage | ||
|
||
- name: Coveralls Finished | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# range-axis | ||
To compute axis which some integer ranges on it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { builtinModules, createRequire } from 'node:module'; | ||
import path from 'node:path'; | ||
|
||
import { defineConfig } from 'rollup'; | ||
|
||
const require = createRequire(import.meta.url); | ||
const meta = require('../package.json'); | ||
|
||
const BANNER = | ||
'/*!\n' + | ||
` * ${meta.name} v${meta.version}\n` + | ||
` * (c) 2022-${new Date().getFullYear()} ChaosLee\n` + | ||
` * Released under the ${meta.license} License.\n` + | ||
' */'; | ||
|
||
const moduleList = [ | ||
{ | ||
output: path.resolve('src/index.gen.cjs'), | ||
format: 'cjs', | ||
isExternal: true, | ||
}, | ||
]; | ||
|
||
export default moduleList.map(config => { | ||
return defineConfig({ | ||
input: path.resolve('src/index.mjs'), | ||
output: { | ||
file: config.output, | ||
format: config.format, | ||
name: config.name, | ||
banner: BANNER, | ||
}, | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
declare module Structure { | ||
class Boundary { | ||
number: number; | ||
inclusive: boolean; | ||
} | ||
|
||
class Range { | ||
from: Boundary; | ||
to: Boundary; | ||
readonly length: number; | ||
} | ||
|
||
class Axis { | ||
readonly size: number; | ||
[Symbol.iterator]: Generator<Range, undefined, unknown>; | ||
} | ||
|
||
type BoundaryLike = Boundary | number; | ||
type RangeLike = Range | [BoundaryLike, BoundaryLike] | BoundaryLike; | ||
type AxisLike = Axis | RangeLike[]; | ||
} | ||
|
||
declare class RangeAxisAlgorithm { | ||
setTolerance(value: number): undefined; | ||
union(A: Structure.AxisLike, B: Structure.AxisLike): Structure.Axis; | ||
intersection(A: Structure.AxisLike, B: Structure.AxisLike): Structure.Axis; | ||
difference(A: Structure.AxisLike, B: Structure.AxisLike): Structure.Axis; | ||
} | ||
|
||
export { RangeAxisAlgorithm as Algorithm }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
export * from './Structure/index.mjs'; | ||
export { operator as Union } from './Union.mjs'; | ||
export { operator as Intersection } from './Intersection.mjs'; | ||
export { operator as Difference } from './Difference.mjs'; | ||
export { I, E, INFINITY } from './Structure/Boundary.mjs'; | ||
export { RangeAxisAlgorithm as Algorithm } from './Algorithm.mjs'; |