Skip to content

Commit

Permalink
build: add nx (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
devdigital authored Dec 20, 2023
1 parent 1c450c7 commit b27c883
Show file tree
Hide file tree
Showing 85 changed files with 9,211 additions and 9,785 deletions.
30 changes: 0 additions & 30 deletions .cz-config.js

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.REPO_PAT }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: configure git
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Install dependencies
run: |
corepack enable
yarn
- name: Build
run: yarn build
- name: Run tests
run: yarn test
- name: Release
if: github.ref == 'refs/heads/main'
run: yarn semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
node_modules
dist
dist
output
yarn-error.log

.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

.nx/cache
7 changes: 0 additions & 7 deletions .prettierrc

This file was deleted.

1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# utilz

Small node utilties

## types

## merge

## deepmerge
26 changes: 0 additions & 26 deletions lerna.json

This file was deleted.

31 changes: 31 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"extends": "nx/presets/npm.json",
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build", "lint", "test", "e2e"]
}
}
},
"namedInputs": {
"default": ["{projectRoot}/**/*"],
"nonTest": ["!{projectRoot}/**/*.spec.tsx"]
},
"targetDefaults": {
"build": {
"inputs": ["default", "^nonTest"],
"dependsOn": ["^build"]
},
"dev": {
"dependsOn": ["^build"]
},
"test": {
"inputs": ["default", "^nonTest"]
}
},
"affected": {
"defaultBase": "origin/main"
}
}
3 changes: 3 additions & 0 deletions nxrelease.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
repositoryUrl: 'https://github.com/devdigital/tson',
};
22 changes: 9 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
{
"name": "root",
"version": "0.0.0",
"license": "MIT",
"private": true,
"packageManager": "[email protected]",
"workspaces": [
"packages/*"
],
"scripts": {
"commit": "./node_modules/cz-customizable/standalone.js",
"test": "lerna run test",
"clean": "lerna clean",
"bootstrap": "lerna bootstrap",
"prepare": "lerna run prepare",
"release": "lerna publish",
"release:canary": "lerna publish --canary",
"release:next": "lerna publish --dist-tag=next --bump=prerelease",
"diff": "lerna diff",
"changed": "lerna changed"
"test": "nx run-many --target=test",
"build": "nx run-many --target=build",
"semantic-release": "nx run-many --target=semantic-release --parallel=false"
},
"devDependencies": {
"cz-customizable": "^6.2.0",
"lerna": "^4.0.0",
"microbundle": "^0.13.3"
"@theunderscorer/nx-semantic-release": "^2.7.1",
"@tsconfig/node20": "^20.1.2",
"nx": "17.1.2"
}
}
7 changes: 0 additions & 7 deletions packages/deepmerge/jest.config.js

This file was deleted.

25 changes: 11 additions & 14 deletions packages/deepmerge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.1.21",
"description": "Node deep merge utility",
"source": "src/index.ts",
"main": "dist/deepmerge.js",
"module": "dist/deepmerge.esm.js",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"license": "MIT",
"repository": {
Expand All @@ -14,25 +14,22 @@
},
"homepage": "https://github.com/devdigital/utilz/tree/master/packages/deepmerge#readme",
"scripts": {
"prepare": "microbundle --no-compress -o dist",
"watch": "microbundle watch --no-compress -o dist",
"test": "jest",
"test:watch": "jest --watchAll"
"test": "vitest run",
"test:watch": "vitest",
"build": "tsup && yarn create-package",
"watch": "tsup --watch",
"create-package": "mkdir -p ./output && cp -R ./dist/. ./output/dist && cp package.json ./output"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@utilz/types": "^0.1.19",
"@utilz/types": "workspace:^",
"deepmerge": "^4.2.2"
},
"devDependencies": {
"@babel/core": "^7.14.8",
"@babel/preset-env": "^7.14.9",
"@types/jest": "^26.0.24",
"babel-jest": "^27.0.6",
"jest": "^27.0.6",
"ts-jest": "^27.0.4",
"typescript": "^4.3.5"
"tsup": "^7.3.0",
"typescript": "^5.2.2",
"vitest": "^0.34.6"
}
}
12 changes: 12 additions & 0 deletions packages/deepmerge/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@utilz/deepmerge",
"targets": {
"semantic-release": {
"executor": "@theunderscorer/nx-semantic-release:semantic-release",
"options": {
"buildTarget": "${PROJECT_NAME}:build",
"outputPath": "${PROJECT_DIR}/output"
}
}
}
}
64 changes: 0 additions & 64 deletions packages/deepmerge/src/deepmerge.test.ts

This file was deleted.

4 changes: 2 additions & 2 deletions packages/deepmerge/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './deepmerge'
export * from './configure'
export * from "./merge";
export * from "./configure";
Loading

0 comments on commit b27c883

Please sign in to comment.