-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
3,150 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Tests | ||
|
||
on: [push, pull_request] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
eslint: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [ 18.8.x, 20.x ] | ||
|
||
steps: | ||
- name: Using branch ${{ github.ref }} for repository ${{ github.repository }}. | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Cache dependencies | ||
id: cache-deps | ||
uses: actions/cache@v4 | ||
with: | ||
path: .yarn | ||
key: ${{ runner.OS }}-node-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.OS }}-node-${{ matrix.node-version }}-yarn- | ||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Run lint | ||
run: yarn lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.idea | ||
.vscode | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.idea | ||
.vscode | ||
node_modules | ||
|
||
.gitignore | ||
eslint.config.mjs | ||
tsconfig.json | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { FlatCompat } from '@eslint/eslintrc' | ||
|
||
import { dirname } from 'node:path' | ||
import { fileURLToPath } from 'node:url' | ||
|
||
import globals from 'globals' | ||
import pluginJs from '@eslint/js' | ||
import stylistic from '@stylistic/eslint-plugin' | ||
|
||
const __filename = fileURLToPath(import.meta.url) | ||
const __dirname = dirname(__filename) | ||
|
||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: pluginJs.configs.recommended, | ||
}) | ||
|
||
// noinspection JSUnusedGlobalSymbols | ||
export default [ | ||
{ | ||
languageOptions: { | ||
globals: globals.browser, | ||
parserOptions: { | ||
project: './tsconfig.eslint.json', | ||
}, | ||
}, | ||
}, | ||
stylistic.configs['recommended-flat'], | ||
...compat.extends('standard-with-typescript'), | ||
{ | ||
rules: { | ||
'@stylistic/semi': ['error', 'never'], | ||
'@typescript-eslint/comma-dangle': ['error', { | ||
arrays: 'always-multiline', | ||
exports: 'always-multiline', | ||
functions: 'never', | ||
imports: 'always-multiline', | ||
objects: 'always-multiline', | ||
}], | ||
'@typescript-eslint/naming-convention': 'off', | ||
}, | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"name": "@retailcrm/embed-ui", | ||
"type": "module", | ||
"version": "0.0.0", | ||
"description": "API and components for creating RetailCRM UI extensions", | ||
"main": "index.js", | ||
"repository": "[email protected]:retailcrm/embed-ui.git", | ||
"author": "RetailDriverLLC <[email protected]>", | ||
"license": "MIT", | ||
"contributors": [ | ||
"Kirill Zaytsev <[email protected]>" | ||
], | ||
"scripts": { | ||
"lint": "eslint ." | ||
}, | ||
"dependencies": { | ||
"@remote-ui/core": "^2.2.4", | ||
"@remote-ui/rpc": "^1.4.5" | ||
}, | ||
"devDependencies": { | ||
"@eslint/eslintrc": "^3.0.2", | ||
"@eslint/js": "^9.1.1", | ||
"@stylistic/eslint-plugin": "^1.7.2", | ||
"eslint": "^9.1.1", | ||
"eslint-config-standard-with-typescript": "^43.0.1", | ||
"eslint-plugin-import": "^2.25.2", | ||
"eslint-plugin-n": "^17.3.1", | ||
"eslint-plugin-promise": "^6.1.1", | ||
"globals": "^15.0.0", | ||
"standard-version": "^9.5.0", | ||
"typescript": "^5.4.5", | ||
"typescript-eslint": "^7.7.1" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"allowSyntheticDefaultImports": true, | ||
"baseUrl": "./", | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"importHelpers": true, | ||
"isolatedModules": true, | ||
"jsx": "preserve", | ||
"lib": [ | ||
"esnext", | ||
"dom", | ||
"dom.iterable", | ||
"scripthost" | ||
], | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"paths": { | ||
"@/*": ["./src/*"], | ||
"~types/*": ["./types/*"], | ||
"~tests/*": ["./tests/*"] | ||
}, | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true, | ||
"sourceMap": false, | ||
"strict": true, | ||
"target": "es2016", | ||
"types": [ | ||
"node" | ||
], | ||
"useDefineForClassFields": true | ||
}, | ||
"include": [ | ||
"src/**/*.ts", | ||
"src/**/*.tsx", | ||
"src/**/*.vue", | ||
"src/shims-*.d.ts", | ||
"tests/**/*.ts", | ||
"tests/**/*.vue", | ||
"tests/shims-*.d.ts", | ||
"eslint.config.mjs" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { | ||
AnyFunction, | ||
None, | ||
} from './scaffolding' | ||
|
||
import type { RemoteChannel } from '@remote-ui/core' | ||
import type { Endpoint as RemoteEndpoint } from '@remote-ui/rpc' | ||
|
||
export interface EndpointApi< | ||
PageApi extends Record<string, AnyFunction> = None | ||
> { | ||
run (channel: RemoteChannel, api: PageApi): Promise<void>; | ||
release (): void; | ||
} | ||
|
||
export type Endpoint< | ||
PageApi extends Record<string, AnyFunction> = None | ||
> = RemoteEndpoint<EndpointApi<PageApi>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export type OrderCardMethods = { | ||
getCustomerEmail: () => string | null, | ||
setCustomerEmail: (value: string) => void, | ||
|
||
getCustomerPhone: () => string | null, | ||
setCustomerPhone: (value: string) => void, | ||
|
||
getDeliveryAddress: () => string | null, | ||
setDeliveryAddress: (value: string) => void, | ||
parseDeliveryAddress: () => void, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export type AnyFunction = (...payload: any[]) => unknown | ||
export type None = Record<string, never> |
Oops, something went wrong.