##// END OF EJS Templates
changed the project structure
cin -
r49:1a91da7b15f7 di-typescript
parent child
Show More
@@ -0,0 +1,11
1 {
2 "extends": "../tsconfig.json",
3 "compilerOptions": {
4 "types": [
5 "@types/requirejs"
6 ]
7 },
8 "include": [
9 "ts/**/*.ts"
10 ]
11 } No newline at end of file
@@ -0,0 +1,6
1 {
2 "extends": "../tsconfig.json",
3 "include": [
4 "ts/**/*.ts"
5 ]
6 } No newline at end of file
@@ -44,20 +44,19 task _npmInstall() {
44 44 }
45 45
46 46 task _legacyJs(type:Copy) {
47 from 'src/js/'
47 from 'src/main/js/'
48 48 into distDir
49 49 }
50 50
51 51 task _buildTs(dependsOn: _npmInstall, type:Exec) {
52 inputs.dir('src/ts')
52 inputs.dir('src/main/ts')
53 53 inputs.file('src/tsconfig.json')
54 inputs.file('src/main/tsconfig.json')
54 55 outputs.dir(distDir)
55 56
56 57 commandLine 'node_modules/.bin/tsc',
57 '-p', 'src/tsconfig.json',
58 '--outDir', distDir,
59 '--listFiles',
60 '--traceResolution'
58 '-p', 'src/main/tsconfig.json',
59 '--outDir', distDir
61 60 }
62 61
63 62 task _packageMeta(type: Copy) {
@@ -10,6 +10,12
10 10 "integrity": "sha512-Pr+6JRiKkfsFvmU/LK68oBRCQeEg36TyAbPhc2xpez24OOZZCuoIhWGTd39VZy6nGafSbxzGouFPTFD/rR1A0A==",
11 11 "dev": true
12 12 },
13 "@types/requirejs": {
14 "version": "2.1.31",
15 "resolved": "https://registry.npmjs.org/@types/requirejs/-/requirejs-2.1.31.tgz",
16 "integrity": "sha512-b2soeyuU76rMbcRJ4e0hEl0tbMhFwZeTC0VZnfuWlfGlk6BwWNsev6kFu/twKABPX29wkX84wU2o+cEJoXsiTw==",
17 "dev": true
18 },
13 19 "@types/tape": {
14 20 "version": "4.2.32",
15 21 "resolved": "http://registry.npmjs.org/@types/tape/-/tape-4.2.32.tgz",
@@ -84,7 +90,7
84 90 },
85 91 "duplexer": {
86 92 "version": "0.1.1",
87 "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz",
93 "resolved": "http://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz",
88 94 "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=",
89 95 "dev": true
90 96 },
@@ -129,7 +135,7
129 135 "dependencies": {
130 136 "tape": {
131 137 "version": "2.3.3",
132 "resolved": "https://registry.npmjs.org/tape/-/tape-2.3.3.tgz",
138 "resolved": "http://registry.npmjs.org/tape/-/tape-2.3.3.tgz",
133 139 "integrity": "sha1-Lnzgox3wn41oUWZKcYQuDKUFevc=",
134 140 "dev": true,
135 141 "requires": {
@@ -289,7 +295,7
289 295 },
290 296 "path-is-absolute": {
291 297 "version": "1.0.1",
292 "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
298 "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
293 299 "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
294 300 "dev": true
295 301 },
@@ -301,7 +307,7
301 307 },
302 308 "readable-stream": {
303 309 "version": "1.1.14",
304 "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
310 "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
305 311 "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
306 312 "dev": true,
307 313 "requires": {
@@ -354,7 +360,7
354 360 },
355 361 "string_decoder": {
356 362 "version": "0.10.31",
357 "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
363 "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
358 364 "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
359 365 "dev": true
360 366 },
@@ -411,13 +417,13
411 417 },
412 418 "through": {
413 419 "version": "2.3.8",
414 "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
420 "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz",
415 421 "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=",
416 422 "dev": true
417 423 },
418 424 "through2": {
419 425 "version": "0.2.3",
420 "resolved": "https://registry.npmjs.org/through2/-/through2-0.2.3.tgz",
426 "resolved": "http://registry.npmjs.org/through2/-/through2-0.2.3.tgz",
421 427 "integrity": "sha1-6zKE2k6jEbbMis42U3SKUqvyWj8=",
422 428 "dev": true,
423 429 "requires": {
@@ -23,6 +23,7
23 23 "typescript": "latest",
24 24 "tape": "latest",
25 25 "@types/tape": "latest",
26 "@types/requirejs": "latest",
26 27 "requirejs": "latest",
27 28 "faucet": "latest",
28 29 "dojo": "^1.10.0"
@@ -2,25 +2,14 import { Uuid } from "../Uuid";
2 2 import { argumentNotEmptyString } from "../safe";
3 3 import { TraceSource } from "../log/TraceSource";
4 4
5 export interface RequireFn {
6 (module: string): any;
7 (modules: string[], cb?: (...args: any[]) => any): void;
8 }
9
10 declare const require: RequireFn;
11
12 5 export const rjs = require;
13 6
14 7 declare function define(name: string, modules: string[], cb?: (...args: any[]) => any, eb?: (e) => any): void;
15 8 declare function define(modules: string[], cb?: (...args: any[]) => any, eb?: (e) => any): void;
16 9
17 interface RequireJsResolverParams {
18 contextRequire: RequireFn;
19 }
20
21 10 const trace = TraceSource.get("@implab/core/di/RequireJsHelper");
22 11
23 export async function createContextRequire(moduleName: string): Promise<RequireFn> {
12 export async function createContextRequire(moduleName: string): Promise<Require> {
24 13 argumentNotEmptyString(moduleName, "moduleName");
25 14
26 15 const parts = moduleName.split("/");
@@ -36,7 +25,7 export async function createContextRequi
36 25
37 26 trace.debug(`define shim ${shim}`);
38 27
39 return new Promise<RequireFn>(fulfill => {
28 return new Promise<Require>(fulfill => {
40 29 define(shim, ["require"], r => {
41 30 trace.debug("shim resolved");
42 31 return r;
1 NO CONTENT: file renamed from src/js/Uri.js to src/main/js/Uri.js
1 NO CONTENT: file renamed from src/js/data/DataContext.js to src/main/js/data/DataContext.js
1 NO CONTENT: file renamed from src/js/data/MapSchema.js to src/main/js/data/MapSchema.js
1 NO CONTENT: file renamed from src/js/data/ObjectStore.js to src/main/js/data/ObjectStore.js
1 NO CONTENT: file renamed from src/js/data/RestStore.js to src/main/js/data/RestStore.js
1 NO CONTENT: file renamed from src/js/data/StatefullStoreAdapter.js to src/main/js/data/StatefullStoreAdapter.js
1 NO CONTENT: file renamed from src/js/data/StoreAdapter.js to src/main/js/data/StoreAdapter.js
1 NO CONTENT: file renamed from src/js/data/_ModelBase.js to src/main/js/data/_ModelBase.js
1 NO CONTENT: file renamed from src/js/data/_StatefulModelMixin.js to src/main/js/data/_StatefulModelMixin.js
1 NO CONTENT: file renamed from src/js/data/declare-model.js to src/main/js/data/declare-model.js
1 NO CONTENT: file renamed from src/js/declare/_load.js to src/main/js/declare/_load.js
1 NO CONTENT: file renamed from src/js/declare/override.js to src/main/js/declare/override.js
1 NO CONTENT: file renamed from src/js/log/trace.js to src/main/js/log/trace.js
1 NO CONTENT: file renamed from src/js/messaging/Client.js to src/main/js/messaging/Client.js
1 NO CONTENT: file renamed from src/js/messaging/Destination.js to src/main/js/messaging/Destination.js
1 NO CONTENT: file renamed from src/js/messaging/Listener.js to src/main/js/messaging/Listener.js
1 NO CONTENT: file renamed from src/js/messaging/Session.js to src/main/js/messaging/Session.js
1 NO CONTENT: file renamed from src/js/text/format-compile.js to src/main/js/text/format-compile.js
1 NO CONTENT: file renamed from src/js/text/format.js to src/main/js/text/format.js
1 NO CONTENT: file renamed from src/js/text/template-compile.js to src/main/js/text/template-compile.js
1 NO CONTENT: file renamed from src/ts/Cancellation.ts to src/main/ts/Cancellation.ts
1 NO CONTENT: file renamed from src/ts/Observable.ts to src/main/ts/Observable.ts
1 NO CONTENT: file renamed from src/ts/Uuid.ts to src/main/ts/Uuid.ts
1 NO CONTENT: file renamed from src/ts/components/ActivatableMixin.ts to src/main/ts/components/ActivatableMixin.ts
1 NO CONTENT: file renamed from src/ts/components/AsyncComponent.ts to src/main/ts/components/AsyncComponent.ts
1 NO CONTENT: file renamed from src/ts/di.ts to src/main/ts/di.ts
1 NO CONTENT: file renamed from src/ts/di/ActivationContext.ts to src/main/ts/di/ActivationContext.ts
1 NO CONTENT: file renamed from src/ts/di/ActivationError.ts to src/main/ts/di/ActivationError.ts
1 NO CONTENT: file renamed from src/ts/di/AggregateDescriptor.ts to src/main/ts/di/AggregateDescriptor.ts
1 NO CONTENT: file renamed from src/ts/di/ConfigError.ts to src/main/ts/di/ConfigError.ts
@@ -20,7 +20,7 import { Container } from "./Container";
20 20 import { ReferenceDescriptor } from "./ReferenceDescriptor";
21 21 import { TypeServiceDescriptor } from "./TypeServiceDescriptor";
22 22 import { FactoryServiceDescriptor } from "./FactoryServiceDescriptor";
23 import { rjs, createContextRequire, RequireFn } from "../../amd/ts/RequireJsHelper";
23 import { rjs, createContextRequire } from "./RequireJsHelper";
24 24 import { TraceSource } from "../log/TraceSource";
25 25 import { ConfigError } from "./ConfigError";
26 26 import { Cancellation } from "../Cancellation";
@@ -90,7 +90,7 export class Configuration {
90 90 this._container.register(services);
91 91 }
92 92
93 async applyConfiguration(data: object, contextRequire?: RequireFn, ct = Cancellation.none) {
93 async applyConfiguration(data: object, contextRequire?: Require, ct = Cancellation.none) {
94 94 argumentNotNull(data, "data");
95 95
96 96 trace.log("applyConfiguration");
1 NO CONTENT: file renamed from src/ts/di/Container.ts to src/main/ts/di/Container.ts
1 NO CONTENT: file renamed from src/ts/di/FactoryServiceDescriptor.ts to src/main/ts/di/FactoryServiceDescriptor.ts
1 NO CONTENT: file renamed from src/ts/di/ReferenceDescriptor.ts to src/main/ts/di/ReferenceDescriptor.ts
1 NO CONTENT: file renamed from src/ts/di/ServiceDescriptor.ts to src/main/ts/di/ServiceDescriptor.ts
1 NO CONTENT: file renamed from src/ts/di/TypeServiceDescriptor.ts to src/main/ts/di/TypeServiceDescriptor.ts
1 NO CONTENT: file renamed from src/ts/di/ValueDescriptor.ts to src/main/ts/di/ValueDescriptor.ts
1 NO CONTENT: file renamed from src/ts/di/interfaces.ts to src/main/ts/di/interfaces.ts
1 NO CONTENT: file renamed from src/ts/interfaces.ts to src/main/ts/interfaces.ts
1 NO CONTENT: file renamed from src/ts/log/TraceSource.ts to src/main/ts/log/TraceSource.ts
1 NO CONTENT: file renamed from src/ts/log/writers/ConsoleWriter.ts to src/main/ts/log/writers/ConsoleWriter.ts
1 NO CONTENT: file renamed from src/ts/main.ts to src/main/ts/main.ts
1 NO CONTENT: file renamed from src/ts/safe.ts to src/main/ts/safe.ts
1 NO CONTENT: file renamed from src/ts/text/format.d.ts to src/main/ts/text/format.d.ts
@@ -4,6 +4,8
4 4 "module": "amd",
5 5 "sourceMap": true,
6 6 "declaration": true,
7 "moduleResolution": "node",
8 "listFiles": true,
7 9 "lib": [
8 10 "es5",
9 11 "es2015.promise",
@@ -11,12 +13,9
11 13 "dom"
12 14 ],
13 15 "rootDirs": [
14 "ts",
16 "main/ts",
15 17 "amd/ts"
16 18 ],
17 19 "types": []
18 },
19 "include" : [
20 "ts/**/*.ts", "amd/ts/**/*.ts"
21 ]
20 }
22 21 } No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now