From 107f2bd4a720d20d8111397dc422641857fcbab7 Mon Sep 17 00:00:00 2001 From: Nicolas Lebrun Date: Sat, 9 Dec 2023 16:31:46 +0100 Subject: [PATCH] update node version + move type def to index --- .github/workflows/ci.yml | 4 ++-- src/api.d.ts | 27 --------------------------- src/artists/b.ts | 2 +- src/artists/c.ts | 2 +- src/artists/d.ts | 2 +- src/artists/g.ts | 2 +- src/artists/h.ts | 2 +- src/index.ts | 30 +++++++++++++++++++++++++++--- 8 files changed, 34 insertions(+), 37 deletions(-) delete mode 100644 src/api.d.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc073d6..4fdc874 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,11 +9,11 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Use Node.js 14.x + - name: Use Node.js 16.x uses: actions/setup-node@v1 with: registry-url: https://npm.pkg.github.com/ - node-version: 14.x + node-version: 16.x scope: '@nclslbrn' - name: npm install, build, and test run: | diff --git a/src/api.d.ts b/src/api.d.ts deleted file mode 100644 index 45e2d31..0000000 --- a/src/api.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -export interface Scheme { - background: string, - colors: string[], - stroke: string, - temp: 'cold' | 'warm' | 'neutral', - theme: 'bright' | 'dark', - meta: { - title: string, - artist: string, - year: string, - techniques: string - } -} - -export interface Args { - rand?: number, - temp?: 'any' | 'cold' | 'warm', - theme?: 'any' | 'bright' | 'dark', - artist?: string -} - -export interface DefaultArgs extends Args { - rand: number, - temp: 'any' | 'cold' | 'warm', - theme: 'any' | 'bright' | 'dark', - artist: string -} \ No newline at end of file diff --git a/src/artists/b.ts b/src/artists/b.ts index c698a0f..ab930aa 100644 --- a/src/artists/b.ts +++ b/src/artists/b.ts @@ -1,4 +1,4 @@ -import { type Scheme } from "../api" +import { type Scheme } from "../index" export default [{ background: "#7F9086", diff --git a/src/artists/c.ts b/src/artists/c.ts index 81d6cef..c41c845 100644 --- a/src/artists/c.ts +++ b/src/artists/c.ts @@ -1,4 +1,4 @@ -import { type Scheme } from "../api" +import { type Scheme } from "../index" export default [{ background: "#222221", diff --git a/src/artists/d.ts b/src/artists/d.ts index 0508eca..21a9a2c 100644 --- a/src/artists/d.ts +++ b/src/artists/d.ts @@ -1,4 +1,4 @@ -import { type Scheme } from "../api" +import { type Scheme } from "../index" export default [{ background: "#ece3e4", diff --git a/src/artists/g.ts b/src/artists/g.ts index aa46d32..13fd099 100644 --- a/src/artists/g.ts +++ b/src/artists/g.ts @@ -1,4 +1,4 @@ -import { type Scheme } from "../api" +import { type Scheme } from "../index" export default [{ background: "#1b1006", diff --git a/src/artists/h.ts b/src/artists/h.ts index 1caa580..463ac12 100644 --- a/src/artists/h.ts +++ b/src/artists/h.ts @@ -1,4 +1,4 @@ -import { type Scheme } from "../api" +import { type Scheme } from "../index" export default [{ background: "#eddebf", diff --git a/src/index.ts b/src/index.ts index 60cd78f..06712bc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,30 @@ -// https://onderonur.netlify.app/blog/creating-a-typescript-library-with-vite/ -// src/index.ts -import { type Scheme, Args, DefaultArgs } from "./api" +export interface Scheme { + background: string, + colors: string[], + stroke: string, + temp: 'cold' | 'warm' | 'neutral', + theme: 'bright' | 'dark', + meta: { + title: string, + artist: string, + year: string, + techniques: string + } +} + +export interface Args { + rand?: number, + temp?: 'any' | 'cold' | 'warm', + theme?: 'any' | 'bright' | 'dark', + artist?: string +} + +export interface DefaultArgs extends Args { + rand: number, + temp: 'any' | 'cold' | 'warm', + theme: 'any' | 'bright' | 'dark', + artist: string +} import b from './artists/b'; import c from './artists/c';