@harnessio/yaml-editor 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,19 @@
1
+ export interface BlameItem {
2
+ fromLineNumber: number;
3
+ toLineNumber: number;
4
+ commitInfo?: BlameItemCommit;
5
+ }
6
+ export interface BlameItemCommit {
7
+ sha?: string;
8
+ title?: string;
9
+ author?: BlameItemCommitAuthor;
10
+ }
11
+ export interface BlameItemCommitAuthor {
12
+ identity?: {
13
+ name?: string;
14
+ email?: string;
15
+ };
16
+ when: string;
17
+ avatarUrl?: string;
18
+ initials?: string;
19
+ }
@@ -1,4 +1,4 @@
1
- import * as monaco from "monaco-editor";
1
+ import * as monaco from 'monaco-editor';
2
2
  /** Internal structure of OutlineModel */
3
3
  export interface OutlineModelValueInternal {
4
4
  children: Map<string, OutlineModelValueInternal>;
@@ -0,0 +1,13 @@
1
+ import { BlameItem } from '../types/blame';
2
+
3
+ export declare function getMonacoEditorCss({ instanceId, lineNumbersPosition }: {
4
+ instanceId: string;
5
+ lineNumbersPosition: 'left' | 'center';
6
+ }): string;
7
+ export declare function getMonacoEditorCommitCss({ instanceId, blameData, dateWidth, avatarSize }: {
8
+ instanceId: string;
9
+ blameData: BlameItem[];
10
+ dateWidth: number;
11
+ avatarSize: number;
12
+ }): string;
13
+ export declare function createCommitMessage(msg: string, commitMsgLength: number): string;
@@ -1,6 +1,7 @@
1
1
  import { ILanguageFeaturesService } from 'monaco-editor/esm/vs/editor/common/services/languageFeatures.js';
2
2
  import { OutlineModel } from 'monaco-editor/esm/vs/editor/contrib/documentSymbols/browser/outlineModel.js';
3
3
  import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
4
+
4
5
  export interface MonacoGlobalsData {
5
6
  ILanguageFeaturesService: typeof ILanguageFeaturesService;
6
7
  OutlineModel: typeof OutlineModel;
@@ -1,4 +1,5 @@
1
1
  import { editor, languages } from 'monaco-editor';
2
2
  import { RootOutlineModelInternal } from '../types/monaco';
3
+
3
4
  export declare function getOutlineModel(model: editor.ITextModel): Promise<RootOutlineModelInternal>;
4
5
  export declare function processOutlineModel(outlineModel: RootOutlineModelInternal): Map<string, languages.DocumentSymbol>;
@@ -1,4 +1,5 @@
1
1
  import { Uri } from 'monaco-editor';
2
- export declare function configureSchema(schemaConfig: any): import("monaco-yaml").MonacoYaml | undefined;
2
+
3
+ export declare function configureSchema(schemaConfig: any): import('monaco-yaml').MonacoYaml | undefined;
3
4
  export declare const schemaIdToUrl: (id: string) => string;
4
5
  export declare const schemaIdToUri: (id: string) => Uri;
@@ -0,0 +1,2 @@
1
+ export declare function createRandomString(length: number): string;
2
+ export declare function escapeSingleQuote(str: string): string;
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "@harnessio/yaml-editor",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "private": false,
5
5
  "author": "Harness Inc.",
6
6
  "license": "Apache-2.0",
7
- "main": "dist/index.js",
8
- "types": "dist/index.d.ts",
7
+ "type": "module",
8
+ "module": "./dist/index.js",
9
+ "main": "./dist/index.js",
9
10
  "files": [
10
11
  "dist"
11
12
  ],
12
- "dependencies": {},
13
+ "types": "./dist/index.d.ts",
13
14
  "peerDependencies": {
14
15
  "@monaco-editor/react": "4.6.0",
15
16
  "monaco-editor": "0.50.0",
@@ -17,14 +18,7 @@
17
18
  "react": "^18.3.1",
18
19
  "react-dom": "^18.3.1"
19
20
  },
20
- "eslintConfig": {
21
- "extends": [
22
- "react-app",
23
- "react-app/jest"
24
- ]
25
- },
26
21
  "devDependencies": {
27
- "watch": "^1.0.2",
28
22
  "@babel/core": "^7.24.7",
29
23
  "@babel/preset-env": "^7.24.7",
30
24
  "@babel/preset-react": "^7.24.7",
@@ -36,6 +30,8 @@
36
30
  "@types/node": "^16.18.101",
37
31
  "@types/react": "^18.3.3",
38
32
  "@types/react-dom": "^18.3.0",
33
+ "@vitejs/plugin-react": "^4.0.4",
34
+ "@vitejs/plugin-react-swc": "^3.5.0",
39
35
  "babel-loader": "^9.1.3",
40
36
  "babel-plugin-syntax-dynamic-import": "^6.18.0",
41
37
  "babel-plugin-transform-class-properties": "^6.24.1",
@@ -43,6 +39,7 @@
43
39
  "css-loader": "^7.1.2",
44
40
  "file-loader": "^6.2.0",
45
41
  "html-webpack-plugin": "^5.6.0",
42
+ "lint-staged": "^15.2.9",
46
43
  "mini-css-extract-plugin": "^2.9.0",
47
44
  "monaco-editor-webpack-plugin": "^7.1.0",
48
45
  "sass-loader": "^14.2.1",
@@ -50,15 +47,29 @@
50
47
  "ts-loader": "^9.5.1",
51
48
  "typescript": "^4.9.5",
52
49
  "url-loader": "^4.1.1",
50
+ "vite": "^4.4.9",
51
+ "vite-plugin-dts": "^3.9.1",
52
+ "vite-plugin-monaco-editor": "^1.1.0",
53
+ "watch": "^1.0.2",
53
54
  "webpack": "^5.92.1",
54
55
  "webpack-cli": "^5.1.4",
55
56
  "webpack-dev-server": "^5.0.4"
56
57
  },
58
+ "lint-staged": {
59
+ "*.{js,jsx,ts,tsx}": [
60
+ "eslint ./src --fix",
61
+ "prettier ./src --write"
62
+ ]
63
+ },
57
64
  "scripts": {
58
65
  "webpack": "webpack",
59
- "build": "pnpm run webpack --config webpack.config.prod.js",
66
+ "build": "vite build",
67
+ "build:ci": "vite build",
60
68
  "watch:build": "watch 'pnpm build-yalc' ./src",
61
69
  "build-yalc": "pnpm build && pnpm yalc-push",
62
- "yalc-push": "yalc push"
70
+ "yalc-push": "yalc push",
71
+ "pretty": "prettier --check ./src",
72
+ "lint": "eslint ./src",
73
+ "pre-commit": "lint-staged"
63
74
  }
64
75
  }
@@ -1,9 +0,0 @@
1
- /**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */
@@ -1,6 +1,6 @@
1
- import * as monaco from 'monaco-editor';
2
- import { PathSelector } from '../types/selectors';
3
1
  import { InlineAction } from '../types/inline-actions';
2
+ import { PathSelector } from '../types/selectors';
3
+ import * as monaco from 'monaco-editor';
4
4
  export interface CommandArg<T> extends Pick<InlineAction<T>, 'onClick' | 'data'> {
5
5
  range: monaco.IRange;
6
6
  symbols: monaco.languages.DocumentSymbol[];