Skip to content

Commit

Permalink
Use next yaml parser (redhat-developer#341)
Browse files Browse the repository at this point in the history
* Use 'yaml-language-server-parser' insead of 'yaml-ast-parser-custom-tags'

Signed-off-by: Yevhen Vydolob <[email protected]>

* Release with GH Action

Signed-off-by: Yevhen Vydolob <[email protected]>

* Replace 'npm' with 'yarn'

Signed-off-by: Yevhen Vydolob <[email protected]>
  • Loading branch information
evidolob authored Oct 27, 2020
1 parent 17e5a10 commit 45bdfe4
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 33 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This is a basic workflow to help you get started with Actions

name: Release to NPM

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
tags:
- '*'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Set up Node
- name: Use Node 12
uses: actions/setup-node@v1
with:
node-version: 12
registry-url: 'https://registry.npmjs.org'

# Run install dependencies
- name: Install dependencies
run: yarn

# Build extension
- name: Run build
run: yarn build

# Run tests
- name: Run Test
run: yarn test

# Publish to npm
- run: |
yarn check-dependencies
yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"vscode-languageserver-types": "^3.15.1",
"vscode-nls": "^4.1.2",
"vscode-uri": "^2.1.1",
"yaml-ast-parser-custom-tags": "0.0.43"
"yaml-language-server-parser": "next"
},
"devDependencies": {
"@types/chai": "^4.2.12",
Expand Down Expand Up @@ -77,7 +77,8 @@
"build": "yarn clean && yarn lint && yarn compile && yarn build:libs",
"build:libs": "yarn compile:umd && yarn compile:esm",
"compile:umd": "tsc -p ./tsconfig.umd.json",
"compile:esm": "tsc -p ./tsconfig.esm.json"
"compile:esm": "tsc -p ./tsconfig.esm.json",
"check-dependencies": "node ./scripts/check-dependencies.js"
},
"nyc": {
"extension": [
Expand Down
21 changes: 21 additions & 0 deletions scripts/check-dependencies.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Red Hat, Inc. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */

//check package.json do not have dependency with 'next' version

/* eslint-disable @typescript-eslint/no-var-requires */

const exit = require('process').exit;
const dependencies = require('../package.json').dependencies;

for (const dep in dependencies) {
if (Object.prototype.hasOwnProperty.call(dependencies, dep)) {
const version = dependencies[dep];
if (version === 'next') {
console.error(`Dependency ${dep} has "${version}" version, please change it to fixed version`);
exit(1);
}
}
}
2 changes: 1 addition & 1 deletion src/languageservice/parser/recursivelyBuildAst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
ArrayASTNodeImpl,
BooleanASTNodeImpl,
} from './jsonParser07';
import * as Yaml from 'yaml-ast-parser-custom-tags';
import * as Yaml from 'yaml-language-server-parser';
import { ASTNode } from '../jsonASTTypes';
import { parseYamlBoolean } from './scalar-type';

Expand Down
2 changes: 1 addition & 1 deletion src/languageservice/parser/yamlParser07.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();

import * as Yaml from 'yaml-ast-parser-custom-tags';
import * as Yaml from 'yaml-language-server-parser';

import { JSONDocument } from './jsonParser07';
import { YAMLDocDiagnostic, formatErrors, formatWarnings, customTagsToAdditionalOptions } from '../utils/parseUtils';
Expand Down
2 changes: 1 addition & 1 deletion src/languageservice/utils/parseUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Yaml from 'yaml-ast-parser-custom-tags';
import * as Yaml from 'yaml-language-server-parser';
import { Schema, Type } from 'js-yaml';

import { filterInvalidCustomTags } from './arrUtils';
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2345,10 +2345,10 @@ yallist@^2.1.2:
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=

yaml-[email protected]:
version "0.0.43"
resolved "https://registry.yarnpkg.com/yaml-ast-parser-custom-tags/-/yaml-ast-parser-custom-tags-0.0.43.tgz#46968145ce4e24cb03c3312057f0f141b93a7d02"
integrity sha512-R5063FF/JSAN6qXCmylwjt9PcDH6M0ExEme/nJBzLspc6FJDmHHIqM7xh2WfEmsTJqClF79A9VkXjkAqmZw9SQ==
yaml-language-server-parser@next:
version "0.1.1-2b9337f.0"
resolved "https://registry.yarnpkg.com/yaml-language-server-parser/-/yaml-language-server-parser-0.1.1-2b9337f.0.tgz#7d67395157117c1fdbfa1053506eca48f92f5d67"
integrity sha512-EHWndWCG23PlWqQSIElTQoHP2uklvGcZLiq+mqj4CUmrNiLVRRtX5CqhXU0ebOV3h0PeMYrntkiWZ6BcyhgdOg==

yargs-parser@^13.0.0, yargs-parser@^13.1.2:
version "13.1.2"
Expand Down

0 comments on commit 45bdfe4

Please sign in to comment.