Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
PoslavskySV committed Oct 3, 2024
0 parents commit 4d9a734
Show file tree
Hide file tree
Showing 36 changed files with 6,438 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Test NPM packages
on:
pull_request:
types: [opened, reopened, synchronize]
branches:
- 'main'
push:
branches:
- 'main'
workflow_dispatch: {}

jobs:
init:
runs-on: ubuntu-latest
steps:
- uses: milaboratory/github-ci/actions/context/init@v4
with:
version-canonize: false
branch-versioning: main
run:
needs:
- init

uses: milaboratory/github-ci-internal/.github/workflows/node-docker-simple-fast-pnpm.yaml@v4
with:
app-name: Block Boilerplate
app-name-slug: 'block-boilerplate'
notify-telegram: true

node-version: '20.x'
always-auth: 'true'

build-script-name: 'build'

test: true
test-script-name: 'test'

secrets:
env: |
{ "PL_LICENSE": ${{ toJSON(secrets.MI_LICENSE) }}, "MI_LICENSE": ${{ toJSON(secrets.MI_LICENSE) }} }
TELEGRAM_NOTIFICATION_TARGET: ${{ secrets.TG_CHANNEL_MIBUILDS }}
TELEGRAM_API_TOKEN: ${{ secrets.TG_CI_BOT_TOKEN }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
dist/
block-pack/
dev/
work/
.test_auth.json
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"tabWidth": 2,
"trailingComma": "none",
"singleQuote": true,
"printWidth": 100
}
30 changes: 30 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"files.exclude": {
"**/.npmrc": true,
"**/*.tgz": true,
"**/block-pack": true,
"**/dist": true,
"**/index.d.ts": true,
"**/index.js": true,
"**/node_modules": true,
"**/pnpm-lock.yaml": true,
"**/tsconfig.app.json": true,
"**/tsconfig.json": true,
"**/tsconfig.node.json": true,
"**/vite.config.mts": true,
"**/vite.config.ts": true,
"**/workflow/dev": true
},
"vitest.disableWorkspaceWarning": true,
"prettier.singleAttributePerLine": true,
"vue.format.wrapAttributes": "force-expand-multiline",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"cSpell.words": [
"datasource",
"pframe",
"prerun",
]
}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.0.0

Initial release.
4 changes: 4 additions & 0 deletions docs/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Overview

Long block description goes here.

Binary file added logos/block-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added logos/milaboratories.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions model/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "@pl-open/milaboratories.blast.model",
"version": "1.0.0",
"description": "Block model",
"type": "module",
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsup && vite build && block-tools build-model"
},
"dependencies": {
"@platforma-sdk/model": "catalog:"
},
"devDependencies": {
"@platforma-sdk/block-tools": "catalog:",
"typescript": "catalog:",
"vite": "catalog:",
"tsup": "catalog:"
},
"tsup": {
"entry": [
"src/index.ts"
],
"splitting": false,
"treeshake": true,
"clean": true,
"format": [
"cjs",
"esm"
],
"dts": true,
"minify": false,
"sourcemap": true
}
}
34 changes: 34 additions & 0 deletions model/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { BlockModel, ImportFileHandle, InferOutputsType, Ref } from '@platforma-sdk/model';

export type BlockArgs = {
dbRef?: Ref;

sequeces?: string;

fastaFile?: ImportFileHandle;
};

export const model = BlockModel.create<BlockArgs>('Heavy')

.initialArgs({})

.output('dbOptions', (ctx) => {
const specs = ctx.resultPool.getSpecsFromResultPool();

return specs.entries
.filter((spec) => {
return spec.obj.kind === 'fileSet' && spec.obj.annotations?.['pl7.app/type'] === 'blastDB';
})
.map((spec) => {
return {
text: spec.obj.annotations?.['pl7.app/label'] ?? 'Unlabelled',
value: spec.ref
};
});
})

.sections([{ type: 'link', href: '/', label: 'Main' }])

.done();

export type BlockOutputs = InferOutputsType<typeof model>;
16 changes: 16 additions & 0 deletions model/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"target": "es2022",
"module": "commonjs",
"moduleResolution": "node",
"esModuleInterop": true,
"strict": true,
"outDir": "./dist",
"rootDir": "./src",
"sourceMap": true,
"declaration": true
},
"types": [],
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}
20 changes: 20 additions & 0 deletions model/vite.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { defineConfig } from 'vite';

export default defineConfig({
build: {
emptyOutDir: false,
lib: {
entry: 'src/index.ts',
name: 'model',
fileName: (format) => `my-lib.${format}.js`
},
minify: false,
sourcemap: true,
rollupOptions: {
output: {
format: 'iife',
entryFileNames: 'bundle.js'
}
}
}
});
46 changes: 46 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "@pl-open/milaboratories.blast",
"version": "1.0.0",
"scripts": {
"pretty": "prettier --write \"./**/*.{js,jsx,mjs,cjs,ts,tsx,json,vue}\"",
"build": "rm -rf ./block-pack && block-tools pack",
"build:model": "cd model && pnpm run build",
"build:all": "pnpm -r run build"
},
"files": [
"index.d.ts",
"index.js"
],
"dependencies": {
"@pl-open/milaboratories.blast.workflow": "workspace:*",
"@pl-open/milaboratories.blast.model": "workspace:*",
"@pl-open/milaboratories.blast.ui": "workspace:*"
},
"block": {
"components": {
"workflow": "@pl-open/milaboratories.blast.workflow/dist/tengo/tpl/main.plj.gz",
"model": "@pl-open/milaboratories.blast.model/dist/model.json",
"ui": "@pl-open/milaboratories.blast.ui/dist"
},
"meta": {
"title": "BLAST",
"logo": "file:logos/block-logo.png",
"url": "https://github.com/milaboratory/platforma-block-boilerplate",
"docs": "https://github.com/milaboratory/platforma-block-boilerplate/docs",
"support": "mailto:support@milaboratories.com",
"description": "Basic Local Alignment Search Tool",
"longDescription": "file:./docs/description.md",
"changelog": "file:CHANGELOG.md",
"tags": ["blast"],
"organization": {
"name": "MiLaboratories Inc",
"url": "https://milaboratories.com/",
"logo": "file:logos/milaboratories.png"
}
}
},
"devDependencies": {
"@changesets/cli": "catalog:",
"@platforma-sdk/block-tools": "catalog:"
}
}
Loading

0 comments on commit 4d9a734

Please sign in to comment.