Skip to content

Commit 6be862e

Browse files
Fix NPM broken (#1095)
* set always-auth true * added registry url and release ci on main push for testing * removed main push * renamed to NPM_TOKEN * used YARN_NPM_AUTH_TOKEN * used npm_token * used YARN_NPM_AUTH_TOKEN * added registry-url * tried NODE_AUTH_TOKEN * created .npmrc file * removed .npmrc * check NODE_AUTH_TOKEN available or not * moved the check code on top * checked NPM_TOKEN * tried with NODE_AUTH_TOKEN * Try with NPM instead of YARN * switch to npm * removed install command * fix build issue * fix build issue * done pkg fix * Completely moved to npm from yarn * review comments addressed
1 parent ca64eae commit 6be862e

File tree

8 files changed

+6751
-4259
lines changed

8 files changed

+6751
-4259
lines changed

.github/workflows/CI.yaml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ jobs:
4141

4242
# Run install dependencies
4343
- name: Install dependencies
44-
run: yarn
44+
run: npm ci
4545

4646
# Build extension
4747
- name: Run build
48-
run: yarn build
48+
run: npm run build
4949

5050
- name: Generate SARIF
5151
if: matrix.os == 'ubuntu-latest'
52-
run: yarn lint-ci
52+
run: npm run lint-ci
5353

5454
- name: Upload SARIF file
5555
if: matrix.os == 'ubuntu-latest'
@@ -65,7 +65,7 @@ jobs:
6565
- name: Run Test
6666
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1.0.1
6767
with:
68-
run: yarn coveralls
68+
run: npm run coveralls
6969

7070
# Run Coveralls
7171
- name: Coveralls
@@ -75,11 +75,7 @@ jobs:
7575

7676
- name: Publish
7777
if: ${{ success() && runner.os == 'Linux' && github.event_name == 'push' && github.ref == 'refs/heads/main'}}
78-
run: |
79-
yarn config set npmRegistryServer "https://registry.npmjs.org"
80-
yarn config set npmAlwaysAuth true
81-
yarn config set npmAuthToken ${{ secrets.NPM_TOKEN }}
82-
yarn publish --tag next --no-git-tag-version --prepatch --preid "$(git rev-parse --short HEAD)"
78+
run: npm publish --tag next --no-git-tag-version --prepatch --preid "$(git rev-parse --short HEAD)"
8379
env:
8480
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
8581

.github/workflows/release.yaml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,32 +27,27 @@ jobs:
2727
uses: actions/setup-node@v4
2828
with:
2929
node-version: 20
30-
30+
registry-url: 'https://registry.npmjs.org'
31+
3132
# Run install dependencies
3233
- name: Install dependencies
33-
run: yarn
34+
run: npm ci
3435

3536
# Build extension
3637
- name: Run build
37-
run: yarn build
38+
run: npm run build
3839

3940
# Run tests
4041
- name: Run Test
41-
run: yarn test
42-
43-
# Check dependencies
44-
- name: Run Check-Dependencies
45-
run: yarn check-dependencies
42+
run: npm test
4643

47-
- name: Set Publish Auth
48-
run: |
49-
yarn config set npmRegistryServer "https://registry.npmjs.org"
50-
yarn config set npmAlwaysAuth true
51-
yarn config set npmAuthToken ${{ secrets.NPM_TOKEN }}
44+
# Check Dependencies
45+
- name: Run Check Dependencies
46+
run: npm run check-dependencies
5247

53-
#Publish to npm
48+
# Publish to npm
5449
- name: Publish to npm
55-
run: yarn publish --access public
50+
run: npm publish --access public
5651
env:
5752
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
5853

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ out/server
88
yarn-error.log
99
coverage
1010
lib/
11-
package-lock.json
1211
eslint-result.sarif
12+
yarn.lock

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ WORKDIR /yaml-language-server
44

55
COPY . .
66

7-
RUN yarn install && \
8-
yarn run build
7+
RUN npm install && \
8+
npm run build
99

1010
ENTRYPOINT [ "node", "./out/server/src/server.js" ]
1111
CMD [ "--stdio" ]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,11 @@ This repository only contains the server implementation. Here are some known cli
400400
3. Install the dependencies
401401
```bash
402402
cd yaml-language-server
403-
$ yarn install
403+
$ npm install
404404
```
405405
4. Build the language server
406406
```bash
407-
$ yarn run build
407+
$ npm run build
408408
```
409409
5. The new built server is now located in ./out/server/src/server.js.
410410
```bash

0 commit comments

Comments
 (0)