Skip to content

Commit

Permalink
Setup package basics
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandrHoroshih committed Dec 11, 2023
1 parent 77cc914 commit eb9228c
Show file tree
Hide file tree
Showing 15 changed files with 1,116 additions and 193 deletions.
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,20 @@
"@nrwl/rollup": "16.5.x",
"@nx/devkit": "16.5.x",
"@nx/eslint-plugin": "16.5.x",
"@nx/js": "16.5.x",
"@nx/js": "16.5.5",
"@nx/linter": "16.5.x",
"@nx/vite": "16.5.x",
"@nx/rollup": "16.5.5",
"@nx/vite": "16.5.5",
"@nx/web": "16.5.x",
"@nx/workspace": "16.5.x",
"@playwright/test": "^1.32.2",
"@size-limit/file": "^7.0.8",
"@swc/cli": "~0.1.62",
"@swc/core": "~1.3.51",
"@types/node": "18.7.14",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"@vitest/coverage-c8": "~0.32.0",
"@vitest/ui": "0.34.4",
"bytes-iec": "^3.1.1",
"effector": "23.0.0",
Expand All @@ -55,11 +60,11 @@
"vite-tsconfig-paths": "4.2.1",
"vitepress": "1.0.0-rc.31",
"vitest": "0.34.4",
"vue": "3.3.4",
"@nx/web": "16.5.x"
"vue": "3.3.4"
},
"dependencies": {
"@algolia/client-search": "^4.14.3",
"@swc/helpers": "~0.5.0",
"sandpack-vue3": "^3.1.7"
}
}
18 changes: 18 additions & 0 deletions packages/redux-interop/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
31 changes: 31 additions & 0 deletions packages/redux-interop/.swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"jsc": {
"target": "es2017",
"parser": {
"syntax": "typescript",
"decorators": true,
"dynamicImport": true
},
"transform": {
"decoratorMetadata": true,
"legacyDecorator": true
},
"keepClassNames": true,
"externalHelpers": true,
"loose": true
},
"module": {
"type": "es6",
"strict": true,
"noInterop": true
},
"sourceMaps": true,
"exclude": [
"jest.config.ts",
".*\\.spec.tsx?$",
".*\\.test.tsx?$",
"./src/jest-setup.ts$",
"./**/jest-setup.ts$",
".*.js$"
]
}
11 changes: 11 additions & 0 deletions packages/redux-interop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# redux-interop

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build redux-interop` to build the library.

## Running unit tests

Run `nx test redux-interop` to execute the unit tests via [Jest](https://jestjs.io).
5 changes: 5 additions & 0 deletions packages/redux-interop/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "@withease/redux",
"version": "0.0.1",
"type": "commonjs"
}
36 changes: 36 additions & 0 deletions packages/redux-interop/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "redux-interop",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/redux-interop/src",
"projectType": "library",
"targets": {
"build": {
"executor": "@nx/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/packages/redux-interop",
"main": "packages/redux-interop/src/index.ts",
"tsConfig": "packages/redux-interop/tsconfig.lib.json",
"assets": [],
"project": "packages/redux-interop/package.json",
"compiler": "swc"
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["packages/redux-interop/**/*.ts"]
}
},
"test": {
"executor": "@nx/vite:test",
"outputs": ["coverage/packages/redux-interop"],
"options": {
"passWithNoTests": true,
"reportsDirectory": "../../coverage/packages/redux-interop"
}
}
},
"tags": []
}
1 change: 1 addition & 0 deletions packages/redux-interop/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib/redux-interop';
7 changes: 7 additions & 0 deletions packages/redux-interop/src/lib/redux-interop.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { reduxInterop } from './redux-interop';

describe('reduxInterop', () => {
it('should work', () => {
expect(reduxInterop()).toEqual('redux-interop');
});
});
3 changes: 3 additions & 0 deletions packages/redux-interop/src/lib/redux-interop.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function reduxInterop(): string {
return 'redux-interop';
}
23 changes: 23 additions & 0 deletions packages/redux-interop/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"types": ["vitest"]
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
]
}
10 changes: 10 additions & 0 deletions packages/redux-interop/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"declaration": true,
"types": ["node"]
},
"include": ["src/**/*.ts"],
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
}
19 changes: 19 additions & 0 deletions packages/redux-interop/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": ["vitest/globals", "vitest/importMeta", "vite/client", "node"]
},
"include": [
"vite.config.ts",
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.test.tsx",
"src/**/*.spec.tsx",
"src/**/*.test.js",
"src/**/*.spec.js",
"src/**/*.test.jsx",
"src/**/*.spec.jsx",
"src/**/*.d.ts"
]
}
32 changes: 32 additions & 0 deletions packages/redux-interop/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/// <reference types="vitest" />
import { defineConfig } from 'vite';

import viteTsConfigPaths from 'vite-tsconfig-paths';

export default defineConfig({
cacheDir: '../../node_modules/.vite/redux-interop',

plugins: [
viteTsConfigPaths({
root: '../../',
}),
],

// Uncomment this if you are using workers.
// worker: {
// plugins: [
// viteTsConfigPaths({
// root: '../../',
// }),
// ],
// },

test: {
globals: true,
cache: {
dir: '../../node_modules/.vitest',
},
environment: 'node',
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
},
});
Loading

0 comments on commit eb9228c

Please sign in to comment.