@deenruv/ui-devkit 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +5 -0
  3. package/client/devkit-client-api.d.ts +109 -0
  4. package/client/index.d.ts +1 -0
  5. package/client/index.js +1 -0
  6. package/compiler/compile.d.ts +9 -0
  7. package/compiler/compile.js +265 -0
  8. package/compiler/compile.js.map +1 -0
  9. package/compiler/constants.d.ts +6 -0
  10. package/compiler/constants.js +10 -0
  11. package/compiler/constants.js.map +1 -0
  12. package/compiler/helpers.d.ts +25 -0
  13. package/compiler/helpers.js +50 -0
  14. package/compiler/helpers.js.map +1 -0
  15. package/compiler/index.d.ts +3 -0
  16. package/compiler/index.js +20 -0
  17. package/compiler/index.js.map +1 -0
  18. package/compiler/scaffold.d.ts +4 -0
  19. package/compiler/scaffold.js +259 -0
  20. package/compiler/scaffold.js.map +1 -0
  21. package/compiler/translations.d.ts +12 -0
  22. package/compiler/translations.js +135 -0
  23. package/compiler/translations.js.map +1 -0
  24. package/compiler/types.d.ts +454 -0
  25. package/compiler/types.js +3 -0
  26. package/compiler/types.js.map +1 -0
  27. package/compiler/utils.d.ts +34 -0
  28. package/compiler/utils.js +139 -0
  29. package/compiler/utils.js.map +1 -0
  30. package/package.json +66 -0
  31. package/scaffold/README.md +7 -0
  32. package/scaffold/angular.json +128 -0
  33. package/scaffold/package.json +11 -0
  34. package/scaffold/src/app.module.ts +23 -0
  35. package/scaffold/src/app.routes.ts +63 -0
  36. package/scaffold/src/environment.prod.ts +3 -0
  37. package/scaffold/src/environment.ts +6 -0
  38. package/scaffold/src/extension.routes.ts +1 -0
  39. package/scaffold/src/main.ts +16 -0
  40. package/scaffold/src/shared-extensions.module.ts +7 -0
  41. package/scaffold/src/styles/global-styles.scss +1 -0
  42. package/scaffold/src/tsconfig.app.json +18 -0
  43. package/scaffold/tsconfig.json +28 -0
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "@deenruv/ui-devkit",
3
+ "version": "1.0.0",
4
+ "description": "A library for authoring Deenruv Admin UI extensions",
5
+ "keywords": [
6
+ "deenruv",
7
+ "javascript",
8
+ "extensions"
9
+ ],
10
+ "author": "Michael Bromley <michael@michaelbromley.co.uk>",
11
+ "homepage": "https://deenruv.com/",
12
+ "license": "MIT",
13
+ "files": [
14
+ "client",
15
+ "compiler",
16
+ "scaffold"
17
+ ],
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "main": "client/index.js",
22
+ "types": "client/index.d.ts",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/deenruv-ecommerce/deenruv.git"
26
+ },
27
+ "bugs": {
28
+ "url": "https://github.com/deenruv-ecommerce/deenruv/issues"
29
+ },
30
+ "dependencies": {
31
+ "@angular-devkit/build-angular": "^17.2.3",
32
+ "@angular/cli": "^17.2.3",
33
+ "@angular/compiler": "^17.2.4",
34
+ "@angular/compiler-cli": "^17.2.4",
35
+ "chalk": "^4.1.0",
36
+ "chokidar": "^3.6.0",
37
+ "fs-extra": "^11.2.0",
38
+ "glob": "^9.2.1",
39
+ "@deenruv/admin-ui": "^1.0.0",
40
+ "@deenruv/common": "^1.0.0"
41
+ },
42
+ "devDependencies": {
43
+ "@rollup/plugin-node-resolve": "^15.2.3",
44
+ "@rollup/plugin-terser": "^0.4.4",
45
+ "@types/fs-extra": "^11.0.4",
46
+ "react": "^18.2.0",
47
+ "react-dom": "^18.2.0",
48
+ "rimraf": "^5.0.5",
49
+ "rollup": "^4.13.0",
50
+ "rollup-plugin-typescript2": "^0.36.0",
51
+ "rxjs": "7.8.1",
52
+ "tslib": "^2.6.2",
53
+ "typescript": "5.3.3",
54
+ "@deenruv/core": "^1.0.0"
55
+ },
56
+ "peerDependencies": {
57
+ "rxjs": "7.8.1",
58
+ "@deenruv/core": "^0.1.0"
59
+ },
60
+ "scripts": {
61
+ "build:client": "rimraf ./client && rollup -c rollup.config.mjs --configProduction",
62
+ "build:compiler": "rimraf ./compiler && tsc -p tsconfig.compiler.json",
63
+ "build": "npm run build:client && npm run build:compiler",
64
+ "watch": "rimraf ./lib && rollup -c rollup.config.mjs -w"
65
+ }
66
+ }
@@ -0,0 +1,7 @@
1
+ # Generated Admin UI
2
+
3
+ This directory and its entire contents was generated the `compileUiExtensions()` function of the `@deenruv/ui-devkit/compiler` package. It is not recommended to modify these files, since any changes will be overwritten upon re-compiling the ui extensions.
4
+
5
+ ## Production app
6
+
7
+ When compiling in production mode (`devMode: false`), the compiled application will be output to the `./dist` directory. This is a production-ready Angular application which can then be served from any web server, with attention to the [Angular server configuration guide](https://angular.io/guide/deployment#server-configuration).
@@ -0,0 +1,128 @@
1
+ {
2
+ "$schema": "../node_modules/@angular/cli/lib/config/schema.json",
3
+ "version": 1,
4
+ "newProjectRoot": "projects",
5
+ "projects": {
6
+ "deenruv-admin": {
7
+ "root": "",
8
+ "sourceRoot": "src",
9
+ "projectType": "application",
10
+ "prefix": "vdr",
11
+ "schematics": {
12
+ "@schematics/angular:component": {
13
+ "style": "scss"
14
+ }
15
+ },
16
+ "architect": {
17
+ "build": {
18
+ "builder": "@angular-devkit/build-angular:browser",
19
+ "options": {
20
+ "baseHref": "/",
21
+ "outputPath": "dist",
22
+ "index": "src/index.html",
23
+ "main": "src/main.ts",
24
+ "polyfills": "src/polyfills.ts",
25
+ "tsConfig": "src/tsconfig.app.json",
26
+ "assets": [
27
+ {
28
+ "glob": "**/*.*",
29
+ "input": "static-assets",
30
+ "output": "assets"
31
+ },
32
+ "src/favicon.ico",
33
+ {
34
+ "glob": "favicon.ico",
35
+ "input": "static-assets",
36
+ "output": "/"
37
+ },
38
+ "src/deenruv-ui-config.json",
39
+ "src/theme.min.css",
40
+ "src/assets",
41
+ "src/i18n-messages",
42
+ {
43
+ "glob": "logo-*.*",
44
+ "input": "static-assets",
45
+ "output": "assets"
46
+ }
47
+ ],
48
+ "styles": [
49
+ "src/global-styles.scss"
50
+ ],
51
+ "stylePreprocessorOptions": {
52
+ "includePaths": [
53
+ "./src/styles",
54
+ "./src/fonts"
55
+ ]
56
+ },
57
+ "allowedCommonJsDependencies": [
58
+ "graphql-tag",
59
+ "zen-observable",
60
+ "lodash",
61
+ "dayjs",
62
+ "apollo-upload-client",
63
+ "@clr/icons",
64
+ "@clr/icons/shapes/all-shapes",
65
+ "@deenruv/common/lib/generated-types",
66
+ "@deenruv/common/lib/simple-deep-clone",
67
+ "@deenruv/common/lib/shared-constants",
68
+ "@deenruv/common/lib/shared-utils",
69
+ "@deenruv/common/lib/normalize-string",
70
+ "@deenruv/common/lib/unique",
71
+ "@deenruv/common/lib/omit",
72
+ "@deenruv/common/lib/pick",
73
+ "@messageformat/core"
74
+ ],
75
+ "vendorChunk": true,
76
+ "extractLicenses": false,
77
+ "buildOptimizer": false,
78
+ "sourceMap": true,
79
+ "optimization": false,
80
+ "namedChunks": true
81
+ },
82
+ "configurations": {
83
+ "production": {
84
+ "budgets": [
85
+ {
86
+ "type": "anyComponentStyle",
87
+ "maximumWarning": "6kb"
88
+ }
89
+ ],
90
+ "fileReplacements": [
91
+ {
92
+ "replace": "src/environment.ts",
93
+ "with": "src/environment.prod.ts"
94
+ }
95
+ ],
96
+ "optimization": {
97
+ "styles": {
98
+ "inlineCritical": false
99
+ }
100
+ },
101
+ "outputHashing": "all",
102
+ "namedChunks": false,
103
+ "extractLicenses": true,
104
+ "vendorChunk": false
105
+ }
106
+ },
107
+ "defaultConfiguration": ""
108
+ },
109
+ "serve": {
110
+ "builder": "@angular-devkit/build-angular:dev-server",
111
+ "options": {
112
+ "browserTarget": "deenruv-admin:build"
113
+ }
114
+ }
115
+ }
116
+ }
117
+ },
118
+ "schematics": {
119
+ "@schematics/angular:component": {
120
+ "skipTests": true,
121
+ "changeDetection": "OnPush"
122
+ }
123
+ },
124
+ "cli": {
125
+ "packageManager": "yarn",
126
+ "analytics": false
127
+ }
128
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "deenruv-admin-ui",
3
+ "dependencies": {},
4
+ "license": "UNLICENSED",
5
+ "private": true,
6
+ "scripts": {
7
+ "ng": "ng",
8
+ "start": "ng serve",
9
+ "build": "ng build --configuration production"
10
+ }
11
+ }
@@ -0,0 +1,23 @@
1
+ import { NgModule } from "@angular/core";
2
+ import { Route, RouterModule } from "@angular/router";
3
+ import { marker as _ } from "@biesbjerg/ngx-translate-extract-marker";
4
+ import {
5
+ AppComponent,
6
+ AppComponentModule,
7
+ CoreModule,
8
+ } from "@deenruv/admin-ui/core";
9
+
10
+ import { routes } from "./app.routes";
11
+ import { SharedExtensionsModule } from "./shared-extensions.module";
12
+
13
+ @NgModule({
14
+ declarations: [],
15
+ imports: [
16
+ AppComponentModule,
17
+ RouterModule.forRoot(routes, { useHash: false }),
18
+ CoreModule,
19
+ SharedExtensionsModule,
20
+ ],
21
+ bootstrap: [AppComponent],
22
+ })
23
+ export class AppModule {}
@@ -0,0 +1,63 @@
1
+ import { Route } from "@angular/router";
2
+ import { marker as _ } from "@biesbjerg/ngx-translate-extract-marker";
3
+ import { AppShellComponent, AuthGuard } from "@deenruv/admin-ui/core";
4
+
5
+ import { extensionRoutes } from "./extension.routes";
6
+
7
+ export const routes: Route[] = [
8
+ {
9
+ path: "login",
10
+ loadChildren: () =>
11
+ import("@deenruv/admin-ui/login").then((m) => m.LoginModule),
12
+ },
13
+ {
14
+ path: "",
15
+ canActivate: [AuthGuard],
16
+ component: AppShellComponent,
17
+ data: {
18
+ breadcrumb: _("breadcrumb.dashboard"),
19
+ },
20
+ children: [
21
+ // Defining the extension routes before the built-in routes allows
22
+ // the extension routes to take precedence over the built-in routes, enabling
23
+ // the extensions to override built-in functionality.
24
+ ...extensionRoutes,
25
+ {
26
+ path: "",
27
+ pathMatch: "full",
28
+ loadChildren: () =>
29
+ import("@deenruv/admin-ui/dashboard").then((m) => m.DashboardModule),
30
+ },
31
+ {
32
+ path: "catalog",
33
+ loadChildren: () =>
34
+ import("@deenruv/admin-ui/catalog").then((m) => m.CatalogModule),
35
+ },
36
+ {
37
+ path: "customer",
38
+ loadChildren: () =>
39
+ import("@deenruv/admin-ui/customer").then((m) => m.CustomerModule),
40
+ },
41
+ {
42
+ path: "orders",
43
+ loadChildren: () =>
44
+ import("@deenruv/admin-ui/order").then((m) => m.OrderModule),
45
+ },
46
+ {
47
+ path: "marketing",
48
+ loadChildren: () =>
49
+ import("@deenruv/admin-ui/marketing").then((m) => m.MarketingModule),
50
+ },
51
+ {
52
+ path: "settings",
53
+ loadChildren: () =>
54
+ import("@deenruv/admin-ui/settings").then((m) => m.SettingsModule),
55
+ },
56
+ {
57
+ path: "system",
58
+ loadChildren: () =>
59
+ import("@deenruv/admin-ui/system").then((m) => m.SystemModule),
60
+ },
61
+ ],
62
+ },
63
+ ];
@@ -0,0 +1,3 @@
1
+ export const environment = {
2
+ production: true,
3
+ };
@@ -0,0 +1,6 @@
1
+ // This file can be replaced during build by using the `fileReplacements` array.
2
+ // `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`.
3
+ // The list of file replacements can be found in `angular.json`.
4
+ export const environment = {
5
+ production: false,
6
+ };
@@ -0,0 +1 @@
1
+ export const extensionRoutes = [];
@@ -0,0 +1,16 @@
1
+ import { enableProdMode } from "@angular/core";
2
+ import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
3
+ import { loadAppConfig } from "@deenruv/admin-ui/core";
4
+
5
+ import { AppModule } from "./app.module";
6
+ import { environment } from "./environment";
7
+
8
+ if (environment.production) {
9
+ enableProdMode();
10
+ }
11
+
12
+ loadAppConfig()
13
+ .then(() => platformBrowserDynamic().bootstrapModule(AppModule))
14
+ .catch((err: any) => {
15
+ console.log(err);
16
+ });
@@ -0,0 +1,7 @@
1
+ import { CommonModule } from "@angular/common";
2
+ import { NgModule } from "@angular/core";
3
+
4
+ @NgModule({
5
+ imports: [CommonModule],
6
+ })
7
+ export class SharedExtensionsModule {}
@@ -0,0 +1 @@
1
+ @import "./styles";
@@ -0,0 +1,18 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../out-tsc/app"
5
+ },
6
+ "files": [
7
+ "main.ts",
8
+ "polyfills.ts"
9
+ ],
10
+ "include": [
11
+ "**/*.d.ts"
12
+ ],
13
+ "angularCompilerOptions": {
14
+ "strictMetadataEmit": true,
15
+ "fullTemplateTypeCheck": false,
16
+ "strictInjectionParameters": true
17
+ }
18
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "compileOnSave": false,
3
+ "compilerOptions": {
4
+ "baseUrl": "./",
5
+ "importHelpers": true,
6
+ "module": "es2020",
7
+ "outDir": "./dist/out-tsc",
8
+ "sourceMap": true,
9
+ "declaration": false,
10
+ "moduleResolution": "node",
11
+ "experimentalDecorators": true,
12
+ "strict": true,
13
+ "noImplicitAny": false,
14
+ "strictPropertyInitialization": false,
15
+ "target": "ES2022",
16
+ "skipLibCheck": true,
17
+ "esModuleInterop": true,
18
+ "allowSyntheticDefaultImports": true,
19
+ "jsx": "react",
20
+ "typeRoots": [],
21
+ "lib": [
22
+ "es2019",
23
+ "dom",
24
+ "esnext.asynciterable"
25
+ ],
26
+ "useDefineForClassFields": false
27
+ }
28
+ }