@starbeam/shared
Advanced tools
Comparing version 1.2.1 to 1.2.2
# @starbeam/shared | ||
## 1.2.2 | ||
### Patch Changes | ||
- 40844fd: Try to fix the build | ||
## 1.2.1 | ||
@@ -4,0 +10,0 @@ |
@@ -7,17 +7,24 @@ /** | ||
* `Symbol.for`. | ||
*/ const UNINITIALIZED = Symbol.for("starbeam.UNINITIALIZED"); | ||
*/ | ||
const UNINITIALIZED = Symbol.for("starbeam.UNINITIALIZED"); | ||
/** | ||
* The `REACTIVE` symbol is the protocol entry point for reactive values. Implementations of | ||
* the `ReactiveProtocol` interface specify their reactive behavior under this symbol. | ||
*/ const REACTIVE = Symbol.for("starbeam.REACTIVE"); | ||
*/ | ||
const REACTIVE = Symbol.for("starbeam.REACTIVE"); | ||
/** | ||
* The `NOW` symbol is the name on `globalThis` that is used to store the current timestamp. | ||
*/ const COORDINATION$1 = Symbol.for("starbeam.COORDINATION"); | ||
*/ | ||
const COORDINATION$1 = Symbol.for("starbeam.COORDINATION"); | ||
function getCoordination() { | ||
let coordination = globalThis[COORDINATION$1]; | ||
if (!coordination) { | ||
globalThis[COORDINATION$1] = coordination = {}; | ||
} | ||
return coordination; | ||
let coordination = globalThis[COORDINATION$1]; | ||
if (!coordination) { | ||
globalThis[COORDINATION$1] = coordination = {}; | ||
} | ||
return coordination; | ||
} | ||
@@ -31,16 +38,23 @@ | ||
* context, which is their primary purpose. | ||
*/ let idGenerator = COORDINATION.id; | ||
*/ | ||
let idGenerator = COORDINATION.id; | ||
if (!idGenerator) { | ||
let CURRENT_ID = 1; | ||
idGenerator = COORDINATION.id = { | ||
get () { | ||
return CURRENT_ID++; | ||
} | ||
}; | ||
let CURRENT_ID = 1; | ||
idGenerator = COORDINATION.id = { | ||
get() { | ||
return CURRENT_ID++; | ||
} | ||
}; | ||
} | ||
const ID_GENERATOR = idGenerator; | ||
/** | ||
* Get a fresh unique ID. | ||
*/ function getID() { | ||
return ID_GENERATOR.get(); | ||
*/ | ||
function getID() { | ||
return ID_GENERATOR.get(); | ||
} | ||
@@ -55,20 +69,28 @@ | ||
* each number represents a different moment in time. | ||
*/ const coordination = getCoordination(); | ||
*/ | ||
const coordination = getCoordination(); | ||
let clock = coordination.now; | ||
if (!clock) { | ||
clock = coordination.now = { | ||
timestamp: 0 | ||
}; | ||
clock = coordination.now = { | ||
timestamp: 0 | ||
}; | ||
} | ||
const CLOCK = clock; | ||
/** | ||
* Get the current timestamp. | ||
*/ function now() { | ||
return CLOCK.timestamp; | ||
*/ | ||
function now() { | ||
return CLOCK.timestamp; | ||
} | ||
/** | ||
* Increment the current timestamp, and return the new one. | ||
*/ function bump() { | ||
CLOCK.timestamp = CLOCK.timestamp + 1; | ||
return now(); | ||
*/ | ||
function bump() { | ||
CLOCK.timestamp = CLOCK.timestamp + 1; | ||
return now(); | ||
} | ||
@@ -75,0 +97,0 @@ |
{ | ||
"name": "@starbeam/shared", | ||
"description": "A package that facilitates having multiple copies of Starbeam in a single process that interoperate with each other", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"type": "module", | ||
"main": "dist/index.cjs", | ||
"dependencies": {}, | ||
"devDependencies": {}, | ||
"starbeam:type": "library", | ||
"exports": { | ||
@@ -10,0 +9,0 @@ ".": { |
{ | ||
"private": true, | ||
"name": "@starbeam-tests/peer", | ||
"name": "@starbeam-tests/shared", | ||
"version": "1.0.0", | ||
"type": "module", | ||
"starbeam:type": "tests", | ||
"dependencies": { | ||
"@starbeam/shared": "workspace:^" | ||
}, | ||
"version": null | ||
"publishConfig": { | ||
"main": "dist/index.cjs", | ||
"types": "dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.js", | ||
"default": "./dist/index.cjs" | ||
} | ||
} | ||
} | ||
} |
{ | ||
"extends": "../../.config/tsconfig/tsconfig.-package.json", | ||
"compilerOptions": { | ||
"outDir": "../../dist/packages", | ||
"declaration": true, | ||
"composite": true, | ||
"declarationMap": true, | ||
"declarationDir": "../../dist/types/@starbeam/shared", | ||
"emitDeclarationOnly": true, | ||
"declarationDir": "../../dist/types", | ||
"types": ["../env"] | ||
} | ||
}, | ||
"include": ["index.ts", "src/**/*.ts", "package.json"] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29494
24
382