Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️[RUMF-1517] split scripts utils #2102

Merged
merged 6 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/build/replace-build-env.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const glob = require('glob')
const { printLog, runMain } = require('../lib/utils')
const { printLog, runMain } = require('../lib/execution.utils')
const { modifyFile } = require('../lib/files.utils')
const buildEnv = require('../lib/build-env')

Expand Down
2 changes: 1 addition & 1 deletion scripts/check-licenses.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const fs = require('fs')
const path = require('path')
const readline = require('readline')
const { printLog, printError, runMain } = require('./lib/utils')
const { printLog, printError, runMain } = require('./lib/execution.utils')
const { findBrowserSdkPackageJsonFiles } = require('./lib/files.utils')

const LICENSE_FILE = 'LICENSE-3rdparty.csv'
Expand Down
2 changes: 1 addition & 1 deletion scripts/deploy/deploy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const { printLog, command, runMain } = require('../lib/utils')
const { printLog, command, runMain } = require('../lib/execution.utils')
const {
buildRootUploadPath,
buildDatacenterUploadPath,
Expand Down
2 changes: 1 addition & 1 deletion scripts/deploy/upload-source-maps.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const path = require('path')
const { command, printLog, runMain } = require('../lib/utils')
const { command, printLog, runMain } = require('../lib/execution.utils')
const { SDK_VERSION } = require('../lib/build-env')
const { getTelemetryOrgApiKey } = require('../lib/secrets')
const {
Expand Down
2 changes: 1 addition & 1 deletion scripts/dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const webpack = require('webpack')
const logsConfig = require('../packages/logs/webpack.config')
const rumSlimConfig = require('../packages/rum-slim/webpack.config')
const rumConfig = require('../packages/rum/webpack.config')
const { printLog } = require('./lib/utils')
const { printLog } = require('./lib/execution.utils')

const port = 8080
const app = express()
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate-schema-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const fs = require('fs')
const path = require('path')
const { compileFromFile } = require('json-schema-to-typescript')
const prettier = require('prettier')
const { printLog, runMain } = require('./lib/utils')
const { printLog, runMain } = require('./lib/execution.utils')

const schemasDirectoryPath = path.join(__dirname, '../rum-events-format/schemas')
const prettierConfigPath = path.join(__dirname, '../.prettierrc.yml')
Expand Down
bcaudan marked this conversation as resolved.
Show resolved Hide resolved
File renamed without changes.
2 changes: 1 addition & 1 deletion scripts/lib/files.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const fs = require('fs')
const path = require('path')
const fsPromises = require('fs/promises')

const { command } = require('./utils')
const { command } = require('./execution.utils')

const CI_FILE = '.gitlab-ci.yml'

Expand Down
2 changes: 1 addition & 1 deletion scripts/lib/git.utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const os = require('os')
const fs = require('fs')

const { command } = require('./utils')
const { command } = require('./execution.utils')
const { getGithubDeployKey } = require('./secrets')

function initGitConfig(repository) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/lib/secrets.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { command } = require('./utils')
const { command } = require('./execution.utils')

function getGithubDeployKey() {
return getSecretKey('ci.browser-sdk.github_deploy_key')
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/check-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const fs = require('fs')
const path = require('path')
const { version: releaseVersion } = require('../../lerna.json')
const { printLog, runMain, command } = require('../lib/utils')
const { printLog, runMain, command } = require('../lib/execution.utils')
const { findBrowserSdkPackageJsonFiles } = require('../lib/files.utils')

runMain(() => {
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/generate-changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const readFile = util.promisify(require('fs').readFile)
const emojiNameMap = require('emoji-name-map')

const lernaConfig = require('../../lerna.json')
const { command, spawnCommand, printError, runMain } = require('../lib/utils')
const { command, spawnCommand, printError, runMain } = require('../lib/execution.utils')
const { modifyFile } = require('../lib/files.utils')

const CHANGELOG_FILE = 'CHANGELOG.md'
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/update-peer-dependency-versions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const lernaConfig = require('../../lerna.json')
const { runMain } = require('../lib/utils')
const { runMain } = require('../lib/execution.utils')
const { modifyFile } = require('../lib/files.utils')

// This script updates the peer dependency versions between rum and logs packages to match the new
Expand Down
2 changes: 1 addition & 1 deletion scripts/staging-ci/check-squash-into-staging.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const { command, printLog, printError, runMain } = require('../lib/utils')
const { command, printLog, printError, runMain } = require('../lib/execution.utils')
const { initGitConfig } = require('../lib/git.utils')

const REPOSITORY = process.env.GIT_REPOSITORY
Expand Down
2 changes: 1 addition & 1 deletion scripts/staging-ci/check-staging-merge.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const { command, printLog, printError, runMain } = require('../lib/utils')
const { command, printLog, printError, runMain } = require('../lib/execution.utils')
const { initGitConfig } = require('../lib/git.utils')

const REPOSITORY = process.env.GIT_REPOSITORY
Expand Down
2 changes: 1 addition & 1 deletion scripts/staging-ci/merge-into-staging.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const { command, printLog, printError, runMain } = require('../lib/utils')
const { command, printLog, printError, runMain } = require('../lib/execution.utils')
const { initGitConfig } = require('../lib/git.utils')

const REPOSITORY = process.env.GIT_REPOSITORY
Expand Down
2 changes: 1 addition & 1 deletion scripts/staging-ci/staging-reset.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const fs = require('fs')
const { command, printLog, runMain } = require('../lib/utils')
const { command, printLog, runMain } = require('../lib/execution.utils')
const { CI_FILE, replaceCiFileVariable, readCiFileVariable } = require('../lib/files.utils')
const { initGitConfig } = require('../lib/git.utils')

Expand Down
2 changes: 1 addition & 1 deletion scripts/test/bs-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// after killing it. There might be a better way of prematurely aborting the test command if we need
// to in the future.

const { spawnCommand, printLog, runMain, command, fetch } = require('../lib/utils')
const { spawnCommand, printLog, runMain, command, fetch } = require('../lib/execution.utils')

const AVAILABILITY_CHECK_DELAY = 30_000
const BS_USERNAME = process.env.BS_USERNAME
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/bump-chrome-driver-version.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const fs = require('fs')
const { printLog, printError, runMain, command, fetch } = require('../lib/utils')
const { printLog, printError, runMain, command, fetch } = require('../lib/execution.utils')
const { CI_FILE, replaceCiFileVariable } = require('../lib/files.utils')
const { initGitConfig } = require('../lib/git.utils')
const { getGithubAccessToken } = require('../lib/secrets')
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/export-test-result.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const { command, printLog, runMain } = require('../lib/utils')
const { command, printLog, runMain } = require('../lib/execution.utils')
const { getOrg2ApiKey } = require('../lib/secrets')

/**
Expand Down