-
Notifications
You must be signed in to change notification settings - Fork 9
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
1 parent
de66ec4
commit 8cb3aae
Showing
43 changed files
with
287 additions
and
291 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
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 |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
"url": "http://127.0.0.1:3000", | ||
"standalone": | ||
{ | ||
|
||
"segments": ["default"] | ||
} | ||
} |
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
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 |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
"url": "http://127.0.0.1:3000", | ||
"standalone": | ||
{ | ||
|
||
"segments": [ "process", "data" ] | ||
} | ||
} |
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
Empty file.
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,23 @@ | ||
|
||
import { describe, expect, it } from 'vitest'; | ||
|
||
import { MODULES, SEGMENTATION, SEGMENTS } from '../fixtures'; | ||
|
||
import ImportRewriter from '../../src/application/ImportRewriter'; | ||
|
||
describe('application/ImportRewriter', () => | ||
{ | ||
describe('.rewrite()', () => | ||
{ | ||
it('should ...', () => | ||
{ | ||
const rewriter = new ImportRewriter(MODULES.C, SEGMENTATION, SEGMENTS.FIRST); | ||
|
||
const code = rewriter.rewrite(); | ||
|
||
console.log(code); | ||
|
||
expect(true).toBe(true); | ||
}); | ||
}); | ||
}); |
Empty file.
Empty file.
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,9 @@ | ||
|
||
import Application from '../../src/application/models/Application'; | ||
|
||
import { REPOSITORY } from './repository'; | ||
import { SEGMENTATION } from './segmentation'; | ||
|
||
const APPLICATION = new Application(REPOSITORY, SEGMENTATION); | ||
|
||
export { APPLICATION }; |
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,61 @@ | ||
|
||
const A = | ||
` | ||
import b from './b'; | ||
export default async function a() { | ||
await b(); | ||
} | ||
`; | ||
|
||
const B = | ||
` | ||
export default async function b() { } | ||
`; | ||
|
||
const C = | ||
` | ||
import D from '../shared/d'; | ||
import e from '../second/e'; | ||
export default async function c() { | ||
await e(); | ||
} | ||
`; | ||
|
||
const D = | ||
` | ||
export default class D {} | ||
`; | ||
|
||
const E = | ||
` | ||
import D from '../shared/d'; | ||
import f from './f'; | ||
export default async function e() { | ||
await f(); | ||
} | ||
`; | ||
|
||
const F = | ||
` | ||
import g, { h } from './g'; | ||
export default async function f() { | ||
await g(); | ||
} | ||
`; | ||
|
||
const G = | ||
` | ||
export default async function g() { } | ||
export async function h() { } | ||
export class i {} | ||
`; | ||
|
||
const CODES = { A, B, C, D, E, F, G }; | ||
|
||
export { CODES }; |
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,9 @@ | ||
|
||
export * from './application'; | ||
export * from './codes'; | ||
export * from './modules'; | ||
export * from './repository'; | ||
export * from './segmentation'; | ||
export * from './segmentModules'; | ||
export * from './segmentProcedures'; | ||
export * from './segments'; |
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,21 @@ | ||
|
||
import { Reflector } from '@jitar/reflection'; | ||
|
||
import Module from '../../src/module/models/Module'; | ||
|
||
import { CODES } from './codes'; | ||
|
||
const reflector = new Reflector(); | ||
|
||
const MODULES = | ||
{ | ||
A: new Module('domain/first/a.js', CODES.A, reflector.parse(CODES.A)), | ||
B: new Module('domain/first/b.js', CODES.B, reflector.parse(CODES.B)), | ||
C: new Module('domain/first/c.js', CODES.C, reflector.parse(CODES.C)), | ||
D: new Module('domain/shared/d.js', CODES.D, reflector.parse(CODES.D)), | ||
E: new Module('domain/second/e.js', CODES.E, reflector.parse(CODES.E)), | ||
F: new Module('domain/second/f.js', CODES.F, reflector.parse(CODES.F)), | ||
G: new Module('domain/second/g.js', CODES.G, reflector.parse(CODES.G)) | ||
}; | ||
|
||
export { 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 @@ | ||
|
||
import Repository from '../../src/module/models/Repository'; | ||
|
||
import { MODULES } from './modules'; | ||
|
||
const REPOSITORY = new Repository(Object.values(MODULES)); | ||
|
||
export { REPOSITORY }; |
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,17 @@ | ||
|
||
import Module from '../../src/segment/models/Module'; | ||
|
||
const SEGMENT_MODULES = | ||
{ | ||
// First segment | ||
A: new Module('domain/first/a.js', 'domain/first', { 'default': { 'access': 'public' } }), | ||
B: new Module('domain/first/b.js', 'domain/first', { 'default': { 'access': 'private' } }), | ||
C: new Module('domain/first/c.js', 'domain/first', { 'default': { 'access': 'protected' } }), | ||
|
||
// Second segment | ||
E: new Module('domain/second/e.js', 'domain/second', { 'default': { 'access': 'public' } }), | ||
F: new Module('domain/second/f.js', 'domain/second', { 'default': { 'access': 'private' } }), | ||
G: new Module('domain/second/g.js', 'domain/second', { 'default': { 'access': 'private' } }) | ||
}; | ||
|
||
export { SEGMENT_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,17 @@ | ||
|
||
import Procedure from '../../src/segment/models/Procedure'; | ||
|
||
const SEGMENT_PROCEDURES = | ||
{ | ||
// First segment | ||
A: new Procedure('domain/first/a', []), | ||
B: new Procedure('domain/first/b', []), | ||
C: new Procedure('domain/first/c', []), | ||
|
||
// Second segment | ||
E: new Procedure('domain/second/e', []), | ||
F: new Procedure('domain/second/f', []), | ||
G: new Procedure('domain/second/g', []) | ||
}; | ||
|
||
export { SEGMENT_PROCEDURES }; |
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 @@ | ||
|
||
import Segmentation from '../../src/segment/models/Segmentation'; | ||
|
||
import { SEGMENTS } from './segments'; | ||
|
||
const SEGMENTATION = new Segmentation([SEGMENTS.FIRST, SEGMENTS.SECOND]); | ||
|
||
export { SEGMENTATION }; |
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,13 @@ | ||
|
||
import Segment from '../../src/segment/models/Segment'; | ||
|
||
import { SEGMENT_MODULES as MODULES } from './segmentModules'; | ||
import { SEGMENT_PROCEDURES as PROCEDURES } from './segmentProcedures'; | ||
|
||
const SEGMENTS = | ||
{ | ||
FIRST: new Segment('first', [MODULES.A, MODULES.B, MODULES.C], [PROCEDURES.A, PROCEDURES.B, PROCEDURES.C]), | ||
SECOND: new Segment('second', [MODULES.E, MODULES.F, MODULES.G], [PROCEDURES.E, PROCEDURES.F, PROCEDURES.G]), | ||
}; | ||
|
||
export { SEGMENTS }; |
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 |
---|---|---|
|
@@ -13,7 +13,6 @@ export | |
NamedParameter, | ||
ArrayParameter, | ||
ObjectParameter, | ||
Import, | ||
BadRequest, | ||
Forbidden, | ||
NotFound, | ||
|
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
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
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
|
||
const ExecutionScopes = | ||
{ | ||
APPLICATION: 'application', | ||
RUNTIME: 'runtime' | ||
} as const; | ||
// const ExecutionScopes = | ||
// { | ||
// APPLICATION: 'application', | ||
// RUNTIME: 'runtime' | ||
// } as const; | ||
|
||
Object.freeze(ExecutionScopes); | ||
// Object.freeze(ExecutionScopes); | ||
|
||
type Keys = keyof typeof ExecutionScopes; | ||
type ExecutionScope = typeof ExecutionScopes[Keys]; | ||
// type Keys = keyof typeof ExecutionScopes; | ||
// type ExecutionScope = typeof ExecutionScopes[Keys]; | ||
|
||
export { ExecutionScope, ExecutionScopes }; | ||
// export { ExecutionScope, ExecutionScopes }; |
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
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
Oops, something went wrong.