feat: initial structure

This commit is contained in:
Garny 2026-03-31 22:31:16 +05:00
commit 6f361dd723
7 changed files with 3199 additions and 0 deletions

2
.env.exapmle Normal file
View file

@ -0,0 +1,2 @@
YOUTRACK_BASE_URL=YOUTRACK_URL
YOUTRACK_TOKEN=YOUTRACK_TOKEN

32
.gitignore vendored Normal file
View file

@ -0,0 +1,32 @@
# Node.js dependencies
node_modules/
# Environment variables
.env
# Logs
*.log
npm-debug.log*
yarn-debug.log*
# Compiled output
build/
dist/
# Coverage directory
coverage/
.nyc_output/
# Optional caches
.npm/
.eslintcache
# IDE files
.vscode/
.idea/
*.swp
*.swo
# OS files
.DS_Store
Thumbs.db

41
README.md Normal file
View file

@ -0,0 +1,41 @@
# Workflows
YouTrack workflows for Workflows
## Setup
1. Install dependencies: `npm install`
2. Get permanent token from your YouTrack instance (Profile → Authentication → New Token)
3. Create `.env` file with your credentials:
```env
YOUTRACK_BASE_URL=https://your-youtrack-instance.com
YOUTRACK_TOKEN=perm:your-permanent-token-here
```
4. Verify setup: `npx ytw list`
## Usage
- **Add new workflow**: `npx ytw add`
- **Sync workflows**: `npx ytw sync`
- **Push changes**: `npx ytw push`
- **Pull from YouTrack**: `npx ytw pull`
- **Watch for changes**: `npx ytw sync --watch`
## TypeScript Support
Generate YouTrack type definitions for your project:
```bash
npx ytw types
```
This creates TypeScript definitions in the `types` directory that can be used via JSDoc annotations:
```js
/** @import { Issue, Project } from '../types/youtrack' */
```
## Scripts
- `npm run sync` - Sync workflows with YouTrack
- `npm run check` - Lint and type check

22
eslint.config.cjs Normal file
View file

@ -0,0 +1,22 @@
const js = require("@eslint/js")
module.exports = [
js.configs.recommended,
{
files: ["**/*.js"],
languageOptions: {
ecmaVersion: 2022,
sourceType: "commonjs",
globals: {
console: "readonly",
require: "readonly",
},
},
rules: {
"no-var": "error",
"prefer-const": "error",
"no-console": "warn",
"no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
},
},
]

3032
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

35
package.json Normal file
View file

@ -0,0 +1,35 @@
{
"name": "Workflows",
"version": "1.0.0",
"description": "YouTrack workflows for Workflows",
"main": "index.js",
"scripts": {
"sync": "ytw sync",
"check": "ytw lint --type-check"
},
"repository": {
"type": "git",
"url": ""
},
"author": "",
"license": "ISC",
"ytw": {
"linting": {
"enableEslint": true,
"enableTypeCheck": true,
"maxWarnings": 5
},
"typesFolder": "./types"
},
"dependencies": {
"@jetbrains/youtrack-scripting": "^0.2.1",
"@jetbrains/youtrack-scripting-api": "^2022.1.46592"
},
"devDependencies": {
"dotenv": "^17.0.1",
"eslint": "^9.28.0",
"youtrack-workflow-cli": "^1.0.4",
"typescript": "^5.8.3",
"youtrack-workflow-api-types": "^0.2.1"
}
}

35
tsconfig.json Normal file
View file

@ -0,0 +1,35 @@
{
"compilerOptions": {
"checkJs": true,
"allowJs": true,
"target": "es2021",
"module": "commonjs",
"lib": [
"es2021"
],
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"allowSyntheticDefaultImports": true,
"typeRoots": [
"./node_modules/@types",
"./types"
],
"baseUrl": ".",
"paths": {
"@jetbrains/youtrack-scripting-api": [
"node_modules/youtrack-workflow-api-types"
],
"@jetbrains/youtrack-scripting-api/*": [
"node_modules/youtrack-workflow-api-types/*"
]
}
},
"include": [
"**/*.js"
],
"exclude": [
"node_modules"
]
}