Skip to content

Commit

Permalink
chore: move structured-types to own repo
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Jul 25, 2021
1 parent 781a091 commit d555346
Show file tree
Hide file tree
Showing 270 changed files with 60 additions and 38,531 deletions.
28 changes: 0 additions & 28 deletions .vscode/launch.json
Expand Up @@ -233,20 +233,6 @@
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
},
{
"type": "node",
"request": "launch",
"name": "jest structured-types",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"cwd": "${workspaceFolder}/misc/structured-types",
"args": ["react-function-component"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
},
{
"type": "node",
"request": "launch",
Expand All @@ -261,20 +247,6 @@
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
},
{
"type": "node",
"request": "launch",
"name": "jest typescript-config",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"cwd": "${workspaceFolder}/misc/typescript-config",
"args": ["tsconfig-extends"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
},
{
"type": "node",
"request": "launch",
Expand Down
2 changes: 1 addition & 1 deletion core/config/src/index.ts
Expand Up @@ -63,7 +63,7 @@ export const getConfigurationArg = (
return argv.config;
};

let warningIssued: boolean = false;
let warningIssued = false;
export const loadConfig = (
configPath: string,
): ConfigurationResult | undefined => {
Expand Down
2 changes: 1 addition & 1 deletion core/core/package.json
Expand Up @@ -35,7 +35,7 @@
"@babel/types": "^7.12.6",
"@component-controls/follow-imports": "^3.14.4",
"@component-controls/logger": "^3.10.0",
"@component-controls/typescript-config": "^3.14.4",
"@structured-types/typescript-config": "^3.16.2",
"@storybook/csf": "^0.0.1",
"deepmerge": "^4.2.2",
"escape-html": "^1.0.3",
Expand Down
1 change: 1 addition & 0 deletions core/core/src/components.ts
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { CodeLocation, ImportType, Imports } from './utility';
import { FileInfo } from './files';
import { JestTests } from './jest';
Expand Down
1 change: 1 addition & 0 deletions core/core/src/deepMerge.ts
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import merge from 'deepmerge';

const concatMerge = (dest: any[], src: any[]) => [...dest, ...src];
Expand Down
2 changes: 1 addition & 1 deletion core/core/src/modules.ts
Expand Up @@ -3,7 +3,7 @@ import fs from 'fs';
import * as ts from 'typescript';
import { createHash } from 'crypto';
import { error } from '@component-controls/logger';
import { getTypescriptConfig } from '@component-controls/typescript-config';
import { getTypescriptConfig } from '@structured-types/typescript-config';

/**
* returns the basename stripped of the extension
Expand Down
1 change: 1 addition & 0 deletions core/instrument/src/babel/extract-arguments-usage.ts
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { TraverseOptions } from '@babel/traverse';
import {
Story,
Expand Down
1 change: 1 addition & 0 deletions core/instrument/src/babel/extract-attributes.ts
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import generate from '@babel/generator';

interface StoryAttribute {
Expand Down
1 change: 1 addition & 0 deletions core/instrument/src/babel/extract-function.ts
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { Story, Example } from '@component-controls/core';
import traverse, { NodePath } from '@babel/traverse';
import { FunctionDeclaration, VariableDeclarator } from '@babel/types';
Expand Down
6 changes: 4 additions & 2 deletions core/instrument/src/misc/mdx-exports.ts
Expand Up @@ -3,7 +3,7 @@ import { stringifyObject } from './stringify-object';

const mdxPropertiesExport = (
exportType: MDXExportType,
defObject: object,
defObject: Record<string, unknown>,
): string => {
const obj = { ...defObject, ...(exportType ? exportType.story : {}) };
return stringifyObject(obj);
Expand All @@ -24,7 +24,9 @@ export const extractStoryExports = (
if (exportNames.length) {
let defaultExportCode = '';
if (exports.default) {
const defaults: any = { MDXPage: new String('MDXContent') };
const defaults: Record<string, unknown> = {
MDXPage: new String('MDXContent'),
};
if (storybookExports) {
//docs parameters
defaults.parameters = {
Expand Down
18 changes: 12 additions & 6 deletions core/instrument/src/misc/package-info.ts
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import * as fs from 'fs';
import * as path from 'path';
import readJson from 'read-package-json';
Expand Down Expand Up @@ -31,12 +32,17 @@ const getPackageJson = async (
if (!fileName) {
return resolve(null);
}
readJson(fileName, null, false, (err: string, data: object) => {
if (err) {
return reject(err);
}
return resolve({ fileName, packageJSON: data });
});
readJson(
fileName,
null,
false,
(err: string, data: Record<string, unknown>) => {
if (err) {
return reject(err);
}
return resolve({ fileName, packageJSON: data });
},
);
});
};

Expand Down
7 changes: 2 additions & 5 deletions core/instrument/src/misc/stringify-object.ts
@@ -1,10 +1,7 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import jsStringEscape from 'js-string-escape';

export const stringifyObject = (
val: any,
sep: string = ' ',
depth: number = 1,
): string => {
export const stringifyObject = (val: any, sep = ' ', depth = 1): string => {
switch (typeof val) {
case 'string':
return `"${jsStringEscape(val)}"`;
Expand Down
2 changes: 1 addition & 1 deletion core/store/src/state/recoil/StateRoot.tsx
Expand Up @@ -32,7 +32,7 @@ export interface StateRootProps {
* global options passed from container
* those are global parameters as well as decorators
*/
options?: object;
options?: Record<string, unknown>;
}

export const StateRoot: FC<StateRootProps> = ({
Expand Down
4 changes: 0 additions & 4 deletions examples/structured-types-site/.config/buildtime.js

This file was deleted.

75 changes: 0 additions & 75 deletions examples/structured-types-site/.config/runtime.tsx

This file was deleted.

38 changes: 0 additions & 38 deletions examples/structured-types-site/docs/home-page.mdx

This file was deleted.

2 changes: 0 additions & 2 deletions examples/structured-types-site/next-env.d.ts

This file was deleted.

8 changes: 0 additions & 8 deletions examples/structured-types-site/next.config.js

This file was deleted.

36 changes: 0 additions & 36 deletions examples/structured-types-site/package.json

This file was deleted.

20 changes: 0 additions & 20 deletions examples/structured-types-site/pages/[doctype].tsx

This file was deleted.

20 changes: 0 additions & 20 deletions examples/structured-types-site/pages/[doctype]/[...docid].tsx

This file was deleted.

0 comments on commit d555346

Please sign in to comment.