72 lines
2.7 KiB
JSON
72 lines
2.7 KiB
JSON
{
|
|
"name": "opencode-plugin",
|
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
"projectType": "library",
|
|
"sourceRoot": "libs/opencode-plugin",
|
|
"targets": {
|
|
"format": {
|
|
"executor": "nx:run-commands",
|
|
"options": {
|
|
"command": "cd {projectRoot} && prettier --write \"**/*.{ts,json,md}\" --config ../../.prettierrc"
|
|
}
|
|
},
|
|
"type-check": {
|
|
"executor": "nx:run-commands",
|
|
"options": {
|
|
"command": "tsc --noEmit --project libs/opencode-plugin/tsconfig.json"
|
|
}
|
|
},
|
|
"build": {
|
|
"executor": "@nx/js:tsc",
|
|
"inputs": ["default", "{projectRoot}/package.json", { "dependentTasksOutputFiles": "**/*", "transitive": true }],
|
|
"outputs": ["{options.outputPath}"],
|
|
"options": {
|
|
"outputPath": "dist/libs/opencode-plugin",
|
|
"tsConfig": "{projectRoot}/tsconfig.lib.json",
|
|
"packageJson": "{projectRoot}/package.json",
|
|
"main": "{projectRoot}/.opencode/plugin/index.ts",
|
|
"updateBuildableProjectDepsInPackageJson": true,
|
|
"assets": ["{projectRoot}/README.md", "{projectRoot}/.npmignore"]
|
|
},
|
|
"dependsOn": [
|
|
{
|
|
"target": "build",
|
|
"projects": ["sdk-typescript"]
|
|
},
|
|
"set-version"
|
|
]
|
|
},
|
|
"set-version": {
|
|
"executor": "nx:run-commands",
|
|
"options": {
|
|
"cwd": "{projectRoot}",
|
|
"command": "if [ -n \"$NPM_PKG_VERSION\" ] || [ -n \"$DEFAULT_PACKAGE_VERSION\" ]; then VER=${NPM_PKG_VERSION:-$DEFAULT_PACKAGE_VERSION}; npm version \"$VER\" --allow-same-version && echo \"Changed version to $VER\"; else echo \"Using version from package.json\"; fi"
|
|
},
|
|
"cache": true,
|
|
"inputs": ["{projectRoot}/package.json", { "env": "NPM_PKG_VERSION" }, { "env": "DEFAULT_PACKAGE_VERSION" }],
|
|
"outputs": ["{projectRoot}/package.json"]
|
|
},
|
|
"publish": {
|
|
"executor": "nx:run-commands",
|
|
"options": {
|
|
"cwd": "{workspaceRoot}/dist/libs/opencode-plugin",
|
|
"commands": [
|
|
"npm publish --tag $NPM_TAG --access public --registry https://registry.npmjs.org/ --//registry.npmjs.org/:_authToken=$NPM_TOKEN",
|
|
"node -e \"const fs = require('fs'); const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); pkg.name = '@daytonaio/opencode'; fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2));\"",
|
|
"cp ../../../libs/opencode-plugin/README.legacy.md README.md",
|
|
"npm publish --tag $NPM_TAG --access public --registry https://registry.npmjs.org/ --//registry.npmjs.org/:_authToken=$NPM_TOKEN"
|
|
],
|
|
"parallel": false
|
|
},
|
|
"dependsOn": [
|
|
"build",
|
|
{
|
|
"target": "publish",
|
|
"projects": ["sdk-typescript"]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"tags": []
|
|
}
|