Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions apps/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
"version": "0.1.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"check-types": "tsc --noemit -p tsconfig.json",
"preview": "vite preview"
"check-types": "tsc --noemit -p tsconfig.json"
},
"dependencies": {
"@chakra-ui/icons": "^2.1.0",
Expand Down
65 changes: 65 additions & 0 deletions apps/playground/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"name": "playground",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/playground/src",
"projectType": "application",
"targets": {
"build": {
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "docs"
},
"configurations": {
"development": {
"mode": "development"
},
"production": {
"mode": "development"
}
}
},
"preview": {
"executor": "@nx/vite:preview-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "playground:build",
"staticFilePath": "../../docs"
},
"configurations": {
"development": {
"buildTarget": "playground:build",
"port": 3000,
"hmr": true
}
}
},
"serve": {
"executor": "@nx/vite:dev-server",
"defaultConfiguration": "development",
"updateBuildableProjectDepsInPackageJson": true,
"options": {
"buildTarget": "buidable:build",
"waitUntilTargets": ["buildable:build"]
},
"configurations": {
"development": {
"buildTarget": "buidable:build",
"port": 3000,
"hmr": true
},
"production": {
"buildTarget": "buidable:build",
"hmr": false
}
}
},
"servee": {
"executor": "nx:run-commands",
"options": {
"commands": ["nx run buidable:build", "nx run playground:serve:development"]
}
}
},
"tags": []
}
4 changes: 3 additions & 1 deletion apps/playground/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { Box, Heading, Container, Text, Button, Stack, Grid, GridItem, Textarea
import Editor from 'react-monaco-editor'
import { getDiff } from '@json-difference'
import { DeleteIcon, AddIcon } from '@chakra-ui/icons'
// import { buidable } from '../../../dist/libs/buidable'
import { buidable } from 'buidable'

const oldJsonExample = `{ "foo": { "bar": "true" } }`
const newJsonExample = `{ "foo": { } }`
Expand Down Expand Up @@ -52,7 +54,7 @@ const App = () => {
</Heading>
<Grid templateColumns="repeat(2, 1fr)" gap="1">
<GridItem w="100%">
<Text>Original JSON</Text>
<Text>cafe = {buidable()} = Original JSON </Text>
<Editor width="100%" height="300" language="json" theme="vs-dark" onChange={setOldJson} value={oldJson} />
</GridItem>
<GridItem w="100%">
Expand Down
84 changes: 42 additions & 42 deletions docs/assets/index-2384594e.js → docs/assets/index-6d6b7453.js

Large diffs are not rendered by default.

992 changes: 0 additions & 992 deletions docs/assets/index-a57b01c0.js

This file was deleted.

992 changes: 0 additions & 992 deletions docs/assets/index-acfe8f0b.js

This file was deleted.

992 changes: 0 additions & 992 deletions docs/assets/index-b6399fa9.js

This file was deleted.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="icon" type="image/svg+xml" href="/json-difference/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Json Difference Playground</title>
<script type="module" crossorigin src="/json-difference/assets/index-2384594e.js"></script>
<script type="module" crossorigin src="/json-difference/assets/index-6d6b7453.js"></script>
<link rel="stylesheet" href="/json-difference/assets/index-e36ef729.css">
</head>
<body>
Expand Down
36 changes: 36 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "playground",
"homepage": "https://lukascivil.github.io/json-difference/",
"private": true,
"version": "0.1.0",
"type": "module",
"scripts": {
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"check-types": "tsc --noemit -p tsconfig.json"
},
"dependencies": {
"@chakra-ui/icons": "^2.1.0",
"@chakra-ui/react": "^2.8.0",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"framer-motion": "^10.13.0",
"json-difference": "*",
"monaco-editor": "^0.40.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-monaco-editor": "^0.53.0",
"vite-tsconfig-paths": "^4.2.0"
},
"devDependencies": {
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vitejs/plugin-react": "^4.0.3",
"eslint": "^8.45.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"typescript": "^5.0.2",
"vite": "^4.4.5"
}
}
42 changes: 42 additions & 0 deletions libs/buidable/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"extends": [
"../../.eslintrc.json"
],
"ignorePatterns": [
"!**/*"
],
"overrides": [
{
"files": [
"*.ts",
"*.tsx",
"*.js",
"*.jsx"
],
"rules": {}
},
{
"files": [
"*.ts",
"*.tsx"
],
"rules": {}
},
{
"files": [
"*.js",
"*.jsx"
],
"rules": {}
},
{
"files": [
"*.json"
],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": "error"
}
}
]
}
13 changes: 13 additions & 0 deletions libs/buidable/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# buidable

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



## Building

Run `nx build buidable` to build the library.




7 changes: 7 additions & 0 deletions libs/buidable/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "buidable",
"version": "0.0.1",
"main": "./index.js",
"module": "./index.mjs",
"typings": "./index.d.ts"
}
24 changes: 24 additions & 0 deletions libs/buidable/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "buidable",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/buidable/src",
"projectType": "library",
"targets": {
"build": {
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/buidable",
"watch": true
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/buidable/**/*.ts", "libs/buidable/package.json"]
}
}
},
"tags": []
}
1 change: 1 addition & 0 deletions libs/buidable/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib/buidable'
3 changes: 3 additions & 0 deletions libs/buidable/src/lib/buidable.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function buidable(): string {
return 'buidable 3'
}
19 changes: 19 additions & 0 deletions libs/buidable/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
}
]
}
10 changes: 10 additions & 0 deletions libs/buidable/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"]
}
40 changes: 40 additions & 0 deletions libs/buidable/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { defineConfig } from 'vite'
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'
import dts from 'vite-plugin-dts'
import * as path from 'path'

export default defineConfig({
cacheDir: '../../node_modules/.vite/buidable',
plugins: [
dts({
entryRoot: 'src',
tsConfigFilePath: path.join(__dirname, 'tsconfig.lib.json'),
skipDiagnostics: true
}),

nxViteTsPaths()
],

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

// Configuration for building your library.
// See: https://vitejs.dev/guide/build.html#library-mode
build: {
lib: {
// Could also be a dictionary or array of multiple entry points.
entry: 'src/index.ts',
name: 'buidable',
fileName: 'index',
// Change this to the formats you want to support.
// Don't forget to update your package.json as well.
formats: ['es', 'cjs', 'umd']
},
rollupOptions: {
// External packages that should not be bundled into your library.
external: []
}
}
})
3 changes: 2 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"dependsOn": ["^check-types"]
},
"test": {
"dependsOn": ["^test"]
"dependsOn": ["^test"],
"inputs": ["default", "^default"]
},
"build-playground": {
"dependsOn": ["^build-playground"]
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"noEmit": true,
"baseUrl": "./",
"paths": {
"@json-difference": ["libs/json-difference/src/index.ts"]
"@json-difference": ["libs/json-difference/src/index.ts"],
"buidable": ["dist/libs/buidable"]
}
},
"include": ["src"],
Expand Down
6 changes: 6 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5856,6 +5856,12 @@ __metadata:
languageName: node
linkType: hard

"buidable@workspace:libs/buidable":
version: 0.0.0-use.local
resolution: "buidable@workspace:libs/buidable"
languageName: unknown
linkType: soft

"builtins@npm:^5.0.0, builtins@npm:^5.0.1":
version: 5.0.1
resolution: "builtins@npm:5.0.1"
Expand Down