Skip to content

Commit ca985e6

Browse files
committed
chore: basic viz and protocol setup
1 parent 5569743 commit ca985e6

File tree

15 files changed

+8392
-1205
lines changed

15 files changed

+8392
-1205
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"node": true
77
},
88
"extends": ["eslint:recommended"],
9+
"parserOptions": { "sourceType": "module" },
910
"rules": {
1011
"indent": ["error", 2],
1112
"linebreak-style": ["error", "unix"],

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"test": "turbo run test"
1212
},
1313
"workspaces": [
14-
"packages/*"
14+
"packages/*",
15+
"apps/*"
1516
],
1617
"devDependencies": {
1718
"@types/node": "16.11.43",

packages/protocol/.gitkeep

Whitespace-only changes.

packages/protocol/package.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "@ts-collection/protocol",
3+
"version": "0.0.0",
4+
"main": "src/index.ts",
5+
"types": "src/index.ts",
6+
"repository": "git+https://github.com/always-maap/TS-Collection.git",
7+
"keywords": [
8+
"typescript",
9+
"algorithm",
10+
"data structure",
11+
"collections-typescript"
12+
],
13+
"author": "tur1ng <mohammadali.ap.2000@gmail.com>",
14+
"license": "ISC",
15+
"bugs": {
16+
"url": "https://github.com/always-maap/TS-Collection/issues"
17+
},
18+
"homepage": "https://github.com/always-maap/TS-Collection#readme",
19+
"devDependencies": {
20+
"config": "*"
21+
}
22+
}

packages/protocol/src/Array1D.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export interface Array1D<TData> {
2+
name: string;
3+
version: 1;
4+
renderer: 'Array1D';
5+
code: {
6+
language: string;
7+
source: string;
8+
};
9+
initial: TData[];
10+
actions: Array1DAction[];
11+
}
12+
13+
export type Array1DAction =
14+
| {
15+
type: 'point';
16+
data: number[];
17+
}
18+
| {
19+
type: 'swap';
20+
data: [number, number];
21+
};

packages/protocol/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './Array1D';

packages/protocol/tsconfig.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "config/tsconfig/base.json",
3+
"compilerOptions": {
4+
"declaration": true,
5+
"declarationDir": "dist/types",
6+
"emitDeclarationOnly": true,
7+
8+
"outDir": "dist"
9+
},
10+
"exclude": ["node_modules", "**.test"],
11+
"include": ["./src/**/*.ts"]
12+
}

packages/viz/.gitkeep

Whitespace-only changes.

packages/viz/.storybook/main.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
"stories": [
3+
"../src/**/*.stories.mdx",
4+
"../src/**/*.stories.@(js|jsx|ts|tsx)"
5+
],
6+
"addons": [
7+
"@storybook/addon-links",
8+
"@storybook/addon-essentials",
9+
"@storybook/addon-interactions"
10+
],
11+
"framework": "@storybook/react",
12+
"core": {
13+
"builder": "@storybook/builder-webpack5"
14+
}
15+
}

packages/viz/.storybook/preview.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export const parameters = {
2+
actions: { argTypesRegex: "^on[A-Z].*" },
3+
controls: {
4+
matchers: {
5+
color: /(background|color)$/i,
6+
date: /Date$/,
7+
},
8+
},
9+
}

0 commit comments

Comments
 (0)