Skip to content

Commit

Permalink
chore: bump @dcl/eslint-config from 1.0.1 to 1.1.12 (#967)
Browse files Browse the repository at this point in the history
* chore: bump @dcl/eslint-config from 1.0.1 to 1.1.12

Bumps [@dcl/eslint-config](https://github.com/decentraland/eslint-config-decentraland) from 1.0.1 to 1.1.12.
- [Release notes](https://github.com/decentraland/eslint-config-decentraland/releases)
- [Commits](decentraland/eslint-config@1.0.1...1.1.12)

---
updated-dependencies:
- dependency-name: "@dcl/eslint-config"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix linting

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mariano Goldman <[email protected]>
Co-authored-by: Mariano Goldman <[email protected]>
  • Loading branch information
3 people authored Mar 27, 2024
1 parent 83893bd commit ca4e4e1
Show file tree
Hide file tree
Showing 73 changed files with 3,284 additions and 2,396 deletions.
3,524 changes: 2,770 additions & 754 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"license": "Apache-2.0",
"homepage": "https://github.com/decentraland/cli",
"devDependencies": {
"@dcl/eslint-config": "^1.0.1",
"@dcl/eslint-config": "^1.1.12",
"@types/analytics-node": "^3.1.8",
"@types/archiver": "^5.3.1",
"@types/chalk": "^2.2.0",
Expand Down
17 changes: 4 additions & 13 deletions src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,9 @@ export async function main(): Promise<number> {

if (needDependencies && !skipInstall) {
if (online) {
await installDependencies(
project.getProjectWorkingDir(),
false /* silent */
)
await installDependencies(project.getProjectWorkingDir(), false /* silent */)
} else {
fail(
'This project can not start as you are offline and dependencies need to be installed.'
)
fail('This project can not start as you are offline and dependencies need to be installed.')
}
}

Expand Down Expand Up @@ -90,13 +85,9 @@ export async function main(): Promise<number> {
}

if (errors.length) {
const projectList = errors
.map((item) => item.project.getProjectWorkingDir())
.join('\n\t')
const projectList = errors.map((item) => item.project.getProjectWorkingDir()).join('\n\t')

throw new Error(
`Error compiling (see logs above) the scenes: \n\t${projectList}`
)
throw new Error(`Error compiling (see logs above) the scenes: \n\t${projectList}`)
}

if (dcl.workspace.isSingleProject()) {
Expand Down
16 changes: 3 additions & 13 deletions src/commands/coords.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ import { Scene, sdk } from '@dcl/schemas'
import chalk from 'chalk'

import { fail, ErrorType } from '../utils/errors'
import {
getObject,
isValid,
getString,
Coords
} from '../utils/coordinateHelpers'
import { getObject, isValid, getString, Coords } from '../utils/coordinateHelpers'
import { getSceneFile, setSceneFile } from '../sceneJson'
import * as spinner from '../utils/spinner'
import { createWorkspace } from '../lib/Workspace'
Expand Down Expand Up @@ -38,20 +33,15 @@ export function help() {
export async function main() {
spinner.create('Generating coords')

const parcels = process.argv.slice(
process.argv.findIndex((arg) => arg === 'coords') + 1
)
const parcels = process.argv.slice(process.argv.findIndex((arg) => arg === 'coords') + 1)
const workingDir = process.cwd()

const workspace = createWorkspace({ workingDir })
const project = workspace.getSingleProject()
if (project === null) {
fail(ErrorType.INFO_ERROR, `Can not change a coords of workspace.`)
} else if (project.getInfo().sceneType !== sdk.ProjectType.SCENE) {
fail(
ErrorType.INFO_ERROR,
'Only parcel scenes can be edited the coords property.'
)
fail(ErrorType.INFO_ERROR, 'Only parcel scenes can be edited the coords property.')
}

if (!parcels || !parcels.length) {
Expand Down
61 changes: 17 additions & 44 deletions src/commands/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import arg from 'arg'
import chalk from 'chalk'
import {
DeploymentBuilder,
ContentClient,
createCatalystClient,
createContentClient
} from 'dcl-catalyst-client'
import { DeploymentBuilder, ContentClient, createCatalystClient, createContentClient } from 'dcl-catalyst-client'
import { getCatalystServersFromCache } from 'dcl-catalyst-client/dist/contracts-snapshots'
import { Authenticator } from '@dcl/crypto'
import { ChainId, EntityType, getChainName } from '@dcl/schemas'
Expand Down Expand Up @@ -79,21 +74,17 @@ export async function main(): Promise<void> {
Analytics.sceneStartDeploy()

if (args['--target'] && args['--target-content']) {
throw new Error(
`You can't set both the 'target' and 'target-content' arguments.`
)
throw new Error(`You can't set both the 'target' and 'target-content' arguments.`)
}

const workDir = process.cwd()
const skipVersionCheck = args['--skip-version-checks']
const skipBuild = args['--skip-build']
const skipFileSizeCheck =
!!args['--skip-file-size-check'] && !!args['--target-content']
const skipFileSizeCheck = !!args['--skip-file-size-check'] && !!args['--target-content']
const noBrowser = args['--no-browser']
const port = args['--port']
const parsedPort = typeof port === 'string' ? parseInt(port, 10) : void 0
const linkerPort =
parsedPort && Number.isInteger(parsedPort) ? parsedPort : void 0
const linkerPort = parsedPort && Number.isInteger(parsedPort) ? parsedPort : void 0

spinner.create('Creating deployment structure')

Expand All @@ -103,10 +94,7 @@ export async function main(): Promise<void> {
forceDeploy: args['--force-upload'],
yes: args['--yes'],
// validations are skipped for custom content servers
skipValidations:
!!args['--skip-validations'] ||
!!args['--target'] ||
!!args['--target-content'],
skipValidations: !!args['--skip-validations'] || !!args['--target'] || !!args['--target-content'],
linkerPort
})

Expand All @@ -124,9 +112,7 @@ export async function main(): Promise<void> {
spinner.create('Building scene in production mode')

if (!(await isTypescriptProject(workDir))) {
failWithSpinner(
`Please make sure that your project has a 'tsconfig.json' file.`
)
failWithSpinner(`Please make sure that your project has a 'tsconfig.json' file.`)
}

if (!skipBuild) {
Expand All @@ -149,10 +135,8 @@ export async function main(): Promise<void> {
spinner.create('Creating deployment structure')

// Obtain list of files to deploy
const originalFilesToIgnore =
(await project.getDCLIgnore()) ?? (await project.writeDclIgnore())
const filesToIgnorePlusEntityJson =
originalFilesToIgnore.concat('\n entity.json')
const originalFilesToIgnore = (await project.getDCLIgnore()) ?? (await project.writeDclIgnore())
const filesToIgnorePlusEntityJson = originalFilesToIgnore.concat('\n entity.json')

const files: IFile[] = await project.getFiles({
ignoreFiles: filesToIgnorePlusEntityJson,
Expand All @@ -176,9 +160,7 @@ export async function main(): Promise<void> {
validateScene(sceneJson, true)

dcl.on('link:ready', ({ url, params }) => {
console.log(
chalk.bold('You need to sign the content before the deployment:')
)
console.log(chalk.bold('You need to sign the content before the deployment:'))
spinner.create(`Signing app ready at ${url}`)

if (!noBrowser) {
Expand All @@ -191,27 +173,18 @@ export async function main(): Promise<void> {
}, 5000)
}

dcl.on(
'link:success',
({ address, signature, chainId }: LinkerResponse) => {
spinner.succeed(`Content successfully signed.`)
console.log(`${chalk.bold('Address:')} ${address}`)
console.log(`${chalk.bold('Signature:')} ${signature}`)
console.log(`${chalk.bold('Network:')} ${getChainName(chainId!)}`)
}
)
dcl.on('link:success', ({ address, signature, chainId }: LinkerResponse) => {
spinner.succeed(`Content successfully signed.`)
console.log(`${chalk.bold('Address:')} ${address}`)
console.log(`${chalk.bold('Signature:')} ${signature}`)
console.log(`${chalk.bold('Network:')} ${getChainName(chainId!)}`)
})
})

// Signing message
const messageToSign = entityId
const { signature, address, chainId } = await dcl.getAddressAndSignature(
messageToSign
)
const authChain = Authenticator.createSimpleAuthChain(
entityId,
address,
signature
)
const { signature, address, chainId } = await dcl.getAddressAndSignature(messageToSign)
const authChain = Authenticator.createSimpleAuthChain(entityId, address, signature)

// Uploading data
let catalyst: ContentClient | null = null
Expand Down
8 changes: 2 additions & 6 deletions src/commands/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ import chalk from 'chalk'
import { Analytics } from '../utils/analytics'

export const help = () => `
${chalk.bold(
'dcl export'
)} was deprecated in 3.10.0 version of the Decentraland CLI.
${chalk.bold('dcl export')} was deprecated in 3.10.0 version of the Decentraland CLI.
`
export async function main(): Promise<number> {
const link = 'https://docs.decentraland.org/development-guide/deploy-to-now/'
console.warn(
`\`dcl export\` is not being supported in this CLI version. Please visit ${link} to more information`
)
console.warn(`\`dcl export\` is not being supported in this CLI version. Please visit ${link} to more information`)
Analytics.tryToUseDeprecated({ command: 'export' })
return 1
}
21 changes: 5 additions & 16 deletions src/commands/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,20 @@ export const help = () => `
-h, --help Displays complete help
-b, --blockchain Retrieve information directly from the blockchain instead of Decentraland remote API
-n, --network Choose between ${chalk.bold(
'mainnet'
)} and ${chalk.bold('sepolia')} (default 'mainnet')
-n, --network Choose between ${chalk.bold('mainnet')} and ${chalk.bold('sepolia')} (default 'mainnet')
${chalk.dim('Examples:')}
- Get information from the ${chalk.bold('LAND')} located at "${chalk.bold(
'-12, 40'
)}"
- Get information from the ${chalk.bold('LAND')} located at "${chalk.bold('-12, 40')}"
${chalk.green('$ dcl info -12,40')}
- Get information from the ${chalk.bold('estate')} with ID "${chalk.bold(
'5'
)}" directly from blockchain provider
- Get information from the ${chalk.bold('estate')} with ID "${chalk.bold('5')}" directly from blockchain provider
${chalk.green('$ dcl info 5 --blockchain')}
- Get information from the ${chalk.bold(
'address 0x8bed95d830475691c10281f1fea2c0a0fe51304b'
)}"
- Get information from the ${chalk.bold('address 0x8bed95d830475691c10281f1fea2c0a0fe51304b')}"
${chalk.green('$ dcl info 0x8bed95d830475691c10281f1fea2c0a0fe51304b')}
`
Expand Down Expand Up @@ -93,10 +85,7 @@ export async function main() {
spinner.create(chalk.dim(`Fetching information for LAND ${target}`))
const coords = getObject(target)
Analytics.infoCmd({ type: 'coordinates', target: coords })
const [estate, data] = await Promise.all([
dcl.getEstateOfParcel(coords),
dcl.getParcelInfo(coords)
])
const [estate, data] = await Promise.all([dcl.getEstateOfParcel(coords), dcl.getParcelInfo(coords)])
const output = estate ? { ...data, estate } : data
spinner.succeed(`Fetched data for LAND ${chalk.bold(target)}`)
logParcel(output)
Expand Down
4 changes: 1 addition & 3 deletions src/commands/init/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ export const help = () => `
${chalk.dim('Options:')}
-h, --help Displays complete help
-p, --project [type] Choose a projectType (default is scene). It could be any of ${chalk.bold(
getProjectTypes()
)}
-p, --project [type] Choose a projectType (default is scene). It could be any of ${chalk.bold(getProjectTypes())}
${chalk.dim('Examples:')}
Expand Down
9 changes: 3 additions & 6 deletions src/commands/init/repositories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,9 @@ export const repos = {
url: 'https://github.com/decentraland-scenes/lazy-loading/archive/refs/heads/main.zip'
}
],
library:
'https://github.com/decentraland/sdk-library/archive/refs/heads/main.zip',
portableExperience:
'https://github.com/decentraland/portable-experience-sample/archive/refs/heads/main.zip',
smartItem:
'https://github.com/decentraland/smart-item-sample/archive/refs/heads/main.zip'
library: 'https://github.com/decentraland/sdk-library/archive/refs/heads/main.zip',
portableExperience: 'https://github.com/decentraland/portable-experience-sample/archive/refs/heads/main.zip',
smartItem: 'https://github.com/decentraland/smart-item-sample/archive/refs/heads/main.zip'
}

export default repos
5 changes: 1 addition & 4 deletions src/commands/init/scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ export async function sceneOptions(): Promise<InitOption> {
}
}

fail(
ErrorType.INIT_ERROR,
`Couldn't get a valid scene-level choice. Try to select a valid one.`
)
fail(ErrorType.INIT_ERROR, `Couldn't get a valid scene-level choice. Try to select a valid one.`)
return {} as any
}
9 changes: 2 additions & 7 deletions src/commands/init/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ export async function getInitOption(type?: string): Promise<InitOption> {
if (!sdk.ProjectType.validate(type)) {
fail(
ErrorType.INIT_ERROR,
`Invalid projectType: "${chalk.bold(
type
)}". Supported types are ${chalk.bold(getProjectTypes())}`
`Invalid projectType: "${chalk.bold(type)}". Supported types are ${chalk.bold(getProjectTypes())}`
)
}

Expand Down Expand Up @@ -60,10 +58,7 @@ export async function getInitOption(type?: string): Promise<InitOption> {
}
}

fail(
ErrorType.INIT_ERROR,
`Couldn't get a valid first-level choice. Try to select a valid one.`
)
fail(ErrorType.INIT_ERROR, `Couldn't get a valid first-level choice. Try to select a valid one.`)
return {} as any
}

Expand Down
4 changes: 1 addition & 3 deletions src/commands/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ const spawnNpmInstall = (args: any): Promise<void> => {
spinner.fail()
reject(
new Error(
`${chalk.bold(
`npm ${args.join(' ')}`
)} exited with code ${code}. Please try running the command manually`
`${chalk.bold(`npm ${args.join(' ')}`)} exited with code ${code}. Please try running the command manually`
)
)
} else {
Expand Down
18 changes: 4 additions & 14 deletions src/commands/pack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ export async function main(): Promise<number> {
const projectInfo = project.getInfo()

const zipFileName =
projectInfo.sceneType === sdk.ProjectType.PORTABLE_EXPERIENCE
? 'portable-experience.zip'
: 'item.zip'
projectInfo.sceneType === sdk.ProjectType.PORTABLE_EXPERIENCE ? 'portable-experience.zip' : 'item.zip'

try {
if (projectInfo.sceneType === sdk.ProjectType.SMART_ITEM) {
Expand All @@ -50,18 +48,12 @@ export async function main(): Promise<number> {
})
}
} catch (error) {
console.error(
'Could not build the project properly, please check errors.',
error
)
console.error('Could not build the project properly, please check errors.', error)
}

spinner.create('Packing project')

const ignoreFileContent = await fs.readFile(
path.resolve(workingDir, '.dclignore'),
'utf-8'
)
const ignoreFileContent = await fs.readFile(path.resolve(workingDir, '.dclignore'), 'utf-8')
const filePaths = await getProjectFilePaths(workingDir, ignoreFileContent)

let totalSize = 0
Expand All @@ -86,9 +78,7 @@ Please try to remove unneccessary files and/or reduce the files size, you can ig
await packProject(filePaths, packDir)

spinner.succeed(
`Pack successful. Total size: ${
Math.round((totalSize * 100) / 1024 / 1024) / 100
}MB - ${totalSize} bytes`
`Pack successful. Total size: ${Math.round((totalSize * 100) / 1024 / 1024) / 100}MB - ${totalSize} bytes`
)
return 0
}
Loading

0 comments on commit ca4e4e1

Please sign in to comment.