Skip to content

Commit

Permalink
Fix the usage of pegjs in tasks
Browse files Browse the repository at this point in the history
Signed-off-by: Miki <[email protected]>
  • Loading branch information
AMoo-Miki committed Dec 9, 2023
1 parent 805400d commit 9fd2078
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 121 deletions.
3 changes: 1 addition & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ target
# plugin overrides
/src/core/lib/osd_internal_native_observable
/src/legacy/plugin_discovery/plugin_pack/__tests__/fixtures/plugins/broken
/src/plugins/data/common/opensearch_query/kuery/ast/_generated_/**
/src/plugins/vis_type_timeline/public/_generated_/**
/src/plugins/**/_generated_/**

# package overrides
/packages/opensearch-eslint-config-opensearch-dashboards
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { monaco } from '@osd/monaco';
import { Parser } from 'pegjs';

// @ts-ignore
import { parse } from '../_generated_/chain';
import { parse } from '../../common/_generated_/chain';

import { ArgValueSuggestions, FunctionArg, Location } from '../helpers/arg_value_suggestions';
import { ITimelineFunction, TimelineFunctionArgs } from '../../common/types';
Expand Down
22 changes: 20 additions & 2 deletions tasks/config/peg.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,28 @@ module.exports = {
dest: 'src/plugins/data/common/opensearch_query/kuery/ast/_generated_/kuery.js',
options: {
allowedStartRules: ['start', 'Literal'],
wrapper: function (src, parser) {
return (
'/*\n * SPDX-License-Identifier: Apache-2.0\n *\n * The OpenSearch Contributors require contributions made to\n * this file be licensed under the Apache-2.0 license or a\n * compatible open source license.\n *\n * Any modifications Copyright OpenSearch Contributors. See\n * GitHub history for details.\n */\n\n' +
'module.exports = ' +
parser +
';\n'
);
},
},
},
timeline_chain: {
src: 'src/plugins/vis_type_timeline/public/chain.peg',
dest: 'src/plugins/vis_type_timeline/public/_generated_/chain.js',
src: 'src/plugins/vis_type_timeline/common/chain.peg',
dest: 'src/plugins/vis_type_timeline/common/_generated_/chain.js',
options: {
wrapper: function (src, parser) {
return (
'/*\n * SPDX-License-Identifier: Apache-2.0\n *\n * The OpenSearch Contributors require contributions made to\n * this file be licensed under the Apache-2.0 license or a\n * compatible open source license.\n *\n * Any modifications Copyright OpenSearch Contributors. See\n * GitHub history for details.\n */\n\n' +
'module.exports = ' +
parser +
';\n'
);
},
},
},
};
6 changes: 0 additions & 6 deletions tasks/config/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
* under the License.
*/

import { getFunctionalTestGroupRunConfigs } from '../function_test_groups';

const { version } = require('../../package.json');
const OPENSEARCH_DASHBOARDS_INSTALL_DIR =
process.env.OPENSEARCH_DASHBOARDS_INSTALL_DIR ||
Expand Down Expand Up @@ -232,9 +230,5 @@ module.exports = function () {
cmd: YARN,
args: ['run', 'grunt', 'test:projects'],
},

...getFunctionalTestGroupRunConfigs({
opensearchDashboardsInstallDir: OPENSEARCH_DASHBOARDS_INSTALL_DIR,
}),
};
};
110 changes: 0 additions & 110 deletions tasks/function_test_groups.js

This file was deleted.

0 comments on commit 9fd2078

Please sign in to comment.