@raythurnevoid/svelte-context-enhanced
Advanced tools
Comparing version 1.0.4 to 2.0.0
@@ -1,4 +0,4 @@ | ||
export { createContextStore, createContextWritableStore, createContextDerivedStore, } from "./store.js"; | ||
export { createContext } from "./basic.js"; | ||
export { setContext, getContext } from "./svelte-typed-context.js"; | ||
export type { ContextKey } from "./svelte-typed-context.js"; | ||
import type { ContextKey } from './svelte-typed-context.js'; | ||
export declare function createContext<T>(key?: ContextKey<T>): readonly [(context: T) => T, () => T | undefined]; | ||
export { setContext, getContext } from './svelte-typed-context.js'; | ||
export type { ContextKey } from './svelte-typed-context.js'; |
15
index.js
@@ -1,3 +0,12 @@ | ||
export { createContextStore, createContextWritableStore, createContextDerivedStore, } from "./store.js"; | ||
export { createContext } from "./basic.js"; | ||
export { setContext, getContext } from "./svelte-typed-context.js"; | ||
import { getContext, setContext } from './svelte-typed-context.js'; | ||
export function createContext(key = {}) { | ||
function setContextValue(context) { | ||
setContext(key, context); | ||
return context; | ||
} | ||
function getContextValue() { | ||
return getContext(key); | ||
} | ||
return [setContextValue, getContextValue]; | ||
} | ||
export { setContext, getContext } from './svelte-typed-context.js'; |
{ | ||
"name": "@raythurnevoid/svelte-context-enhanced", | ||
"version": "1.0.4", | ||
"description": "", | ||
"version": "2.0.0", | ||
"description": "Enhances Svelte's Context API with TypeScript type checking for a more robust development experience.", | ||
"scripts": { | ||
"clean-lib": "del-cli lib/*", | ||
"copy:package:cjs": "copyfiles --up 1 cjs/* lib/cjs", | ||
"copy:package": "copyfiles package.json lib", | ||
"copy:src": "copyfiles --up 2 src/lib/**/* lib/src", | ||
"copy:cjs": "copyfiles --up 2 \"src/lib/**/*.!(ts|test)\" lib/cjs", | ||
"copy": "copyfiles --up 2 \"src/lib/**/*.!(ts|test)\" lib", | ||
"tsc": "tsc -p tsconfig.lib.json", | ||
"tsc:cjs": "tsc -p tsconfig.lib.cjs.json", | ||
"build": "npm-run-all --parallel copy:package copy:package:cjs copy copy:cjs copy:src tsc tsc:cjs", | ||
"lib": "npm run clean-lib && npm run build", | ||
"dev": "npm run clean-lib && nodemon --watch src -e ts --exec \"npm run build\"", | ||
"package": "npm run lib && npm publish ./lib", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"dev": "vite dev", | ||
"dev:inspect": "node --inspect-brk ./node_modules/vite/bin/vite.js", | ||
"build": "vite build", | ||
"preview": "vite preview", | ||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", | ||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", | ||
"package": "svelte-kit sync && svelte-package --input src/lib/package && copyfiles ./package.json dist && publint ./dist", | ||
"lint": "prettier --plugin-search-dir . --check .", | ||
"format": "prettier --plugin-search-dir . --write ." | ||
}, | ||
@@ -23,11 +19,24 @@ "type": "module", | ||
".": { | ||
"import": "./index.js", | ||
"require": "./cjs/index.js" | ||
}, | ||
"./package.json": "./package.json", | ||
"./cjs/*": "./cjs/*" | ||
"types": "./index.d.ts", | ||
"import": "./index.js" | ||
} | ||
}, | ||
"browserslist": [ | ||
"> 5%" | ||
"files": [ | ||
"./*" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"workspaces": [ | ||
"./websitev2" | ||
], | ||
"keywords": [ | ||
"svelte", | ||
"svelte context", | ||
"typescript", | ||
"library", | ||
"type checking", | ||
"typing", | ||
"type" | ||
], | ||
"repository": { | ||
@@ -37,9 +46,29 @@ "type": "git", | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/raythurnevoid/svelte-group-components/issues" | ||
}, | ||
"author": "Ray Thurne", | ||
"license": "ISC", | ||
"peerDependencies": { | ||
"svelte": "^3.56.0" | ||
}, | ||
"devDependencies": { | ||
"@raythurnevoid/svelte-template": "^0.3.8", | ||
"nodemon": "^2.0.15" | ||
"@sveltejs/kit": "^1.15.0", | ||
"@sveltejs/package": "^2.0.2", | ||
"@types/node": "^18.15.11", | ||
"copyfiles": "^2.4.1", | ||
"prettier": "^2.8.7", | ||
"prettier-plugin-svelte": "^2.10.0", | ||
"svelte-check": "^3.1.4", | ||
"tslib": "^2.5.0", | ||
"typescript": "^5.0.3", | ||
"vite": "^4.2.1", | ||
"vite-node": "^0.29.8", | ||
"vite-plugin-dts": "^2.1.0", | ||
"cross-env": "^7.0.3", | ||
"publint": "^0.1.11" | ||
}, | ||
"dependencies": { | ||
"svelte": "^3.47.0" | ||
"svelte": "^3.58.0" | ||
} | ||
} |
@@ -9,6 +9,6 @@ /** | ||
} | ||
declare type getContext = <T>(key: ContextKey<T>) => undefined | T; | ||
declare type setContext = <T>(key: ContextKey<T>, context: T) => void; | ||
type getContext = <T>(key: ContextKey<T>) => undefined | T; | ||
type setContext = <T>(key: ContextKey<T>, context: T) => void; | ||
export declare const getContext: getContext; | ||
export declare const setContext: setContext; | ||
export {}; |
@@ -0,0 +0,0 @@ /** |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
0
0
1
3289
2
14
5
35
1
Updatedsvelte@^3.58.0