Skip to content

Commit

Permalink
chore: init package (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett authored Sep 4, 2022
1 parent d150378 commit 35fd0b5
Show file tree
Hide file tree
Showing 11 changed files with 653 additions and 104 deletions.
File renamed without changes
22 changes: 22 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build-test-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2

- name: Install dependencies
run: yarn install

- name: Check build health
run: yarn build

- name: Run tests
run: yarn test --silent
112 changes: 10 additions & 102 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,104 +1,12 @@
# 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
.DS_Store
node_modules
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
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": false,
"trailingComma": "all",
"arrowParens": "always",
"singleQuote": true,
"tabWidth": 2,
"printWidth": 120
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
![](itsfine.png)
![](.github/itsfine.png)

This a growing exploration of `React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED`. As such you will be able to betray Reacts component abstraction, like injecting a context, or accessing the nearest parent of your component. I'm sure you want me to tell you how safe and stable this all is.
This a growing exploration of `React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED`. As such you will be able to betray Reacts component abstraction, like injecting a context, or accessing the nearest parent of your component. I'm sure you want me to tell you how safe and stable this all is.
53 changes: 53 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "its-fine",
"version": "0.0.0",
"description": "its-fine, a collection of react-internal hooks",
"keywords": [
"react",
"fiber",
"internal",
"renderer",
"reconciler"
],
"author": "Cody Bennett (https://github.com/codyjasonbennett)",
"maintainers": [
"Paul Henschel (https://github.com/drcmda)"
],
"homepage": "https://github.com/pmndrs/its-fine",
"repository": "https://github.com/pmndrs/its-fine",
"license": "MIT",
"files": [
"dist/*",
"src/*"
],
"types": "./dist/index.d.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"exports": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
},
"sideEffects": false,
"devDependencies": {
"@types/node": "^18.7.14",
"@types/react": "^18.0.17",
"react": "^18.2.0",
"react-nil": "^1.0.0",
"rimraf": "^3.0.2",
"suspend-react": "^0.0.8",
"typescript": "^4.7.4",
"vite": "^3.0.9",
"vitest": "^0.22.1"
},
"dependencies": {
"@types/react-reconciler": "^0.28.0"
},
"peerDependencies": {
"react": ">=18.0"
},
"scripts": {
"build": "rimraf dist && vite build && tsc",
"test": "vitest run"
}
}
Empty file added src/index.ts
Empty file.
17 changes: 17 additions & 0 deletions tests/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { vi, it } from 'vitest'

declare global {
var IS_REACT_ACT_ENVIRONMENT: boolean
}

// Let React know that we'll be testing effectful components
global.IS_REACT_ACT_ENVIRONMENT = true

// Mock scheduler to test React features
vi.mock('scheduler', () => require('scheduler/unstable_mock'))

// Silence react-dom & react-dom/client mismatch
const logError = global.console.error.bind(global.console.error)
global.console.error = (...args: any[]) => !args[0].startsWith('Warning') && logError(...args)

it('runs without crashing', () => {})
17 changes: 17 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"outDir": "dist",
"target": "es6",
"module": "ESNext",
"lib": ["ESNext", "dom"],
"moduleResolution": "node",
"esModuleInterop": true,
"jsx": "react",
"pretty": true,
"strict": true,
"declaration": true,
"emitDeclarationOnly": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src/**/*"]
}
23 changes: 23 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import * as path from 'path'
import { defineConfig } from 'vite'

export default defineConfig({
build: {
minify: false,
sourcemap: true,
target: 'es2018',
lib: {
formats: ['cjs', 'es'],
entry: 'src/index.ts',
fileName: '[name]',
},
rollupOptions: {
external: (id: string) => !id.startsWith('.') && !path.isAbsolute(id),
treeshake: false,
output: {
preserveModules: true,
sourcemapExcludeSources: true,
},
},
},
})
Loading

0 comments on commit 35fd0b5

Please sign in to comment.