Skip to content

Commit

Permalink
chore: double quotation marks
Browse files Browse the repository at this point in the history
  • Loading branch information
rafbcampos committed Feb 2, 2024
1 parent 75a14db commit 4f48d42
Show file tree
Hide file tree
Showing 214 changed files with 4,852 additions and 5,108 deletions.
8 changes: 1 addition & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ orbs:
executors:
base:
docker:
- image: docker.io/playerui/bazel-docker
- image: docker.io/playerui/bazel-docker:6
working_directory: ~/tools
resource_class: large
environment:
Expand All @@ -35,8 +35,6 @@ commands:
- v1-bazel-cache-core-{{ .Branch }}
- v1-bazel-cache-core-main

- run: pnpm i

- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run: echo -e $GPG_KEY | gpg --import --batch
- run: |
Expand Down Expand Up @@ -78,8 +76,6 @@ jobs:
- attach_workspace:
at: ~/tools

- run: pnpm i

- run: bazel build --config=ci -- //...

- save_cache:
Expand All @@ -98,8 +94,6 @@ jobs:
- attach_workspace:
at: ~/tools

- run: pnpm i

- run: bazel test --config=ci -- //...

- run:
Expand Down
18 changes: 9 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
module.exports = {
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
],
parser: '@typescript-eslint/parser',
ignorePatterns: ['node_modules', 'dist', '__snapshots__'],
plugins: ['@typescript-eslint', 'prettier'],
parser: "@typescript-eslint/parser",
ignorePatterns: ["node_modules", "dist", "__snapshots__"],
plugins: ["@typescript-eslint", "prettier"],
rules: {
'prettier/prettier': 'error',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-empty-function': 'off',
"prettier/prettier": "error",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-function": "off",
},
root: true,
};
3 changes: 0 additions & 3 deletions .prettierrc

This file was deleted.

1 change: 1 addition & 0 deletions cli/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ js_pipeline(
srcs = glob(["src/**/*"]) + [":_manifest"],
test_deps = [
"//:node_modules",
"//:vitest_config",
],
deps = dependencies,
)
3 changes: 0 additions & 3 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,5 @@
"@player-tools/xlr-converters": "workspace:*",
"@player-tools/xlr-sdk": "workspace:*",
"@player-tools/xlr-utils": "workspace:*"
},
"prettier": {
"singleQuote": true
}
}
48 changes: 24 additions & 24 deletions cli/src/__tests__/config.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vi, test, expect } from 'vitest';
import path from 'path';
import { BaseCommand } from '../utils/base-command';
import { vi, test, expect } from "vitest";
import path from "path";
import { BaseCommand } from "../utils/base-command";

test('resolves config correctly', async () => {
test("resolves config correctly", async () => {
vi.setConfig({ testTimeout: 10000 });

const configCallback = vi.fn();
Expand All @@ -13,74 +13,74 @@ test('resolves config correctly', async () => {
}
}

vi.mock('@test-extension', () => {
vi.mock("@test-extension", () => {
return {
default: {
dsl: {
src: 'test-src',
outDir: 'output-directory',
src: "test-src",
outDir: "output-directory",
},
},
};
});

vi.mock('@test-preset-1', () => {
vi.mock("@test-preset-1", () => {
return {
default: {
presets: ['@test-preset-2'],
plugins: ['@test-plugin-2'],
presets: ["@test-preset-2"],
plugins: ["@test-plugin-2"],
},
};
});

vi.mock('@test-preset-2', () => {
vi.mock("@test-preset-2", () => {
return {
default: {
plugins: ['@test-plugin-3'],
plugins: ["@test-plugin-3"],
},
};
});

vi.mock('@test-plugin-1', () => {
vi.mock("@test-plugin-1", () => {
return {
default: {
name: 'test-plugin-1',
name: "test-plugin-1",
},
};
});

vi.mock('@test-plugin-2', () => {
vi.mock("@test-plugin-2", () => {
return {
default: {
name: 'test-plugin-2',
name: "test-plugin-2",
},
};
});

vi.mock('@test-plugin-3', () => {
vi.mock("@test-plugin-3", () => {
return {
default: {
name: 'test-plugin-3',
name: "test-plugin-3",
},
};
});

await ConfigLoader.run([`-c`, `${path.join(__dirname, 'config.test.json')}`]);
await ConfigLoader.run([`-c`, `${path.join(__dirname, "config.test.json")}`]);

expect(configCallback).toBeCalledWith({
dsl: {
src: 'test-src',
outDir: 'output-directory',
src: "test-src",
outDir: "output-directory",
},
plugins: [
{
name: 'test-plugin-3',
name: "test-plugin-3",
},
{
name: 'test-plugin-2',
name: "test-plugin-2",
},
{
name: 'test-plugin-1',
name: "test-plugin-1",
},
],
});
Expand Down
52 changes: 26 additions & 26 deletions cli/src/__tests__/utils/fs.test.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { vi, test, expect, afterEach } from 'vitest';
import path from 'path';
import fs from 'fs';
import { convertToFileGlob } from '../../utils/fs';
import { vi, test, expect, afterEach } from "vitest";
import path from "path";
import fs from "fs";
import { convertToFileGlob } from "../../utils/fs";

vi.mock('path', async (importOriginal) => {
vi.mock("path", async (importOriginal) => {
const original: Record<string, unknown> = await importOriginal();

return {
...original,
sep: '/',
sep: "/",
win32: {
sep: '\\',
sep: "\\",
},
posix: {
sep: '/',
sep: "/",
},
};
});
Expand All @@ -22,36 +22,36 @@ afterEach(() => {
vi.clearAllMocks();
});

test('glob file on posix system for directory', () => {
const fsSpy = vi.spyOn(fs, 'statSync').mockReturnValue({
test("glob file on posix system for directory", () => {
const fsSpy = vi.spyOn(fs, "statSync").mockReturnValue({
isDirectory: () => true,
} as any);
const result = convertToFileGlob(['./src/main/tsx'], '**/*.(tsx|jsx|js|ts)');
expect(result[0]).toStrictEqual('src/main/tsx/**/*.(tsx|jsx|js|ts)');
expect(fsSpy).toHaveBeenCalledWith('./src/main/tsx');
const result = convertToFileGlob(["./src/main/tsx"], "**/*.(tsx|jsx|js|ts)");
expect(result[0]).toStrictEqual("src/main/tsx/**/*.(tsx|jsx|js|ts)");
expect(fsSpy).toHaveBeenCalledWith("./src/main/tsx");
});

test('does not add glob if path is not a directory', () => {
const fsSpy = vi.spyOn(fs, 'statSync').mockReturnValue({
test("does not add glob if path is not a directory", () => {
const fsSpy = vi.spyOn(fs, "statSync").mockReturnValue({
isDirectory: () => false,
} as any);
const result = convertToFileGlob(
['./src/main/tsx/**/*.tsx'],
'**/*.(tsx|jsx|js|ts)'
["./src/main/tsx/**/*.tsx"],
"**/*.(tsx|jsx|js|ts)"
);
expect(result[0]).toStrictEqual('./src/main/tsx/**/*.tsx');
expect(fsSpy).toHaveBeenCalledWith('./src/main/tsx/**/*.tsx');
expect(result[0]).toStrictEqual("./src/main/tsx/**/*.tsx");
expect(fsSpy).toHaveBeenCalledWith("./src/main/tsx/**/*.tsx");
});

test('directory glob handling on windows', () => {
const fsSpy = vi.spyOn(fs, 'statSync').mockReturnValue({
test("directory glob handling on windows", () => {
const fsSpy = vi.spyOn(fs, "statSync").mockReturnValue({
isDirectory: () => true,
} as any);
(path as any).sep = '\\';
(path as any).sep = "\\";
const result = convertToFileGlob(
[['src', 'main', 'tsx'].join('\\')],
'**/*.(tsx|jsx|js|ts)'
[["src", "main", "tsx"].join("\\")],
"**/*.(tsx|jsx|js|ts)"
);
expect(result[0]).toStrictEqual('src\\main\\tsx/**/*.(tsx|jsx|js|ts)');
expect(fsSpy).toHaveBeenCalledWith('src\\main\\tsx');
expect(result[0]).toStrictEqual("src\\main\\tsx/**/*.(tsx|jsx|js|ts)");
expect(fsSpy).toHaveBeenCalledWith("src\\main\\tsx");
});
Loading

0 comments on commit 4f48d42

Please sign in to comment.