Skip to content

Commit

Permalink
[cli] migrate remaining cli scripts to /dist /dev style (#79409)
Browse files Browse the repository at this point in the history
Co-authored-by: spalger <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
3 people authored Oct 5, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 06d8040 commit 3d6f150
Showing 15 changed files with 93 additions and 13 deletions.
3 changes: 1 addition & 2 deletions scripts/kibana_keystore.js
Original file line number Diff line number Diff line change
@@ -17,5 +17,4 @@
* under the License.
*/

require('../src/setup_node_env');
require('../src/cli_keystore');
require('../src/cli_keystore/dev');
3 changes: 1 addition & 2 deletions scripts/kibana_plugin.js
Original file line number Diff line number Diff line change
@@ -17,5 +17,4 @@
* under the License.
*/

require('../src/setup_node_env');
require('../src/cli_plugin/cli');
require('../src/cli_plugin/dev');
3 changes: 1 addition & 2 deletions src/cli/dist.js
Original file line number Diff line number Diff line change
@@ -18,6 +18,5 @@
*/

require('../apm')();
require('../setup_node_env/no_transpilation');
require('core-js/stable');
require('../setup_node_env/dist');
require('./cli');
File renamed without changes.
21 changes: 21 additions & 0 deletions src/cli_keystore/dist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

require('../setup_node_env/dist');
require('./cli_keystore');
File renamed without changes.
21 changes: 21 additions & 0 deletions src/cli_plugin/dist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

require('../setup_node_env/dist');
require('./cli');
2 changes: 1 addition & 1 deletion src/dev/build/tasks/bin/scripts/kibana-keystore
Original file line number Diff line number Diff line change
@@ -26,4 +26,4 @@ if [ -f "${CONFIG_DIR}/node.options" ]; then
KBN_NODE_OPTS="$(grep -v ^# < ${CONFIG_DIR}/node.options | xargs)"
fi
NODE_OPTIONS="$KBN_NODE_OPTS $NODE_OPTIONS" "${NODE}" "${DIR}/src/cli_keystore" "$@"
NODE_OPTIONS="$KBN_NODE_OPTS $NODE_OPTIONS" "${NODE}" "${DIR}/src/cli_keystore/dist" "$@"
2 changes: 1 addition & 1 deletion src/dev/build/tasks/bin/scripts/kibana-keystore.bat
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ IF EXIST "%CONFIG_DIR%\node.options" (
)

TITLE Kibana Keystore
"%NODE%" "%DIR%\src\cli_keystore" %*
"%NODE%" "%DIR%\src\cli_keystore\dist" %*

:finally

2 changes: 1 addition & 1 deletion src/dev/build/tasks/bin/scripts/kibana-plugin
Original file line number Diff line number Diff line change
@@ -26,4 +26,4 @@ if [ -f "${CONFIG_DIR}/node.options" ]; then
KBN_NODE_OPTS="$(grep -v ^# < ${CONFIG_DIR}/node.options | xargs)"
fi
NODE_OPTIONS="--no-warnings $KBN_NODE_OPTS $NODE_OPTIONS" NODE_ENV=production exec "${NODE}" "${DIR}/src/cli_plugin" "$@"
NODE_OPTIONS="--no-warnings $KBN_NODE_OPTS $NODE_OPTIONS" NODE_ENV=production exec "${NODE}" "${DIR}/src/cli_plugin/dist" "$@"
2 changes: 1 addition & 1 deletion src/dev/build/tasks/bin/scripts/kibana-plugin.bat
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ IF EXIST "%CONFIG_DIR%\node.options" (
set "NODE_OPTIONS=--no-warnings %NODE_OPTIONS%"

TITLE Kibana Server
"%NODE%" "%DIR%\src\cli_plugin" %*
"%NODE%" "%DIR%\src\cli_plugin\dist" %*

:finally

2 changes: 1 addition & 1 deletion src/dev/build/tasks/bin/scripts/kibana.bat
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ set "NODE_OPTIONS=--no-warnings --max-http-header-size=65536 %NODE_OPTIONS%"

:: This should run independently as the last instruction
:: as we need NODE_OPTIONS previously set to expand
"%NODE%" "%DIR%\src\cli" %*
"%NODE%" "%DIR%\src\cli\dist" %*

:finally

4 changes: 2 additions & 2 deletions src/dev/build/tasks/copy_source_task.ts
Original file line number Diff line number Diff line change
@@ -38,8 +38,8 @@ export const CopySource: Task = {
'!src/cli/dev.js',
'!src/functional_test_runner/**',
'!src/dev/**',
'!src/setup_node_env/babel_register/index.js',
'!src/setup_node_env/babel_register/register.js',
// this is the dev-only entry
'!src/setup_node_env/index.js',
'!**/public/**/*.{js,ts,tsx,json}',
'typings/**',
'config/kibana.yml',
21 changes: 21 additions & 0 deletions src/setup_node_env/dist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

require('./no_transpilation');
require('./polyfill');
20 changes: 20 additions & 0 deletions src/setup_node_env/polyfill.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

require('core-js/stable');

0 comments on commit 3d6f150

Please sign in to comment.