Skip to content

Commit

Permalink
refactor!: update repo and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Mar 9, 2022
1 parent 9e2e6b4 commit 614cdaa
Show file tree
Hide file tree
Showing 10 changed files with 2,111 additions and 4,053 deletions.
47 changes: 9 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,16 @@ on:

jobs:
ci:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [14]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}

- name: checkout
uses: actions/checkout@master

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile --non-interactive

- name: Lint
run: yarn lint

- name: Build
run: yarn build

- name: Test
run: yarn jest

- name: Coverage
uses: codecov/codecov-action@v1
node-version: '16'
cache: yarn
- run: yarn install
- run: yarn lint
- run: yarn build
- run: yarn vitest --coverage
- uses: codecov/codecov-action@v2
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Pooya Parsa <[email protected]>
Copyright (c) 2021-2022 UnJS

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@
"sideEffects": false,
"exports": {
".": {
"import": "./dist/untyped.mjs",
"require": "./dist/untyped.cjs"
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
"./loader/babel": "./dist/loader/babel.cjs",
"./loader/transform": "./dist/loader/transform.cjs"
},
"main": "./dist/untyped.cjs",
"types": "./dist/untyped.d.ts",
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "siroc build",
"dev": "jest --watch",
"build": "unbuild",
"dev": "vitest",
"lint": "eslint --ext .js,.ts .",
"prepack": "yarn build",
"release": "yarn test && standard-version && git push --follow-tags && npm publish",
"test": "yarn lint && jest",
"test": "yarn lint && vitest",
"web": "nuxi dev web",
"web:build": "cd web && nuxi build"
},
Expand All @@ -35,21 +35,20 @@
"@nuxtjs/eslint-config-typescript": "latest",
"@types/babel__standalone": "latest",
"@types/babel__traverse": "latest",
"@types/jest": "latest",
"@types/node": "latest",
"@vue/compiler-sfc": "latest",
"c8": "^7.11.0",
"eslint": "latest",
"hljs": "latest",
"jest": "latest",
"json-schema": "latest",
"marked": "latest",
"monaco-editor": "latest",
"nuxt-windicss": "^2.0.12",
"nuxt3": "^3.0.0-27287661.1e0e881",
"nuxt-windicss": "latest",
"nuxt3": "latest",
"prismjs": "latest",
"scule": "latest",
"siroc": "latest",
"standard-version": "latest",
"ts-jest": "latest"
"unbuild": "latest",
"vitest": "latest"
}
}
4 changes: 3 additions & 1 deletion src/loader/babel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { version } from '../../package.json'

type GetCodeFn = (loc: t.SourceLocation) => string

export default <PluginItem> function babelPluginUntyped (api: ConfigAPI) {
const babelPluginUntyped: PluginItem = function (api: ConfigAPI) {
api.cache.using(() => version)

return <PluginObj>{
Expand Down Expand Up @@ -142,6 +142,8 @@ export default <PluginItem> function babelPluginUntyped (api: ConfigAPI) {
}
}

export default babelPluginUntyped

function containsIncompleteCodeblock (line = '') {
const codeDelimiters = line.split('\n').filter(line => line.startsWith('```')).length
return !!(codeDelimiters % 2)
Expand Down
1 change: 1 addition & 0 deletions test/defaults.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, it, expect } from 'vitest'
import { applyDefaults } from '../src'

describe('applyDefaults', () => {
Expand Down
1 change: 1 addition & 0 deletions test/schema.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, it, expect } from 'vitest'
import { resolveSchema } from '../src'

describe('resolveSchema', () => {
Expand Down
1 change: 1 addition & 0 deletions test/transform.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, it, expect } from 'vitest'
import { transform } from '../src/loader/transform'

describe('transform (functions)', () => {
Expand Down
1 change: 1 addition & 0 deletions test/types.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, it, expect } from 'vitest'
import { resolveSchema, generateTypes } from '../src'

describe('resolveSchema', () => {
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"esModuleInterop": true,
"strict": false,
"types": [
"node",
"jest"
"node"
]
},
"include": [
Expand Down
Loading

0 comments on commit 614cdaa

Please sign in to comment.