Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create npm package #252

Merged
merged 4 commits into from
Oct 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
30 changes: 30 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# http://editorconfig.org

# A special property that should be specified at the top of the file outside of
# any sections. Set to true to stop .editor config file search on current file
root = true

[*]
# Indentation style
# Possible values - tab, space
indent_style = space

# Indentation size in single-spaced characters
# Possible values - an integer, tab
indent_size = 2

# Line ending file format
# Possible values - lf, crlf, cr
end_of_line = lf

# File character encoding
# Possible values - latin1, utf-8, utf-16be, utf-16le
charset = utf-8

# Denotes whether to trim whitespace at the end of lines
# Possible values - true, false
trim_trailing_whitespace = true

# Denotes whether file should end with a newline
# Possible values - true, false
insert_final_newline = true
38 changes: 38 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}

runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ["12.x"]
os: [ubuntu-latest]

steps:
- name: Checkout repo
uses: actions/checkout@v2

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

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1

- name: Lint
run: yarn lint

- name: Test
run: yarn test --ci --coverage --maxWorkers=2

- name: Build
run: yarn build
37 changes: 37 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Website
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node
uses: actions/setup-node@v1
with:
node-version: 12

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1
with:
working-directory: website

- name: Build
run: yarn build
working-directory: website

# - name: Publish
# run: |
# git config --global user.name "${GH_NAME}"
# git config --global user.email "${GH_EMAIL}"
# echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc
# cd website && yarn install && GIT_USER="${GH_NAME}" yarn run publish-gh-pages
# working-directory: website
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.log
.DS_Store

node_modules
dist

lib/core/metadata.js
lib/core/MetadataBlog.js
Expand Down
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

15 changes: 0 additions & 15 deletions examples/intents/application_example.json

This file was deleted.

24 changes: 0 additions & 24 deletions footerimg/finos_wordmark.svg

This file was deleted.

58 changes: 58 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "@finos/fdc3",
"version": "1.1.0-alpha.1",
"author": "Fintech Open Source Foundation (FINOS)",
"repository": "git@github.com:finos/FDC3.git",
"license": "Apache-2.0",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"module": "dist/fdc3.esm.js",
"files": [
"dist",
"src"
],
"engines": {
"node": ">=10"
},
"scripts": {
"start": "tsdx watch",
"build": "tsdx build",
"test": "tsdx test",
"lint": "tsdx lint",
"prepare": "tsdx build",
"size": "size-limit",
"analyze": "size-limit --why",
"typegen": "cd src/context && quicktype -s schema --src-urls schemas.json -o ContextTypes.ts"
},
"peerDependencies": {},
"husky": {
"hooks": {
"pre-commit": "tsdx lint"
}
},
"prettier": {
"semi": true,
"singleQuote": true,
"arrowParens": "avoid",
"trailingComma": "es5"
},
"size-limit": [
{
"path": "dist/fdc3.cjs.production.min.js",
"limit": "10 KB"
},
{
"path": "dist/fdc3.esm.js",
"limit": "10 KB"
}
],
"devDependencies": {
"@size-limit/preset-small-lib": "^4.6.0",
"husky": "^4.3.0",
"quicktype": "^15.0.258",
"size-limit": "^4.6.0",
"tsdx": "^0.14.0",
"tslib": "^2.0.1",
"typescript": "^4.0.3"
}
}
15 changes: 9 additions & 6 deletions src/api/AppIntent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
* Copyright 2019 FINOS FDC3 contributors - see NOTICE file
*/

import { AppMetadata } from './AppMetadata';
import { IntentMetadata } from './IntentMetadata';

/**
* An interface that relates an intent to apps
*/
interface AppIntent {
intent: IntentMetadata;
apps: Array<AppMetadata>;
}
* An interface that relates an intent to apps
*/
export interface AppIntent {
readonly intent: IntentMetadata;
readonly apps: Array<AppMetadata>;
}
37 changes: 18 additions & 19 deletions src/api/AppMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,22 @@
/**
* App definition as provided by the application directory
*/
interface AppMetadata {
export interface AppMetadata {
/** The unique app name that can be used with the open and raiseIntent calls. */
readonly name: string;

/** The unique app name that can be used with the open and raiseIntent calls. */
name: string;

/** A more user-friendly application title that can be used to render UI elements */
title?: string;

/** A tooltip for the application that can be used to render UI elements */
tooltip?: string;

/** A longer, multi-paragraph description for the application that could include markup */
description?: string;

/** A list of icon URLs for the application that can be used to render UI elements */
icons?: Array<string>;

/** A list of image URLs for the application that can be used to render UI elements */
images?: Array<string>;
}
/** A more user-friendly application title that can be used to render UI elements */
readonly title?: string;

/** A tooltip for the application that can be used to render UI elements */
readonly tooltip?: string;

/** A longer, multi-paragraph description for the application that could include markup */
readonly description?: string;

/** A list of icon URLs for the application that can be used to render UI elements */
readonly icons?: Array<string>;

/** A list of image URLs for the application that can be used to render UI elements */
readonly images?: Array<string>;
}
Loading