@diplodoc/lint 1.14.0 → 1.14.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diplodoc/lint",
3
- "version": "1.14.0",
3
+ "version": "1.14.2",
4
4
  "description": "Diplodoc platform internal utility set for linting",
5
5
  "bin": {
6
6
  "lint": "./bin/lint.js",
@@ -37,7 +37,7 @@ jobs:
37
37
 
38
38
  - name: Install latest npm (>= 11.5.1)
39
39
  run: |
40
- [ "$(printf '%s\n' "11.5.1" "$(npm -v)" | sort -V | head -n1)" = "11.5.1" ] || npm install -g npm@latest
40
+ [ "$(printf '%s\n' "11.5.1" "$(npm -v)" | sort -V | head -n1)" = "11.5.1" ] || npm install -g npm@11.5.1
41
41
  shell: bash
42
42
 
43
43
  - name: Install dependencies
@@ -33,7 +33,7 @@ jobs:
33
33
 
34
34
  - name: Install latest npm (>= 11.5.1)
35
35
  run: |
36
- [ "$(printf '%s\n' "11.5.1" "$(npm -v)" | sort -V | head -n1)" = "11.5.1" ] || npm install -g npm@latest
36
+ [ "$(printf '%s\n' "11.5.1" "$(npm -v)" | sort -V | head -n1)" = "11.5.1" ] || npm install -g npm@11.5.1
37
37
  shell: bash
38
38
 
39
39
  - name: Regenerate package-lock.json
@@ -3,11 +3,12 @@
3
3
  # To modify this workflow, edit it in diplodoc/devops/lint/scaffolding/.github/workflows/
4
4
  # and then run the scaffolding update process.
5
5
 
6
- name: Release to npm
6
+ name: Release Package to npm
7
7
 
8
- # This workflow handles both stable and prerelease publishing to npm
8
+ # This workflow handles stable releases, prereleases, and deprecation:
9
9
  # - Stable: triggered by release event or manual dispatch with 'stable' type
10
10
  # - Prerelease: triggered by manual dispatch with 'prerelease' type (only from non-protected branches)
11
+ # - Deprecate: triggered by manual dispatch with 'deprecate' type (marks a version as deprecated)
11
12
 
12
13
  on:
13
14
  release:
@@ -22,6 +23,19 @@ on:
22
23
  options:
23
24
  - prerelease
24
25
  - stable
26
+ - deprecate
27
+ deprecate_version:
28
+ description: 'Version to deprecate (only for deprecate type)'
29
+ required: false
30
+ type: string
31
+ deprecate_message:
32
+ description: 'Deprecation message (only for deprecate type)'
33
+ required: false
34
+ type: string
35
+ deprecate_new_latest:
36
+ description: 'New latest version (required when deprecating current latest)'
37
+ required: false
38
+ type: string
25
39
 
26
40
  permissions:
27
41
  contents: read
@@ -32,10 +46,12 @@ jobs:
32
46
  name: Publish to npm
33
47
  runs-on: ubuntu-latest
34
48
  # For prerelease - only from non-protected branches
49
+ # For deprecate - always allowed
35
50
  if: |
36
51
  github.event_name == 'release' ||
37
52
  (github.event_name == 'workflow_dispatch' && inputs.release_type == 'stable') ||
38
- (github.event_name == 'workflow_dispatch' && inputs.release_type == 'prerelease' && github.ref_protected != true)
53
+ (github.event_name == 'workflow_dispatch' && inputs.release_type == 'prerelease' && github.ref_protected != true) ||
54
+ (github.event_name == 'workflow_dispatch' && inputs.release_type == 'deprecate')
39
55
  steps:
40
56
  - name: Checkout code
41
57
  uses: actions/checkout@v4
@@ -48,21 +64,28 @@ jobs:
48
64
  node-version: 22
49
65
  registry-url: 'https://registry.npmjs.org'
50
66
 
67
+ - uses: codex-team/action-nodejs-package-info@v1
68
+ id: package
69
+
51
70
  - name: Install latest npm (>= 11.5.1)
52
71
  run: |
53
- [ "$(printf '%s\n' "11.5.1" "$(npm -v)" | sort -V | head -n1)" = "11.5.1" ] || npm install -g npm@latest
72
+ [ "$(printf '%s\n' "11.5.1" "$(npm -v)" | sort -V | head -n1)" = "11.5.1" ] || npm install -g npm@11.5.1
54
73
  shell: bash
55
74
 
56
75
  - name: Install dependencies
76
+ if: inputs.release_type != 'deprecate'
57
77
  run: npm ci
58
78
 
59
79
  - name: Run tests
80
+ if: inputs.release_type != 'deprecate'
60
81
  run: npm test
61
82
 
62
83
  - name: Run type check
84
+ if: inputs.release_type != 'deprecate'
63
85
  run: npm run typecheck
64
86
 
65
87
  - name: Build package
88
+ if: inputs.release_type != 'deprecate'
66
89
  run: npm run build
67
90
 
68
91
  # === STABLE RELEASE STEPS ===
@@ -100,3 +123,41 @@ jobs:
100
123
  run: npm publish --tag $(git branch --show-current) --provenance --access public
101
124
  env:
102
125
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
126
+
127
+ # === DEPRECATE STEPS ===
128
+ - name: Validate deprecate inputs
129
+ if: github.event_name == 'workflow_dispatch' && inputs.release_type == 'deprecate'
130
+ run: |
131
+ if [[ -z "${{ inputs.deprecate_version }}" ]]; then
132
+ echo "::error::deprecate_version is required for deprecate action"
133
+ exit 1
134
+ fi
135
+ if [[ -z "${{ inputs.deprecate_message }}" ]]; then
136
+ echo "::error::deprecate_message is required for deprecate action"
137
+ exit 1
138
+ fi
139
+
140
+ - name: Deprecate version
141
+ if: github.event_name == 'workflow_dispatch' && inputs.release_type == 'deprecate'
142
+ env:
143
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
144
+ run: |
145
+ set -e
146
+
147
+ PACKAGE="${{ steps.package.outputs.name }}"
148
+ LATEST="$(npm view $PACKAGE@latest version 2>/dev/null || echo '')"
149
+ VERSION="${{ inputs.deprecate_version }}"
150
+ MESSAGE="${{ inputs.deprecate_message }}"
151
+ TARGET="$PACKAGE@$VERSION"
152
+
153
+ if [[ "$LATEST" == "$VERSION" ]]; then
154
+ if [[ -z "${{ inputs.deprecate_new_latest }}" ]]; then
155
+ echo "::error::deprecate_new_latest is required when deprecating the current latest version ($LATEST)"
156
+ exit 1
157
+ fi
158
+ echo "::notice::Setting new latest tag to $PACKAGE@${{ inputs.deprecate_new_latest }}"
159
+ npm dist-tag add "$PACKAGE@${{ inputs.deprecate_new_latest }}" latest
160
+ fi
161
+
162
+ echo "::notice::Deprecating $TARGET. Reason: $MESSAGE"
163
+ npm deprecate "$TARGET" "$MESSAGE"
@@ -30,7 +30,7 @@ jobs:
30
30
 
31
31
  - name: Install latest npm (>= 11.5.1)
32
32
  run: |
33
- [ "$(printf '%s\n' "11.5.1" "$(npm -v)" | sort -V | head -n1)" = "11.5.1" ] || npm install -g npm@latest
33
+ [ "$(printf '%s\n' "11.5.1" "$(npm -v)" | sort -V | head -n1)" = "11.5.1" ] || npm install -g npm@11.5.1
34
34
  shell: bash
35
35
 
36
36
  - name: Install dependencies
@@ -38,7 +38,7 @@ jobs:
38
38
 
39
39
  - name: Install latest npm (>= 11.5.1)
40
40
  run: |
41
- [ "$(printf '%s\n' "11.5.1" "$(npm -v)" | sort -V | head -n1)" = "11.5.1" ] || npm install -g npm@latest
41
+ [ "$(printf '%s\n' "11.5.1" "$(npm -v)" | sort -V | head -n1)" = "11.5.1" ] || npm install -g npm@11.5.1
42
42
  shell: bash
43
43
 
44
44
  - name: Install dependencies
@@ -9,8 +9,42 @@ on:
9
9
  workflow_dispatch:
10
10
  inputs:
11
11
  package:
12
- description: 'Package name to update'
13
- required: true
12
+ description: 'Package name to update (single selection)'
13
+ required: false
14
+ type: choice
15
+ options:
16
+ # === packages ===
17
+ - '@diplodoc/client'
18
+ - '@diplodoc/components'
19
+ - '@diplodoc/directive'
20
+ - '@diplodoc/liquid'
21
+ - '@diplodoc/sentenizer'
22
+ - '@diplodoc/transform'
23
+ - '@diplodoc/translation'
24
+ - '@diplodoc/utils'
25
+ - '@diplodoc/yfmlint'
26
+ # === extensions ===
27
+ - '@diplodoc/algolia-extension'
28
+ - '@diplodoc/color-extension'
29
+ - '@diplodoc/cut-extension'
30
+ - '@diplodoc/file-extension'
31
+ - '@diplodoc/folding-headings-extension'
32
+ - '@diplodoc/html-extension'
33
+ - '@diplodoc/latex-extension'
34
+ - '@diplodoc/mermaid-extension'
35
+ - '@diplodoc/openapi-extension'
36
+ - '@diplodoc/page-constructor-extension'
37
+ - '@diplodoc/quote-link-extension'
38
+ - '@diplodoc/search-extension'
39
+ - '@diplodoc/tabs-extension'
40
+ update_as_dev:
41
+ description: 'Update as devDependency (only for single package selection)'
42
+ required: false
43
+ type: boolean
44
+ default: false
45
+ packages:
46
+ description: 'Package names to update (comma-separated, e.g., "@diplodoc/transform,dev:@diplodoc/client"). Use "dev:" prefix for devDependencies. If empty, uses single package selection above.'
47
+ required: false
14
48
  type: string
15
49
  version:
16
50
  description: 'Package version (use "latest" for latest version)'
@@ -41,14 +75,54 @@ jobs:
41
75
 
42
76
  - name: Install latest npm (>= 11.5.1)
43
77
  run: |
44
- [ "$(printf '%s\n' "11.5.1" "$(npm -v)" | sort -V | head -n1)" = "11.5.1" ] || npm install -g npm@latest
78
+ [ "$(printf '%s\n' "11.5.1" "$(npm -v)" | sort -V | head -n1)" = "11.5.1" ] || npm install -g npm@11.5.1
45
79
  shell: bash
46
80
 
47
81
  - name: Install dependencies
48
82
  run: npm ci
49
83
 
50
- - name: Update package
51
- run: npm install --no-workspaces ${{ inputs.package }}@${{ inputs.version }}
84
+ - name: Update packages
85
+ run: |
86
+ set -e
87
+
88
+ # Determine which packages to update
89
+ if [[ -n "${{ inputs.packages }}" ]]; then
90
+ # Use multi-selection field with dev: prefix support
91
+ PACKAGES_INPUT="${{ inputs.packages }}"
92
+
93
+ # Parse comma-separated packages
94
+ IFS=',' read -ra PACKAGES <<< "$PACKAGES_INPUT"
95
+
96
+ for PACKAGE_ENTRY in "${PACKAGES[@]}"; do
97
+ # Trim whitespace
98
+ PACKAGE_ENTRY=$(echo "$PACKAGE_ENTRY" | xargs)
99
+
100
+ # Check for dev: prefix
101
+ if [[ "$PACKAGE_ENTRY" == dev:* ]]; then
102
+ PACKAGE="${PACKAGE_ENTRY#dev:}"
103
+ echo "::info::Updating $PACKAGE to ${{ inputs.version }} as devDependency"
104
+ npm install --no-workspaces --save-dev "$PACKAGE@${{ inputs.version }}"
105
+ else
106
+ PACKAGE="$PACKAGE_ENTRY"
107
+ echo "::info::Updating $PACKAGE to ${{ inputs.version }}"
108
+ npm install --no-workspaces "$PACKAGE@${{ inputs.version }}"
109
+ fi
110
+ done
111
+ elif [[ -n "${{ inputs.package }}" ]]; then
112
+ # Use single selection field
113
+ PACKAGE="${{ inputs.package }}"
114
+
115
+ if [[ "${{ inputs.update_as_dev }}" == "true" ]]; then
116
+ echo "::info::Updating $PACKAGE to ${{ inputs.version }} as devDependency"
117
+ npm install --no-workspaces --save-dev "$PACKAGE@${{ inputs.version }}"
118
+ else
119
+ echo "::info::Updating $PACKAGE to ${{ inputs.version }}"
120
+ npm install --no-workspaces "$PACKAGE@${{ inputs.version }}"
121
+ fi
122
+ else
123
+ echo "::error::Either package or packages must be specified"
124
+ exit 1
125
+ fi
52
126
 
53
127
  - name: Regenerate package-lock.json for standalone mode
54
128
  run: npm install --no-workspaces --package-lock-only
@@ -65,20 +139,64 @@ jobs:
65
139
  exit 0
66
140
  fi
67
141
 
68
- # Get actual installed version
69
- VERSION=$(npm explore --no-workspaces ${{ inputs.package }} "node -pe 'require(\"./package.json\").version'" --shell sh)
142
+ # Determine which packages to update
143
+ if [[ -n "${{ inputs.packages }}" ]]; then
144
+ # Use multi-selection field with dev: prefix support
145
+ PACKAGES_INPUT="${{ inputs.packages }}"
146
+
147
+ # Parse comma-separated packages
148
+ IFS=',' read -ra PACKAGES <<< "$PACKAGES_INPUT"
149
+
150
+ # Get actual installed versions for all packages
151
+ VERSIONS=""
152
+ for PACKAGE_ENTRY in "${PACKAGES[@]}"; do
153
+ # Trim whitespace
154
+ PACKAGE_ENTRY=$(echo "$PACKAGE_ENTRY" | xargs)
155
+
156
+ # Check for dev: prefix
157
+ if [[ "$PACKAGE_ENTRY" == dev:* ]]; then
158
+ PACKAGE="${PACKAGE_ENTRY#dev:}"
159
+ DEV_PREFIX="dev:"
160
+ else
161
+ PACKAGE="$PACKAGE_ENTRY"
162
+ DEV_PREFIX=""
163
+ fi
164
+
165
+ VERSION=$(npm explore --no-workspaces "$PACKAGE" "node -pe 'require(\"./package.json\").version'" --shell sh)
166
+ if [[ -n "$VERSIONS" ]]; then
167
+ VERSIONS="$VERSIONS, "
168
+ fi
169
+ VERSIONS="$VERSIONS$DEV_PREFIX$PACKAGE@$VERSION"
170
+ done
171
+ elif [[ -n "${{ inputs.package }}" ]]; then
172
+ # Use single selection field
173
+ PACKAGE="${{ inputs.package }}"
174
+ VERSION=$(npm explore --no-workspaces "$PACKAGE" "node -pe 'require(\"./package.json\").version'" --shell sh)
175
+
176
+ if [[ "${{ inputs.update_as_dev }}" == "true" ]]; then
177
+ VERSIONS="dev:$PACKAGE@$VERSION"
178
+ else
179
+ VERSIONS="$PACKAGE@$VERSION"
180
+ fi
181
+ else
182
+ echo "::error::Either package or packages must be specified"
183
+ exit 1
184
+ fi
70
185
 
71
186
  # Configure git
72
187
  git config --global user.email "95919151+yc-ui-bot@users.noreply.github.com"
73
188
  git config --global user.name "yc-ui-bot"
74
189
 
75
- # Create branch and commit
76
- BRANCH_NAME="ci/update-deps/${{ inputs.package }}-$VERSION"
190
+ # Create branch name (use first package for simplicity)
191
+ # Remove dev: prefix and @ symbol for valid branch name
192
+ FIRST_PACKAGE=$(echo "$PACKAGES_INPUT" | cut -d',' -f1 | xargs)
193
+ FIRST_PACKAGE=$(echo "$FIRST_PACKAGE" | sed 's/^dev://; s/@//g')
194
+ BRANCH_NAME="ci/update-deps/$FIRST_PACKAGE-${{ inputs.version }}"
77
195
  git push -f origin :$BRANCH_NAME || true
78
196
  git checkout -b $BRANCH_NAME
79
197
  git add package.json package-lock.json
80
- git commit -m "fix(deps): Update ${{ inputs.package }} to $VERSION" --no-verify
198
+ git commit -m "fix(deps): Update $VERSIONS" --no-verify
81
199
  git push -u origin $BRANCH_NAME
82
200
 
83
201
  # Create PR
84
- gh pr create --title "fix(deps): Update ${{ inputs.package }} to $VERSION" --body "Automated dependency update" --base master
202
+ gh pr create --title "fix(deps): Update $VERSIONS" --body "Automated dependency update" --base master
package/src/esbuild.mjs CHANGED
@@ -1,4 +1,6 @@
1
1
  export * from 'esbuild';
2
- export * from 'esbuild-sass-plugin';
2
+ export {sassPlugin} from 'esbuild-sass-plugin';
3
3
 
4
- export default require('esbuild');
4
+ import esbuild from 'esbuild';
5
+
6
+ export default esbuild;