Skip to content

Commit

Permalink
Merge pull request #296 from forcedotcom/devScripts2024-04-07
Browse files Browse the repository at this point in the history
refactor: devScripts update
  • Loading branch information
svc-cli-bot committed Apr 9, 2024
2 parents 91907d1 + fdf897f commit 525b091
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 94 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,26 @@ jobs:
windows-unit-tests:
needs: yarn-lockfile-check
uses: salesforcecli/github-workflows/.github/workflows/unitTestsWindows.yml@main
compile-everywhere:
needs: [linux-unit-tests]
uses: salesforcecli/github-workflows/.github/workflows/externalCompile.yml@sm/external-compile
strategy:
fail-fast: false
matrix:
externalProjectGitUrl:
- https://github.com/salesforcecli/plugin-auth
- https://github.com/salesforcecli/plugin-data
- https://github.com/salesforcecli/plugin-dev
- https://github.com/salesforcecli/plugin-source
- https://github.com/salesforcecli/plugin-deploy-retrieve
- https://github.com/salesforcecli/plugin-user
- https://github.com/salesforcecli/sf-plugins-core
- https://github.com/forcedotcom/kit
- https://github.com/forcedotcom/sfdx-core
- https://github.com/forcedotcom/source-deploy-retrieve
- https://github.com/forcedotcom/source-tracking
- https://github.com/forcedotcom/ts-sinon
with:
packageName: '@salesforce/ts-types'
externalProjectGitUrl: ${{ matrix.externalProjectGitUrl }}
command: 'yarn build'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"tslib": "^2.6.2"
},
"devDependencies": {
"@salesforce/dev-scripts": "^8.4.2",
"@salesforce/dev-scripts": "^8.5.0",
"eslint-plugin-prefer-arrow": "^1.2.1",
"ts-node": "^10.9.2",
"typescript": "^5.4.4"
Expand Down
8 changes: 4 additions & 4 deletions src/types/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ import { Optional } from './union';
* and values, see the following functions: {@link definiteEntriesOf}, {@link definiteKeysOf}, and
* {@link definiteValuesOf}.
*/
export interface Dictionary<T = unknown> {
export type Dictionary<T = unknown> = {
[key: string]: Optional<T>;
}
};

/**
* An alias for an array of `T` elements, where `T` defaults to `unknown`.
*/
export interface AnyArray<T = unknown> extends Array<T> {}
export type AnyArray<T = unknown> = T[];

/**
* Any object with both a numeric index signature with values of type `T` and a numeric `length`
* property. `T` defaults to `unknown` if unspecified.
*/
export interface AnyArrayLike<T = unknown> extends ArrayLike<T> {}
export type AnyArrayLike<T = unknown> = ArrayLike<T>;
5 changes: 4 additions & 1 deletion src/types/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ export type AnyJson = JsonPrimitive | JsonCollection;
/**
* Any JSON-compatible object.
*/

// leave this as an interface because it requires circular references that type aliases cannot do
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
export interface JsonMap extends Dictionary<AnyJson> {}

/**
* Any JSON-compatible array.
*/
export interface JsonArray extends Array<AnyJson> {}
export type JsonArray = AnyJson[];
2 changes: 1 addition & 1 deletion test/experimental/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class TestClass {
public foo = 'bar';
}

interface Test {
type Test = {
s: string;
b?: boolean;
c?: TestClass;
Expand Down
8 changes: 4 additions & 4 deletions test/narrowing/object.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('object', () => {

it("should allow convenient enumeration of a typed object's keys", () => {
const acc: Array<[string, number]> = [];
interface Point {
type Point = {
x: number;
y: number;
}
Expand All @@ -47,7 +47,7 @@ describe('object', () => {

it("should allow convenient enumeration of a typed object's entries", () => {
const acc: Array<[string, number]> = [];
interface Point {
type Point = {
x: number;
y: number;
}
Expand All @@ -70,7 +70,7 @@ describe('object', () => {

it("should allow convenient enumeration of a typed object's values", () => {
const acc: number[] = [];
interface Point {
type Point = {
x: number;
y: number;
}
Expand All @@ -84,7 +84,7 @@ describe('object', () => {
});

describe('definite *', () => {
interface Obj {
type Obj = {
a: string;
b: Optional<string>;
c: Nullable<string>;
Expand Down
Loading

0 comments on commit 525b091

Please sign in to comment.