Skip to content

Commit 494324c

Browse files
committed
feat: initial commit
0 parents  commit 494324c

23 files changed

+6605
-0
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist/
2+
coverage/

.eslintrc.cjs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* eslint-env node */
2+
3+
require('@geprog/eslint-config/patch/modern-module-resolution');
4+
5+
module.exports = {
6+
extends: ['@geprog', '@geprog/eslint-config/jest'],
7+
8+
env: {
9+
'shared-node-browser': true,
10+
},
11+
12+
parserOptions: {
13+
project: ['./tsconfig.eslint.json'],
14+
tsconfigRootDir: __dirname,
15+
extraFileExtensions: ['.cjs'],
16+
},
17+
};

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
dist
3+
coverage/
4+
junit.xml
5+
*.tgz

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist/
2+
coverage/

.prettierrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
semi: true,
3+
trailingComma: 'all',
4+
singleQuote: true,
5+
printWidth: 120,
6+
tabWidth: 2,
7+
endOfLine: 'lf',
8+
};

jest.config.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { Config } from '@jest/types';
2+
import { pathsToModuleNameMapper } from 'ts-jest/utils';
3+
4+
import { compilerOptions } from './tsconfig.json';
5+
6+
const moduleNameMapper = {
7+
...pathsToModuleNameMapper(compilerOptions.paths, {
8+
prefix: '<rootDir>/' + compilerOptions.baseUrl + '/',
9+
}),
10+
} as Config.InitialOptions['moduleNameMapper'];
11+
12+
const config: Config.InitialOptions = {
13+
preset: 'ts-jest',
14+
roots: ['<rootDir>/test'],
15+
moduleNameMapper,
16+
testEnvironment: 'jest-environment-jsdom',
17+
reporters: ['default', 'jest-junit'],
18+
collectCoverage: true,
19+
coverageReporters: ['json', 'text', 'cobertura'],
20+
setupFilesAfterEnv: ['<rootDir>/test/__setup__/console.ts'],
21+
};
22+
23+
export default config;

package.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"name": "@geprog/use-feathers",
3+
"version": "0.0.1",
4+
"description": "Vue.js compositions for Feathers",
5+
"homepage": "https://geprog.com",
6+
"repository": "github:geprog/use-feathers",
7+
"license": "MIT",
8+
"exports": {
9+
".": {
10+
"import": "./dist/index.esm.js",
11+
"require": "./dist/index.cjs.js"
12+
}
13+
},
14+
"main": "./dist/index.cjs.js",
15+
"module": "./dist/index.esm.js",
16+
"types": "./dist/index.d.ts",
17+
"files": [
18+
"/dist"
19+
],
20+
"scripts": {
21+
"build": "rollup -c rollup.config.js",
22+
"clean": "rm -rf dist/ node_modules/",
23+
"lint": "prettier --check . && eslint --max-warnings 0 .",
24+
"start": "rollup -c rollup.config.js --watch",
25+
"test": "NODE_OPTIONS=--experimental-vm-modules jest --forceExit --detectOpenHandles",
26+
"test:watch": "yarn test --watch"
27+
},
28+
"dependencies": {
29+
"@feathersjs/adapter-commons": "5.0.0-pre.3",
30+
"@feathersjs/feathers": "5.0.0-pre.3",
31+
"sift": "13.5.4",
32+
"vue": "3.0.11"
33+
},
34+
"devDependencies": {
35+
"@geprog/eslint-config": "0.0.1",
36+
"@jest/types": "26.6.2",
37+
"@types/jest": "26.0.23",
38+
"@types/node": "15.12.4",
39+
"@vue/test-utils": "2.0.0-rc.6",
40+
"esbuild": "0.12.9",
41+
"esbuild-register": "2.6.0",
42+
"eslint": "7.29.0",
43+
"jest": "26.6.3",
44+
"jest-junit": "12.2.0",
45+
"prettier": "2.3.1",
46+
"rollup": "2.52.2",
47+
"rollup-plugin-dts": "3.0.2",
48+
"rollup-plugin-typescript2": "0.30.0",
49+
"ts-jest": "26.5.6",
50+
"ts-node": "10.0.0",
51+
"typescript": "4.2.4"
52+
}
53+
}

rollup.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/* eslint-disable no-global-assign */
2+
require('esbuild-register');
3+
module.exports = require('./rollup.config.ts');

rollup.config.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { RollupOptions } from 'rollup';
2+
import dts from 'rollup-plugin-dts';
3+
import typescript from 'rollup-plugin-typescript2';
4+
5+
const configs: RollupOptions[] = [
6+
{
7+
input: 'src/index.ts',
8+
output: [
9+
{
10+
file: 'dist/index.cjs.js',
11+
format: 'cjs',
12+
},
13+
{
14+
file: 'dist/index.esm.js',
15+
format: 'es',
16+
},
17+
],
18+
plugins: [
19+
typescript({
20+
tsconfigOverride: {
21+
compilerOptions: {
22+
declaration: false,
23+
},
24+
},
25+
}),
26+
],
27+
external: ['vue', '@feathersjs/feathers', '@feathersjs/adapter-commons', 'sift'],
28+
},
29+
{
30+
input: 'src/index.ts',
31+
output: {
32+
file: 'dist/index.d.ts',
33+
format: 'es',
34+
},
35+
plugins: [dts()],
36+
external: ['vue', '@feathersjs/feathers', '@feathersjs/adapter-commons', 'sift'],
37+
},
38+
];
39+
40+
export default configs;

src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import useFind, { UseFind, UseFindFunc } from './useFind';
2+
import useGet, { UseGet, UseGetFunc } from './useGet';
3+
import { ServiceModel, ServiceTypes } from './utils';
4+
5+
export { ServiceModel, ServiceTypes, UseFind, useFind, UseFindFunc, UseGet, useGet, UseGetFunc };

0 commit comments

Comments
 (0)