Skip to content

Commit

Permalink
Publish Library on NPM (#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
EagleoutIce authored Jan 4, 2024
2 parents 7a53fa9 + 747bf52 commit 30f2ff2
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 5 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ jobs:
fetch-depth: 0
token: ${{ secrets.RELEASE_TOKEN }}

- uses: actions/setup-node@v4
with:
node-version: '21.x'
registry-url: 'https://registry.npmjs.org/'

- name: Name and Email for Git (config)
run: |
git config --local user.email "action@github.com"
Expand All @@ -45,6 +50,19 @@ jobs:
env:
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}

- name: Ensure up-to-date Dependencies
run: npm ci

- name: Publish on NPM
# we use publish library because flowr itself is a runnable, and we do not want to publish something with extra
# dist paths etc.
# besides, we make dead-sure we have a clean directory to work on!
run: |
rm -rf dist
npm publish-library
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

performance-test:
name: "Performance Test"
needs: ['release']
Expand Down
23 changes: 23 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
node_modules/

/wiki

# Logs
*.log

.git*

# Coverage
/.nyc_output
/coverage

# IDE specific
/.vscode/
/.project/
/.settings/

/.DS_Store
src/**
test/**
**/*.map
.idea/
23 changes: 20 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
{
"name": "flowr",
"name": "@code-inspect/flowr",
"version": "1.3.7",
"description": "Program Slicer and Analyzer for R Programs",
"description": "Static Dataflow Analyzer and Program Slicer for the R Programming Language",
"main": "dist/src/flowr.js",
"types": "dist/src/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/Code-Inspect/flowr.git"
},
"homepage": "https://github.com/Code-Inspect/flowr",
"bugs": {
"url": "https://github.com/Code-Inspect/flowr/issues"
},
"scripts": {
"publish-library": "cp .npmignore package.json README.md LICENSE dist/src/ && cd dist/src && npm publish --provenance --access public",
"main": "ts-node src/flowr.ts",
"stats": "ts-node src/cli/statistics-app.ts",
"stats-helper": "ts-node src/cli/statistics-helper-app.ts",
Expand All @@ -22,7 +32,14 @@
"performance-test": "func() { cd test/performance/ && bash run-all-suites.sh $1 $2; cd ../../; }; func",
"test-full": "npm run test -- --test-installation"
},
"keywords": [],
"keywords": [
"static code analysis",
"R programming language",
"R",
"programming",
"slicing",
"dataflow analysis"
],
"author": "Florian Sihler",
"license": "ISC",
"nyc": {
Expand Down
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export * from './core'
export * from './slicing'
export * from './dataflow'
export * from './r-bridge'
export * from './benchmark'
export * from './statistics'
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"compilerOptions": {
"incremental": true,
"esModuleInterop": true,
"declaration": true,
"resolveJsonModule": true,
"target": "ESNext",
"module": "commonjs",
Expand All @@ -13,7 +14,7 @@
},
"lib": [ "esnext", "dom" ],
"exclude": [
"node_modules",
"node_modules/*"
"node_modules/**/*",
"dist/**/*"
]
}

2 comments on commit 30f2ff2

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"artificial" Benchmark Suite

Benchmark suite Current: 30f2ff2 Previous: c148955 Ratio
Total per-file 3280.550697181818 ms (3857.3745056572234) 3538.5974304545457 ms (4581.372160627646) 0.93
Retrieve AST from R code 73.62164022727274 ms (141.5555488587358) 77.82700472727274 ms (149.40207734835903) 0.95
Normalize R AST 97.16322845454545 ms (158.8362572748008) 98.53393954545454 ms (158.74254778960403) 0.99
Produce dataflow information 65.49940586363637 ms (167.4622317990319) 67.4761410909091 ms (174.11690488775295) 0.97
Total per-slice 1.931826992115105 ms (1.3750439088669728) 2.002858174188422 ms (1.4075505647469286) 0.96
Static slicing 1.4426903954745336 ms (1.2690452905631608) 1.4466165340773975 ms (1.2822227155581158) 1.00
Reconstruct code 0.47139131652110866 ms (0.27662949533658154) 0.535649854171506 ms (0.31471901439260436) 0.88
failed to reconstruct/re-parse 0 # 0 # NaN
times hit threshold 0 # 0 # NaN
reduction (characters) 0.7329390759026896 # 0.7329390759026896 # 1
reduction (normalized tokens) 0.720988345209971 # 0.720988345209971 # 1

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"social-science" Benchmark Suite

Benchmark suite Current: 30f2ff2 Previous: c148955 Ratio
Total per-file 5501.1731677200005 ms (6120.12988743029) 5299.04631092 ms (5949.936560017347) 1.04
Retrieve AST from R code 89.65526468 ms (79.96120434869435) 83.68679132 ms (73.7801235231147) 1.07
Normalize R AST 116.66400614 ms (70.8615642707345) 114.06245784000001 ms (68.14560113212112) 1.02
Produce dataflow information 167.62076847999998 ms (284.01918586797757) 163.93117192 ms (280.35389486139917) 1.02
Total per-slice 8.91138792805278 ms (14.661857659011416) 8.620094841233877 ms (14.21744467164844) 1.03
Static slicing 8.306475332789114 ms (14.529139906233992) 8.074770025618278 ms (14.080844460663188) 1.03
Reconstruct code 0.5952090295962793 ms (0.31648812055114317) 0.536541978843609 ms (0.29920637505319564) 1.11
failed to reconstruct/re-parse 9 # 9 # 1
times hit threshold 967 # 967 # 1
reduction (characters) 0.898713819973478 # 0.898713819973478 # 1
reduction (normalized tokens) 0.8579790415512589 # 0.8579790415512589 # 1

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.