Skip to content

Commit

Permalink
feat: remove core from dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mingxuanzhangsfdx committed Jul 30, 2024
1 parent 2e8a285 commit f6829c3
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 715 deletions.
5 changes: 1 addition & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "jsdoc", "eslint-plugin-header"],
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"extends": ["plugin:@typescript-eslint/recommended"],
"rules": {
"ban-ts-ignore": "off",
"@typescript-eslint/ban-ts-ignore": "off",
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"/messages"
],
"dependencies": {
"@salesforce/core": "^8.1.1",
"@salesforce/kit": "^3.1.6",
"ejs": "^3.1.10",
"got": "^11.8.2",
Expand Down Expand Up @@ -85,4 +84,4 @@
"publishConfig": {
"access": "public"
}
}
}
4 changes: 2 additions & 2 deletions src/service/gitRepoUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* See https://github.com/vercel/next.js for more information
*/

import { Global } from '@salesforce/core';
import { CreateUtil } from '../utils';
import * as crypto from 'crypto';
import * as fs from 'fs';
import got from 'got';
Expand Down Expand Up @@ -87,7 +87,7 @@ export function getStoragePathForCustomTemplates(repoUri: URL): string {
.digest('hex');

const customTemplatesPath = path.join(
Global.DIR,
CreateUtil.DIR,
'custom-templates',
folderHash
);
Expand Down
10 changes: 10 additions & 0 deletions src/utils/createUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
*/
import * as fs from 'fs';
import * as path from 'path';
import * as os from 'node:os';
import { nls } from '../i18n';

/* tslint:disable:no-unused-expression */

export class CreateUtil {
private static SFDX_STATE_FOLDER = '.sfdx';

public static checkInputs(flagValue: string): string {
const alphaRegExp = /^\w+$/;

Expand Down Expand Up @@ -75,4 +78,11 @@ export class CreateUtil {
}
return subdirs;
}

/**
* The full system path to the preferred global state folder
*/
public static get DIR(): string {
return path.join(os.homedir(), CreateUtil.SFDX_STATE_FOLDER);
}
}
Loading

0 comments on commit f6829c3

Please sign in to comment.