Skip to content

Commit

Permalink
update node version + move type def to index
Browse files Browse the repository at this point in the history
  • Loading branch information
nclslbrn committed Dec 9, 2023
1 parent 7825624 commit 107f2bd
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 37 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
27 changes: 0 additions & 27 deletions src/api.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/artists/b.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Scheme } from "../api"
import { type Scheme } from "../index"

export default [{
background: "#7F9086",
Expand Down
2 changes: 1 addition & 1 deletion src/artists/c.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Scheme } from "../api"
import { type Scheme } from "../index"

export default [{
background: "#222221",
Expand Down
2 changes: 1 addition & 1 deletion src/artists/d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Scheme } from "../api"
import { type Scheme } from "../index"

export default [{
background: "#ece3e4",
Expand Down
2 changes: 1 addition & 1 deletion src/artists/g.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Scheme } from "../api"
import { type Scheme } from "../index"

export default [{
background: "#1b1006",
Expand Down
2 changes: 1 addition & 1 deletion src/artists/h.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Scheme } from "../api"
import { type Scheme } from "../index"

export default [{
background: "#eddebf",
Expand Down
30 changes: 27 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down

0 comments on commit 107f2bd

Please sign in to comment.