Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/wide-eggs-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@journeyapps-labs/carbon-atom-builder-runtime': patch
'@journeyapps-labs/carbon-atom-builder': patch
'@journeyapps-labs/carbon-elements': patch
'@journeyapps-labs/carbon-ui-storm': patch
'@journeyapps-labs/carbon-testing': patch
'@journeyapps-labs/carbon-fibre': patch
'@journeyapps-labs/carbon-copy': patch
'@journeyapps-labs/carbon-core': patch
'@journeyapps-labs/carbon-demo': patch
'@journeyapps-labs/carbon-ui': patch
---

Move to common libs
2 changes: 1 addition & 1 deletion carbon-atom-builder-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@journeyapps-labs/carbon-core": "workspace:^",
"@journeyapps-labs/carbon-copy": "workspace:^",
"@journeyapps-labs/carbon-ui": "workspace:^",
"@journeyapps-labs/carbon-utils": "workspace:^"
"@journeyapps-labs/common-logger": "^1.0.0"
},
"devDependencies": {
"@journeyapps-labs/carbon-testing": "workspace:^",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CarbonAtomSchema, getAttribute, getNodes } from '@journeyapps-labs/carbon-atom-builder';
import { CarbonAtomSchema, getAttribute } from '@journeyapps-labs/carbon-atom-builder';
import { CustomCarbonAtomModel } from './CustomCarbonAtomModel';
import { XMLElement } from '@journeyapps/domparser';
import { PortFactory } from '@journeyapps-labs/carbon-core';
Expand Down
2 changes: 1 addition & 1 deletion carbon-atom-builder-runtime/tests/test1.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
ProgramStartAtom
} from '@journeyapps-labs/carbon-core';
import { CustomCarbonAtomFactory } from '../src/CustomCarbonAtomFactory';
import { Logger, LogLevel } from '@journeyapps-labs/carbon-utils';
import { Logger, LogLevel } from '@journeyapps-labs/common-logger';
import { ColourConsoleLoggerTransport } from '@journeyapps-labs/carbon-testing';
import { CustomCarbonRuntimeAtom } from '../src/CustomCarbonRuntimeAtom';
import { describe, beforeEach, afterEach, it, expect } from 'vitest';
Expand Down
3 changes: 0 additions & 3 deletions carbon-atom-builder-runtime/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
{
"path": "../carbon-atom-builder"
},
{
"path": "../carbon-utils"
},
{
"path": "../carbon-core"
},
Expand Down
1 change: 0 additions & 1 deletion carbon-atom-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"dependencies": {
"@journeyapps-labs/carbon-core": "workspace:^",
"@journeyapps-labs/carbon-copy": "workspace:^",
"@journeyapps-labs/carbon-utils": "workspace:^",
"@journeyapps/core-xml": "^5.0.4",
"@journeyapps/domparser": "^0.4.1"
}
Expand Down
3 changes: 0 additions & 3 deletions carbon-atom-builder/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
"./dist"
],
"references": [
{
"path": "../carbon-utils"
},
{
"path": "../carbon-core"
},
Expand Down
1 change: 0 additions & 1 deletion carbon-copy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"dependencies": {
"@journeyapps-labs/carbon-core": "workspace:^",
"@journeyapps-labs/carbon-testing": "workspace:^",
"@journeyapps-labs/carbon-utils": "workspace:^",
"@journeyapps/core-xml": "^5.0.4",
"@journeyapps/domparser": "^0.4.1",
"lodash": "^4.17.21"
Expand Down
3 changes: 0 additions & 3 deletions carbon-copy/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
{
"path": "../carbon-core"
},
{
"path": "../carbon-utils"
},
{
"path": "../carbon-testing"
}
Expand Down
3 changes: 2 additions & 1 deletion carbon-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
},
"dependencies": {
"@journeyapps-labs/carbon-testing": "workspace:^",
"@journeyapps-labs/carbon-utils": "workspace:^",
"@journeyapps-labs/common-utils": "^1.0.0",
"@journeyapps-labs/common-logger": "^1.0.0",
"lodash": "^4.17.21",
"uuid": "^11.1.0"
},
Expand Down
4 changes: 2 additions & 2 deletions carbon-core/src/core/basic/AtomPort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Atom } from './Atom';
import * as _ from 'lodash';
import { CompileEvent, CompileInterface } from '../program/CompileInterface';
import { CarbonEntity } from '../CarbonEntity';
import { BaseListener, BaseObserver } from '@journeyapps-labs/carbon-utils';
import { BaseObserver } from '@journeyapps-labs/common-utils';

export enum AtomPortType {
IN = 'in',
Expand All @@ -20,7 +20,7 @@ export interface Point {
y: number;
}

export interface AtomPortListener extends BaseListener {
export interface AtomPortListener {
willDelete: () => any;
deleted: () => any;
linkUpdated: () => any;
Expand Down
6 changes: 3 additions & 3 deletions carbon-core/src/core/basic/BaseElement.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Molecule } from './Molecule';
import { BaseListener, BaseObserver } from '@journeyapps-labs/carbon-utils';
import { v4 } from 'uuid';
import { ElementFactory } from './ElementFactory';
import { LockedObserver } from './LockedObserver';

export interface BaseElementListener extends BaseListener {
export interface BaseElementListener {
deleted: () => any;
moleculeUpdated: () => any;
}

export class BaseElement<L extends BaseElementListener = BaseElementListener> extends BaseObserver<L> {
export class BaseElement<L extends BaseElementListener = BaseElementListener> extends LockedObserver<L> {
_id: string;
x: number;
y: number;
Expand Down
23 changes: 23 additions & 0 deletions carbon-core/src/core/basic/LockedObserver.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { BaseObserver } from '@journeyapps-labs/common-utils';

export class LockedObserver<T> extends BaseObserver<T> {
private locked: boolean;

constructor() {
super();
this.locked = false;
}

fireWithoutEvents(cb: () => any) {
this.locked = true;
cb();
this.locked = false;
}

iterateListeners(cb: (listener: Partial<T>) => any) {
if (this.locked) {
return;
}
super.iterateListeners(cb);
}
}
4 changes: 2 additions & 2 deletions carbon-core/src/core/basic/Molecule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { Atom } from './Atom';
import { ParamAtom, ParamAtomFactory } from '../../elements/ParamAtom';
import { OutputAtom, OutputAtomFactory } from '../../elements/OutputAtom';
import { SetVariableAtom, SetVariableAtomFactory } from '../../elements/SetVariableAtom';
import { BaseListener, BaseObserver } from '@journeyapps-labs/carbon-utils';
import { BaseObserver } from '@journeyapps-labs/common-utils';
import { BaseElement } from './BaseElement';
import { AnnotationElement } from '../../elements/annotation/AnnotationElement';

export interface MoleculeListener extends BaseListener {
export interface MoleculeListener {
elementsUpdated: () => any;
}

Expand Down
5 changes: 3 additions & 2 deletions carbon-core/src/core/program/BaseProgram.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { BaseListener, BaseObserver, ConsoleLoggerTransport, Logger, LogLevel } from '@journeyapps-labs/carbon-utils';
import { BaseObserver } from '@journeyapps-labs/common-utils';
import { ConsoleLoggerTransport, Logger, LogLevel } from '@journeyapps-labs/common-logger';
import { Molecule } from '../basic/Molecule';
import { Atom } from '../basic/Atom';
import { ExecutorAtom } from './ExecutorAtom';
import { CompileEvent, CompileResult, CompileResultType } from './CompileInterface';

export interface ProgramListener extends BaseListener {
export interface ProgramListener {
statusChanged: (event: { status: ProgramStatus; error?: Error }) => any;
}

Expand Down
5 changes: 3 additions & 2 deletions carbon-core/src/core/program/ExecutorAtom.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { BaseListener, BaseObserver, Logger } from '@journeyapps-labs/carbon-utils';
import { ExecutorAtomContext } from './ExecutorAtomContext';
import { Atom } from '../basic/Atom';
import { FlowPort } from '../basic/FlowPort';
import { Invocation } from './Invocation';
import { AttributePort } from '../basic/AttributePort';
import { BaseProgram, ProgramStatus } from './BaseProgram';
import { CompileEvent, CompileInterface } from './CompileInterface';
import { BaseObserver } from '@journeyapps-labs/common-utils';
import { Logger } from '@journeyapps-labs/common-logger';

export interface ExecutorAtomListener<T extends ExecutorAtomContext = ExecutorAtomContext> extends BaseListener {
export interface ExecutorAtomListener<T extends ExecutorAtomContext = ExecutorAtomContext> {
contextGenerated: (event: { context: T; invocation: Invocation }) => any;
invocationGenerated: (event: { invocation: Invocation }) => any;
pausedChanged: () => any;
Expand Down
5 changes: 3 additions & 2 deletions carbon-core/src/core/program/ExecutorAtomContext.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { BaseListener, BaseObserver, Logger } from '@journeyapps-labs/carbon-utils';
import { ExecutorAtom } from './ExecutorAtom';
import { FlowPort } from '../basic/FlowPort';
import { Invocation } from './Invocation';
import { AttributePort } from '../basic/AttributePort';
import { v4 } from 'uuid';
import { Program } from './Program';
import { ProgramStatus } from './BaseProgram';
import { BaseObserver } from '@journeyapps-labs/common-utils';
import { Logger } from '@journeyapps-labs/common-logger';

export interface ExecutorAtomContextListener extends BaseListener {
export interface ExecutorAtomContextListener {
started: () => any;
completed: (event: { success: boolean; error?: Error }) => any;
}
Expand Down
2 changes: 1 addition & 1 deletion carbon-core/src/core/program/Program.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { BaseProgram, ProgramStatus } from './BaseProgram';
import { ExecutorAtomContext } from './ExecutorAtomContext';
import { Molecule } from '../basic/Molecule';
import { Logger } from '@journeyapps-labs/carbon-utils';
import { CompileEvent } from './CompileInterface';
import { AtomCompileError } from './AtomCompileError';
import { Logger } from '@journeyapps-labs/common-logger';

export interface ProgramOptions {
logger?: Logger;
Expand Down
4 changes: 2 additions & 2 deletions carbon-core/src/core/properties/AbstractProperty.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BaseListener, BaseObserver } from '@journeyapps-labs/carbon-utils';
import { BaseObserver } from '@journeyapps-labs/common-utils';
import { Atom } from '../basic/Atom';

export interface AbstractPropertyOptions<V> {
Expand All @@ -8,7 +8,7 @@ export interface AbstractPropertyOptions<V> {
value: V;
}

export interface AbstractPropertyListener extends BaseListener {
export interface AbstractPropertyListener {
propertyChanged: () => any;
}

Expand Down
2 changes: 1 addition & 1 deletion carbon-core/tests/test1.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Molecule } from '../src/core/basic/Molecule';
import { ProgramEndAtom } from '../src/elements/ProgramEndAtom';
import { ExecutorAtomContext, Program } from '../src';
import { SimpleTestNumberAtom } from './SimpleTestNumberAtom';
import { Logger, LogLevel } from '@journeyapps-labs/carbon-utils';
import { Logger, LogLevel } from '@journeyapps-labs/common-logger';
import { ColourConsoleLoggerTransport } from '@journeyapps-labs/carbon-testing';
import { describe, beforeEach, afterEach, it, expect } from 'vitest';

Expand Down
3 changes: 0 additions & 3 deletions carbon-core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"./dist"
],
"references": [
{
"path": "../carbon-utils"
},
{
"path": "../carbon-testing"
}
Expand Down
1 change: 0 additions & 1 deletion carbon-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"main": "./dist/index.js",
"typings": "./dist/@types/index",
"scripts": {
"start": "./node_modules/.bin/start-storybook -c stories/.storybook",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
Expand Down
2 changes: 1 addition & 1 deletion carbon-elements/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@journeyapps-labs/carbon-copy": "workspace:^",
"@journeyapps-labs/carbon-core": "workspace:^",
"@journeyapps-labs/carbon-testing": "workspace:^",
"@journeyapps-labs/carbon-utils": "workspace:^",
"@journeyapps-labs/common-logger": "^1.0.0",
"lodash": "^4.17.21",
"luxon": "^3.7.1",
"vitest": "^3.2.4"
Expand Down
2 changes: 1 addition & 1 deletion carbon-elements/tests/math.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '@journeyapps-labs/carbon-core';
import { NumericCondition, NumericConditionAtom } from '../src/math/NumericConditionAtom';
import { NumericConstantAtom } from '../src/constants/NumericConstantAtom';
import { Logger, LogLevel } from '@journeyapps-labs/carbon-utils';
import { Logger, LogLevel } from '@journeyapps-labs/common-logger';
import { ColourConsoleLoggerTransport } from '@journeyapps-labs/carbon-testing';
import { MathMaxAtom, NumericPort } from '../src';
import { describe, beforeEach, afterEach, it, expect } from 'vitest';
Expand Down
3 changes: 0 additions & 3 deletions carbon-elements/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
{
"path": "../carbon-copy"
},
{
"path": "../carbon-utils"
},
{
"path": "../carbon-testing"
}
Expand Down
3 changes: 2 additions & 1 deletion carbon-fibre/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"dependencies": {
"@journeyapps-labs/carbon-core": "workspace:^",
"@journeyapps-labs/carbon-testing": "workspace:^",
"@journeyapps-labs/carbon-utils": "workspace:^"
"@journeyapps-labs/common-utils": "^1.0.0",
"@journeyapps-labs/common-logger": "^1.0.0"
},
"devDependencies": {
"@types/node": "^24.1.0",
Expand Down
2 changes: 1 addition & 1 deletion carbon-fibre/src/RemoteProgram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ProgramEventData, ProgramEvents } from './program-events';
import { BaseProgram, CompileEvent, FlowPort, Invocation, Molecule } from '@journeyapps-labs/carbon-core';
import { RemoteExecutorAtom } from './RemoteExecutorAtom';
import { RemoteExecutorAtomContext } from './RemoteExecutorAtomContext';
import { ConsoleLoggerTransport, Logger, LogLevel } from '@journeyapps-labs/carbon-utils';
import { Logger, ConsoleLoggerTransport, LogLevel } from '@journeyapps-labs/common-logger';

export interface RemoteProgramOptions {
molecule: Molecule;
Expand Down
4 changes: 2 additions & 2 deletions carbon-fibre/src/Transponder.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { BaseListener, BaseObserver } from '@journeyapps-labs/carbon-utils';
import { BaseObserver } from '@journeyapps-labs/common-utils';

export interface TransponderEvent {
signal: string;
data: any;
}

export interface TransponderListener extends BaseListener {
export interface TransponderListener {
gotSignal: (event: TransponderEvent) => any;
}

Expand Down
4 changes: 2 additions & 2 deletions carbon-fibre/tests/test1.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FlowPort, Molecule, Program, ProgramEndAtom, ProgramStartAtom } from '@journeyapps-labs/carbon-core';
import { Molecule, Program, ProgramEndAtom, ProgramStartAtom } from '@journeyapps-labs/carbon-core';
import { ProgramTransmitter, RemoteProgram, SimpleTransponder } from '../src';
import { ColourConsoleLoggerTransport, PrimaryConsoleColours } from '@journeyapps-labs/carbon-testing';
import { Logger, LogLevel } from '@journeyapps-labs/carbon-utils';
import { Logger, LogLevel } from '@journeyapps-labs/common-logger';
import { describe, beforeEach, afterEach, it, expect } from 'vitest';

describe('Flow tests', () => {
Expand Down
3 changes: 0 additions & 3 deletions carbon-fibre/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
{
"path": "../carbon-core"
},
{
"path": "../carbon-utils"
},
{
"path": "../carbon-testing"
}
Expand Down
2 changes: 1 addition & 1 deletion carbon-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"main": "./dist/index.js",
"typings": "./dist/@types/index",
"dependencies": {
"@journeyapps-labs/carbon-utils": "workspace:^",
"@journeyapps-labs/common-logger": "^1.0.0",
"colors": "^1.4.0",
"lodash": "^4.17.21"
}
Expand Down
2 changes: 1 addition & 1 deletion carbon-testing/src/ColourConsoleLoggerTransport.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LoggerTransport, LogLevel } from '@journeyapps-labs/carbon-utils';
import { LoggerTransport, LogLevel } from '@journeyapps-labs/common-logger';
import colors from 'colors/safe';
import * as _ from 'lodash';

Expand Down
5 changes: 1 addition & 4 deletions carbon-testing/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@
],
"exclude": [
"./dist"
],
"references": [{
"path": "../carbon-utils"
}]
]
}
Loading