@vendure/ui-devkit 1.2.1

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 +9 -0
  2. package/README.md +5 -0
  3. package/client/devkit-client-api.d.ts +51 -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 +218 -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 +23 -0
  13. package/compiler/helpers.js +48 -0
  14. package/compiler/helpers.js.map +1 -0
  15. package/compiler/index.d.ts +3 -0
  16. package/compiler/index.js +16 -0
  17. package/compiler/index.js.map +1 -0
  18. package/compiler/scaffold.d.ts +3 -0
  19. package/compiler/scaffold.js +219 -0
  20. package/compiler/scaffold.js.map +1 -0
  21. package/compiler/translations.d.ts +12 -0
  22. package/compiler/translations.js +136 -0
  23. package/compiler/translations.js.map +1 -0
  24. package/compiler/types.d.ts +219 -0
  25. package/compiler/types.js +3 -0
  26. package/compiler/types.js.map +1 -0
  27. package/compiler/utils.d.ts +33 -0
  28. package/compiler/utils.js +125 -0
  29. package/compiler/utils.js.map +1 -0
  30. package/package.json +64 -0
  31. package/scaffold/README.md +7 -0
  32. package/scaffold/angular.json +119 -0
  33. package/scaffold/package.json +11 -0
  34. package/scaffold/src/app.module.ts +19 -0
  35. package/scaffold/src/app.routes.ts +49 -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/global-styles.scss +1 -0
  40. package/scaffold/src/main.ts +17 -0
  41. package/scaffold/src/shared-extensions.module.ts +7 -0
  42. package/scaffold/src/tsconfig.app.json +18 -0
  43. package/scaffold/tsconfig.json +26 -0
@@ -0,0 +1 @@
1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AAE,YAAY,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC;IAC9E,CAAC,CAAC,CAAC;AACP,CAAC;AAXD,kDAWC;AAED,SAAgB,kBAAkB,CAAC,KAAgB;IAC/C,OAAO,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;AACjD,CAAC;AAFD,gDAEC;AAED,SAAgB,sBAAsB,CAAC,KAAgB;IACnD,OAAO,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AAChD,CAAC;AAFD,wDAEC;AAED,SAAgB,sBAAsB,CAAC,KAAgB;IACnD,OAAO,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AAChD,CAAC;AAFD,wDAEC;AAED,SAAgB,uBAAuB,CAAC,KAAgB;IACpD,OAAO,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AAChD,CAAC;AAFD,0DAEC"}
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@vendure/ui-devkit",
3
+ "version": "1.2.1",
4
+ "description": "A library for authoring Vendure Admin UI extensions",
5
+ "keywords": [
6
+ "vendure",
7
+ "javascript",
8
+ "extensions"
9
+ ],
10
+ "author": "Michael Bromley <michael@michaelbromley.co.uk>",
11
+ "homepage": "https://www.vendure.io/",
12
+ "license": "MIT",
13
+ "files": [
14
+ "client",
15
+ "compiler",
16
+ "scaffold"
17
+ ],
18
+ "funding": "https://github.com/sponsors/michaelbromley",
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "main": "client/index.js",
23
+ "types": "client/index.d.ts",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/vendure-ecommerce/vendure.git"
27
+ },
28
+ "scripts": {
29
+ "build:client": "rimraf ./client && rollup -c rollup.config.js --configProduction",
30
+ "build:compiler": "rimraf ./compiler && tsc -p tsconfig.compiler.json",
31
+ "build": "yarn build:client && yarn build:compiler",
32
+ "watch": "rimraf ./lib && rollup -c rollup.config.js -w",
33
+ "lint": "tslint --fix --project ./"
34
+ },
35
+ "bugs": {
36
+ "url": "https://github.com/vendure-ecommerce/vendure/issues"
37
+ },
38
+ "dependencies": {
39
+ "@angular-devkit/build-angular": "12.2.2",
40
+ "@angular/cli": "12.2.2",
41
+ "@angular/compiler": "12.2.2",
42
+ "@angular/compiler-cli": "12.2.2",
43
+ "@vendure/admin-ui": "^1.2.1",
44
+ "@vendure/common": "^1.2.1",
45
+ "chalk": "^4.1.0",
46
+ "chokidar": "^3.5.1",
47
+ "fs-extra": "^10.0.0",
48
+ "glob": "^7.1.6",
49
+ "rxjs": "^6.6.6"
50
+ },
51
+ "devDependencies": {
52
+ "@rollup/plugin-node-resolve": "^11.2.0",
53
+ "@types/fs-extra": "^9.0.8",
54
+ "@types/glob": "^7.1.3",
55
+ "@vendure/core": "^1.2.1",
56
+ "rimraf": "^3.0.2",
57
+ "rollup": "^2.40.0",
58
+ "rollup-plugin-terser": "^7.0.2",
59
+ "rollup-plugin-typescript2": "^0.30.0",
60
+ "tslib": "^2.1.0",
61
+ "typescript": "4.3.5"
62
+ },
63
+ "gitHead": "d764852f00ab55b16ccbf88f6e8bb76bd76e9b08"
64
+ }
@@ -0,0 +1,7 @@
1
+ # Generated Admin UI
2
+
3
+ This directory and its entire contents was generated the `compileUiExtensions()` function of the `@vendure/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,119 @@
1
+ {
2
+ "$schema": "../node_modules/@angular/cli/lib/config/schema.json",
3
+ "version": 1,
4
+ "newProjectRoot": "projects",
5
+ "projects": {
6
+ "vendure-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/vendure-ui-config.json",
39
+ "src/theme.min.css",
40
+ "src/assets",
41
+ "src/i18n-messages",
42
+ {
43
+ "glob": "logo-*.png",
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
+ ]
55
+ },
56
+ "showCircularDependencies": false,
57
+ "allowedCommonJsDependencies": [
58
+ "graphql-tag",
59
+ "zen-observable",
60
+ "lodash",
61
+ "apollo-upload-client",
62
+ "@vendure/common/lib/simple-deep-clone"
63
+ ],
64
+ "vendorChunk": true,
65
+ "extractLicenses": false,
66
+ "buildOptimizer": false,
67
+ "sourceMap": true,
68
+ "optimization": false,
69
+ "namedChunks": true
70
+ },
71
+ "configurations": {
72
+ "production": {
73
+ "budgets": [
74
+ {
75
+ "type": "anyComponentStyle",
76
+ "maximumWarning": "6kb"
77
+ }
78
+ ],
79
+ "fileReplacements": [
80
+ {
81
+ "replace": "src/environment.ts",
82
+ "with": "src/environment.prod.ts"
83
+ }
84
+ ],
85
+ "optimization": {
86
+ "styles": {
87
+ "inlineCritical": false
88
+ }
89
+ },
90
+ "outputHashing": "all",
91
+ "extractCss": true,
92
+ "namedChunks": false,
93
+ "extractLicenses": true,
94
+ "vendorChunk": false
95
+ }
96
+ },
97
+ "defaultConfiguration": ""
98
+ },
99
+ "serve": {
100
+ "builder": "@angular-devkit/build-angular:dev-server",
101
+ "options": {
102
+ "browserTarget": "vendure-admin:build"
103
+ }
104
+ }
105
+ }
106
+ }
107
+ },
108
+ "defaultProject": "vendure-admin",
109
+ "schematics": {
110
+ "@schematics/angular:component": {
111
+ "skipTests": true,
112
+ "changeDetection": "OnPush"
113
+ }
114
+ },
115
+ "cli": {
116
+ "packageManager": "yarn",
117
+ "analytics": false
118
+ }
119
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "vendure-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,19 @@
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 { AppComponent, AppComponentModule, CoreModule } from '@vendure/admin-ui/core';
5
+
6
+ import { routes } from './app.routes';
7
+ import { SharedExtensionsModule } from './shared-extensions.module';
8
+
9
+ @NgModule({
10
+ declarations: [],
11
+ imports: [
12
+ AppComponentModule,
13
+ RouterModule.forRoot(routes, { useHash: false }),
14
+ CoreModule,
15
+ SharedExtensionsModule,
16
+ ],
17
+ bootstrap: [AppComponent],
18
+ })
19
+ export class AppModule {}
@@ -0,0 +1,49 @@
1
+ import { Route } from '@angular/router';
2
+ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
3
+ import { AppShellComponent, AuthGuard } from '@vendure/admin-ui/core';
4
+
5
+ import { extensionRoutes } from './extension.routes';
6
+
7
+ export const routes: Route[] = [
8
+ { path: 'login', loadChildren: () => import('@vendure/admin-ui/login').then(m => m.LoginModule) },
9
+ {
10
+ path: '',
11
+ canActivate: [AuthGuard],
12
+ component: AppShellComponent,
13
+ data: {
14
+ breadcrumb: _('breadcrumb.dashboard'),
15
+ },
16
+ children: [
17
+ {
18
+ path: '',
19
+ pathMatch: 'full',
20
+ loadChildren: () => import('@vendure/admin-ui/dashboard').then(m => m.DashboardModule),
21
+ },
22
+ {
23
+ path: 'catalog',
24
+ loadChildren: () => import('@vendure/admin-ui/catalog').then(m => m.CatalogModule),
25
+ },
26
+ {
27
+ path: 'customer',
28
+ loadChildren: () => import('@vendure/admin-ui/customer').then(m => m.CustomerModule),
29
+ },
30
+ {
31
+ path: 'orders',
32
+ loadChildren: () => import('@vendure/admin-ui/order').then(m => m.OrderModule),
33
+ },
34
+ {
35
+ path: 'marketing',
36
+ loadChildren: () => import('@vendure/admin-ui/marketing').then(m => m.MarketingModule),
37
+ },
38
+ {
39
+ path: 'settings',
40
+ loadChildren: () => import('@vendure/admin-ui/settings').then(m => m.SettingsModule),
41
+ },
42
+ {
43
+ path: 'system',
44
+ loadChildren: () => import('@vendure/admin-ui/system').then(m => m.SystemModule),
45
+ },
46
+ ...extensionRoutes,
47
+ ],
48
+ },
49
+ ];
@@ -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 @@
1
+ @import "./styles/styles";
@@ -0,0 +1,17 @@
1
+ import { enableProdMode } from '@angular/core';
2
+ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3
+ import { loadAppConfig } from '@vendure/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
+ // tslint:disable:no-console
16
+ console.log(err);
17
+ });
@@ -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,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,26 @@
1
+ {
2
+ "compileOnSave": false,
3
+ "compilerOptions": {
4
+ "baseUrl": "./",
5
+ "importHelpers": true,
6
+ "module": "esnext",
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": "es2015",
16
+ "skipLibCheck": true,
17
+ "esModuleInterop": true,
18
+ "allowSyntheticDefaultImports": true,
19
+ "typeRoots": [],
20
+ "lib": [
21
+ "es2017",
22
+ "dom",
23
+ "esnext.asynciterable"
24
+ ]
25
+ }
26
+ }