Skip to content

Commit

Permalink
feat(global): setup CD
Browse files Browse the repository at this point in the history
  • Loading branch information
isaldin committed Apr 30, 2024
1 parent ad71cd7 commit 55c1fc8
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 53 deletions.
2 changes: 1 addition & 1 deletion commitlint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default {
'scope-enum': [
RuleConfigSeverity.Error,
'always',
['global', 'core', 'examples', 'ethers', 'web3.js'],
['global', 'core', 'examples', 'ethers', 'web3.js', 'release'],
],
},
prompt: {
Expand Down
76 changes: 33 additions & 43 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"extends": "nx/presets/npm.json",
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"namedInputs": {
"default": ["{projectRoot}/*", "{projectRoot}/**/*", "sharedGlobals"],
Expand All @@ -14,48 +15,6 @@
],
"sharedGlobals": []
},
"plugins": [
{
"plugin": "@nx/vite/plugin",
"options": {
"buildTargetName": "build",
"previewTargetName": "preview",
"testTargetName": "test",
"serveTargetName": "serve",
"serveStaticTargetName": "serve-static"
}
},
{
"plugin": "@nx/eslint/plugin",
"options": {
"targetName": "lint"
}
},
{
"plugin": "@nx/jest/plugin",
"options": {
"targetName": "test"
}
}
],
"generators": {
"@nx/react": {
"application": {
"babel": true,
"style": "tailwind",
"linter": "eslint",
"bundler": "vite"
},
"component": {
"style": "tailwind"
},
"library": {
"style": "tailwind",
"linter": "eslint",
"unitTestRunner": "vitest"
}
}
},
"targetDefaults": {
"@nx/js:tsc": {
"dependsOn": ["^build"],
Expand All @@ -67,8 +26,39 @@
}
},
"release": {
"projects": ["*"],
"version": {
"preVersionCommand": "npx nx run-many -t build"
"preVersionCommand": "npx nx run-many -t build",
"conventionalCommits": true
},
"changelog": {
"workspaceChangelog": {
"createRelease": "github",
"renderOptions": {
"authors": false
}
}
},
"conventionalCommits": {
"types": {
"refactor": {
"semverBump": "patch",
"title": "Refactoring"
}
}
}
},
"plugins": [
{
"plugin": "@nx/eslint/plugin",
"options": {
"targetName": "lint"
}
}
],
"pluginsConfig": {
"@nx/js": {
"analyzeSourceFiles": true
}
}
}
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ditto-sdk/source",
"version": "0.0.0",
"name": "ditto-sdk-monorepo",
"version": "0.1.0",
"license": "MIT",
"scripts": {
"nx": "nx",
Expand Down Expand Up @@ -69,7 +69,7 @@
"vite": "~5.0.0",
"vite-plugin-dts": "~2.3.0",
"vitest": "^1.3.1",
"@ditto-network/core": "file:packages/core",
"@ditto-network/core": "0.4.0",
"@ditto-network/ethers": "file:packages/ethers",
"@ditto-network/web3.js": "file:packages/web3js",
"web3": "4.8.0"
Expand All @@ -82,6 +82,9 @@
"path": "@commitlint/cz-commitlint"
}
},
"workspaces": [
"packages/*"
],
"nx": {
"includedScripts": []
}
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ditto-network/core",
"version": "0.0.4",
"version": "0.1.0",
"files": [
"src"
],
Expand All @@ -11,7 +11,7 @@
"ethers": "6.11.1",
"ethers5": "npm:[email protected]",
"fetch-ponyfill": "7.1.0",
"rambda": "9.2.0"
"rambda": "^9.2.0"
},
"type": "commonjs",
"main": "./src/index.js",
Expand Down
19 changes: 16 additions & 3 deletions packages/core/project.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
{
"name": "ditto-sdk",
"name": "core",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/core/src",
"projectType": "library",
"release": {
"version": {
"generatorOptions": {
"packageRoot": "dist/{projectRoot}",
"currentVersionResolver": "git-tag"
}
}
},
"targets": {
"nx-release-publish": {
"options": {
"packageRoot": "dist/{projectRoot}"
}
},
"prepare-prod-config": {
"command": "mv ./dist/ditto-sdk/src/lib/config/config.prod.js ./dist/ditto-sdk/src/lib/config/config.js",
"command": "mv dist/packages/core/src/lib/config/config.prod.js dist/packages/core/src/lib/config/config.js",
"dependsOn": ["compile"]
},
"compile": {
"executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/ditto-sdk",
"outputPath": "dist/packages/core",
"main": "packages/core/src/index.ts",
"tsConfig": "packages/core/tsconfig.lib.json",
"assets": ["packages/core/*.md"]
Expand Down
2 changes: 1 addition & 1 deletion project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@ditto-sdk/source",
"name": "ditto-sdk-monorepo",
"$schema": "node_modules/nx/schemas/project-schema.json",
"targets": {
"local-registry": {
Expand Down

0 comments on commit 55c1fc8

Please sign in to comment.