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

Sm/no zip in json #514

Merged
merged 8 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
*/
module.exports = {
extends: ['eslint-config-salesforce-typescript', 'eslint-config-salesforce-license', 'plugin:sf-plugin/recommended'],
rules: {
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
},
};
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
secrets: inherit
strategy:
matrix:
os: [ubuntu-20-8core, windows-2022-16core]
os: [ubuntu-latest, windows-latest]
command:
- 'yarn test:nuts:deploy:metadata:manifest'
- 'yarn test:nuts:deploy:metadata:metadata-dir'
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ docs
package.json.bak.

# -- CLEAN ALL
*.tsbuildinfo
.eslintcache
.wireit
node_modules

# --
Expand Down
174 changes: 137 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@
"author": "Salesforce",
"bugs": "https://github.com/forcedotcom/cli/issues",
"dependencies": {
"@oclif/core": "^2.0.7",
"@salesforce/core": "^3.32.12",
"@salesforce/kit": "^1.8.2",
"@salesforce/sf-plugins-core": "^2.0.1",
"@salesforce/source-deploy-retrieve": "^7.6.0",
"@salesforce/source-tracking": "^2.2.19",
"@oclif/core": "^2.3.1",
"@salesforce/core": "^3.33.5",
"@salesforce/kit": "^1.9.0",
"@salesforce/sf-plugins-core": "^2.2.3",
"@salesforce/source-deploy-retrieve": "^7.10.1",
"@salesforce/source-tracking": "^2.2.22",
"chalk": "^4.1.2",
"fs-extra": "^10.0.1",
"shelljs": "^0.8.5",
"tslib": "^2"
},
"devDependencies": {
"@oclif/plugin-command-snapshot": "^3.2.16",
"@salesforce/cli-plugins-testkit": "^3.2.18",
"@salesforce/cli-plugins-testkit": "^3.2.23",
"@salesforce/dev-config": "^3.1.0",
"@salesforce/dev-scripts": "^3.1.0",
"@salesforce/plugin-command-reference": "^2.2.10",
"@salesforce/plugin-config": "^2.3.0",
"@salesforce/dev-scripts": "^4.1.1",
"@salesforce/plugin-command-reference": "^2.4.1",
"@salesforce/plugin-config": "^2.3.3",
"@salesforce/plugin-functions": "^1.17.4",
"@salesforce/plugin-source": "^2.3.16",
"@salesforce/plugin-templates": "^55.1.0",
"@salesforce/plugin-user": "^2.1.23",
"@salesforce/plugin-source": "^2.5.4",
"@salesforce/plugin-templates": "^55.4.4",
"@salesforce/plugin-user": "^2.3.2",
"@salesforce/prettier-config": "^0.0.2",
"@salesforce/source-testkit": "^2.0.35",
"@salesforce/source-testkit": "^2.0.40",
"@salesforce/ts-sinon": "1.4.4",
"@salesforce/ts-types": "^1.5.20",
"@swc/core": "^1.3.14",
Expand All @@ -48,17 +48,18 @@
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.6.7",
"eslint-plugin-sf-plugin": "^1.8.0",
"eslint-plugin-sf-plugin": "^1.9.2",
"husky": "^7.0.4",
"mocha": "^10.1.0",
"nyc": "^15.1.0",
"oclif": "^3.6.1",
"oclif": "^3.7.0",
"prettier": "^2.7.1",
"pretty-quick": "^3.1.3",
"shx": "0.3.4",
"sinon": "11.1.2",
"ts-node": "^10.9.1",
"typescript": "^4.9.4"
"typescript": "^4.9.5",
"wireit": "^0.9.5"
},
"config": {},
"engines": {
Expand Down Expand Up @@ -119,35 +120,134 @@
},
"repository": "salesforcecli/plugin-deploy-retrieve",
"scripts": {
"build": "sf-build",
"build": "wireit",
"clean": "sf-clean",
"clean-all": "sf-clean all",
"clean:lib": "shx rm -rf lib && shx rm -rf coverage && shx rm -rf .nyc_output && shx rm -f oclif.manifest.json",
"compile": "sf-compile",
"compile": "wireit",
"docs": "sf-docs",
"format": "sf-format",
"lint": "sf-lint",
"format": "wireit",
"lint": "wireit",
"postpack": "shx rm -f oclif.manifest.json",
"posttest": "yarn lint && yarn test:deprecation-policy && yarn test:json-schema && yarn test:command-reference",
"prepack": "sf-prepack",
"prepare": "sf-install",
"pretest": "sf-compile-test",
"test": "sf-test",
"test:command-reference": "./bin/dev commandreference:generate --erroronwarnings",
"test:deprecation-policy": "./bin/dev snapshot:compare",
"test:json-schema": "./bin/dev schema:compare",
"test:nuts": "ts-node ./test/nuts/generateNuts.ts && nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0",
"test:nuts:tracking": "nyc mocha \"test/nuts/tracking/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0",
"test:nuts:deploy:metadata:manifest": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.manifest ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0",
"test:nuts:deploy:metadata:metadata-dir": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.metadata-dir ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0",
"test:nuts:deploy:metadata:metadata": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.metadata ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0",
"test:nuts:deploy:metadata:source-dir": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.source-dir ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0",
"test:nuts:deploy:metadata:test-level": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.test-level ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0",
"test:nuts:static": "nyc mocha \"test/commands/**/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0",
"test": "wireit",
"test:nuts": "ts-node ./test/nuts/generateNuts.ts && nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 10",
"test:nuts:deploy:metadata:manifest": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.manifest ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
"test:nuts:deploy:metadata:metadata": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.metadata ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
"test:nuts:deploy:metadata:metadata-dir": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.metadata-dir ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
"test:nuts:deploy:metadata:source-dir": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.source-dir ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
"test:nuts:deploy:metadata:test-level": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.test-level ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
"test:nuts:static": "nyc mocha \"test/commands/**/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
"test:nuts:tracking": "nyc mocha \"test/nuts/tracking/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
"test:only": "wireit",
"version": "oclif readme"
},
"publishConfig": {
"access": "public"
},
"main": "lib/index.js"
}
"main": "lib/index.js",
"wireit": {
"build": {
"dependencies": [
"compile",
"lint"
]
},
"compile": {
"command": "tsc -p . --pretty --incremental",
"files": [
"src/**/*.ts",
"tsconfig.json",
"messages/**"
],
"output": [
"lib/**",
"*.tsbuildinfo"
],
"clean": "if-file-deleted"
},
"format": {
"command": "prettier --write \"+(src|test|schemas)/**/*.+(ts|js|json)|command-snapshot.json\"",
"files": [
"src/**/*.ts",
"test/**/*.ts",
"schemas/**/*.json",
"command-snapshot.json",
".prettier*"
],
"output": []
},
"lint": {
"command": "eslint src test --color --cache --cache-location .eslintcache",
"files": [
"src/**/*.ts",
"test/**/*.ts",
"messages/**",
".eslint*"
],
"output": []
},
"test:compile": {
"command": "tsc -p \"./test\" --pretty",
"files": [
"test/**/*.ts",
"tsconfig.json",
"test/tsconfig.json"
],
"output": []
},
"test": {
"dependencies": [
"test:compile",
"test:only",
"test:command-reference",
"test:deprecation-policy",
"lint",
"test:json-schema"
]
},
"test:only": {
"command": "nyc mocha \"test/**/*.test.ts\"",
"files": [
"test/**/*.ts",
"src/**/*.ts",
"tsconfig.json",
".mocha*",
"test/tsconfig.json",
"!*.nut.ts",
".nycrc"
],
"output": []
},
"test:command-reference": {
"command": "\"./bin/dev\" commandreference:generate --erroronwarnings",
"files": [
"src/**/*.ts",
"messages/**",
"package.json"
],
"output": [
"tmp/root"
]
},
"test:deprecation-policy": {
"command": "\"./bin/dev\" snapshot:compare",
"files": [
"src/**/*.ts"
],
"output": [],
"dependencies": [
"compile"
]
},
"test:json-schema": {
"command": "\"./bin/dev\" schema:compare",
"files": [
"src/**/*.ts",
"schemas"
],
"output": []
}
}
}
6 changes: 1 addition & 5 deletions schemas/retrieve-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,9 @@
"$ref": "#/definitions/RetrieveMessage"
}
]
},
"zipFile": {
"type": "string",
"description": "`base64` encoded string"
}
},
"required": ["done", "fileProperties", "files", "id", "status", "success", "zipFile"]
"required": ["done", "fileProperties", "files", "id", "status", "success"]
},
{
"$ref": "#/definitions/MetadataRetrieveResultJson"
Expand Down
3 changes: 2 additions & 1 deletion src/utils/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,8 @@ export class RetrieveResultFormatter implements Formatter<RetrieveResultJson> {
}

public getJson(): RetrieveResultJson {
return { ...this.result.response, files: this.files };
const { zipFile, ...responseWithoutZip } = this.result.response;
return { ...responseWithoutZip, files: this.files };
}

public async display(): Promise<void> {
Expand Down
4 changes: 3 additions & 1 deletion src/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ export type MetadataRetrieveResultJson = Omit<MetadataApiRetrieveStatus, 'zipFil
files: FileResponse[];
};

export type RetrieveResultJson = (MetadataApiRetrieveStatus & { files: FileResponse[] }) | MetadataRetrieveResultJson;
export type RetrieveResultJson =
| (Omit<MetadataApiRetrieveStatus, 'zipFile'> & { files: FileResponse[] })
| MetadataRetrieveResultJson;

/** validates source component with fullname, type, and xml props */
export const isSourceComponent = (sc: unknown): sc is SourceComponent & { xml: string } =>
Expand Down
Loading