Skip to content

Commit

Permalink
(chore): reproduce dependency mock failing
Browse files Browse the repository at this point in the history
  • Loading branch information
fooddilsn committed Apr 3, 2023
0 parents commit 209a74d
Show file tree
Hide file tree
Showing 31 changed files with 4,623 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": [],
"privatePackages": {
"version": true,
"tag": true
}
}
52 changes: 52 additions & 0 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Changesets

on:
push:
branches:
- main

jobs:
release:
name: Changesets
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- uses: pnpm/action-setup@v2
with:
version: 7

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build

- name: Create Release Pull Request
uses: changesets/action@v1
with:
publish: pnpm release
createGithubReleases: true
commit: "chore: version release"
title: "Version Release"
env:
GITHUB_TOKEN: ${{ secrets.DUCKTORS_PAT }}
NPM_TOKEN: ${{ secrets.DUCKTORS_NPM_TOKEN }}
104 changes: 104 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

pnpm dlx lint-staged
3 changes: 3 additions & 0 deletions .lintstagedrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
'*.{mjs,cjs,js,jsx,ts,tsx}': 'pnpm lint && pnpm format',
}
4 changes: 4 additions & 0 deletions .turbo/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"teamId": "team_ducktors",
"apiUrl": "https://eu.trrc.ducktors.dev"
}
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# undefined

## Project Setup

```sh
pnpm install
```

### Type-Check Compile for Production

```sh
pnpm build
```

### Run Tests with [Vitest](https://vitest.dev/)

```sh
pnpm test
```

### Lint and Format with [Rome](https://rome.tools/)

Linting will also check types using [tsc](https://www.typescriptlang.org/).

```sh
pnpm lint
pnpm format
```
105 changes: 105 additions & 0 deletions apps/foo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# test coverage and reports
.nyc_output
junit.xml

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
28 changes: 28 additions & 0 deletions apps/foo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# undefined

## Project Setup

```sh
pnpm install
```

### Type-Check Compile for Production

```sh
pnpm build
```

### Run Tests with [Vitest](https://vitest.dev/)

```sh
pnpm test
```

### Lint and Format with [Rome](https://rome.tools/)

Linting will also check types using [tsc](https://www.typescriptlang.org/).

```sh
pnpm lint
pnpm format
```
8 changes: 8 additions & 0 deletions apps/foo/__mocks__/sample.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Mock, vi } from 'vitest';

export const main: Mock = vi.fn().mockImplementation(() => {
console.log('Fake implementation');
return false;
});


30 changes: 30 additions & 0 deletions apps/foo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "foo",
"private": true,
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "rimraf ./dist && tsc -p ./tsconfig.build.json",
"dev": "tsx watch --clear-screen=false src/index.ts",
"format": "rome format --write .",
"lint": "rome check .",
"preinstall": "npx only-allow pnpm",
"test": "vitest run",
"test:ci": "vitest run --reporter=junit --reporter=default --coverage",
"test:watch": "vitest --watch"
},
"dependencies": {
"sample": "workspace:*",
"tslib": "^2.5.0"
},
"devDependencies": {
"@ducktors/tsconfig": "^0.1.1",
"@types/node": "^16.18.11",
"@vitest/coverage-istanbul": "^0.28.4",
"rimraf": "^4.1.2",
"rome": "11.0.0",
"tsx": "^3.12.2",
"typescript": "^4.9.5",
"vitest": "^0.28.4"
}
}

0 comments on commit 209a74d

Please sign in to comment.