@vendure/ui-devkit 2.0.0-next.8 → 2.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.
- package/client/index.js +1 -1
- package/compiler/compile.js +11 -11
- package/compiler/compile.js.map +1 -1
- package/compiler/index.js +5 -1
- package/compiler/index.js.map +1 -1
- package/compiler/scaffold.d.ts +1 -0
- package/compiler/scaffold.js +70 -64
- package/compiler/scaffold.js.map +1 -1
- package/compiler/translations.js +9 -8
- package/compiler/translations.js.map +1 -1
- package/compiler/types.d.ts +136 -4
- package/compiler/utils.d.ts +3 -2
- package/compiler/utils.js +12 -5
- package/compiler/utils.js.map +1 -1
- package/package.json +61 -62
- package/scaffold/angular.json +14 -3
- package/scaffold/src/main.ts +1 -1
- package/scaffold/src/styles/global-styles.scss +1 -0
- package/scaffold/tsconfig.json +5 -4
- package/scaffold/src/global-styles.scss +0 -1
package/client/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((t="undefined"!=typeof globalThis?globalThis:t||self).VendureUiClient={})}(this,(function(t){"use strict";var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])},r(t,e)};function e(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function n(t){var r="function"==typeof Symbol&&Symbol.iterator,e=r&&t[r],n=0;if(e)return e.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(t,r){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var n,o,i=e.call(t),u=[];try{for(;(void 0===r||r-- >0)&&!(n=i.next()).done;)u.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u}function i(t,r,e){if(e||2===arguments.length)for(var n,o=0,i=r.length;o<i;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return t.concat(n||Array.prototype.slice.call(r))}function u(t){return"function"==typeof t}var c,s
|
|
1
|
+
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((t="undefined"!=typeof globalThis?globalThis:t||self).VendureUiClient={})}(this,(function(t){"use strict";var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])},r(t,e)};function e(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function n(t){var r="function"==typeof Symbol&&Symbol.iterator,e=r&&t[r],n=0;if(e)return e.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(t,r){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var n,o,i=e.call(t),u=[];try{for(;(void 0===r||r-- >0)&&!(n=i.next()).done;)u.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u}function i(t,r,e){if(e||2===arguments.length)for(var n,o=0,i=r.length;o<i;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return t.concat(n||Array.prototype.slice.call(r))}function u(t){return"function"==typeof t}var c,s=((c=function(t){return function(r){t(this),this.message=r?r.length+" errors occurred during unsubscription:\n"+r.map((function(t,r){return r+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=r}}((function(t){Error.call(t),t.stack=(new Error).stack}))).prototype=Object.create(Error.prototype),c.prototype.constructor=c,c);function a(t,r){if(t){var e=t.indexOf(r);0<=e&&t.splice(e,1)}}var l=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var r;return t.prototype.unsubscribe=function(){var t,r,e,c,a;if(!this.closed){this.closed=!0;var l=this._parentage;if(l)if(this._parentage=null,Array.isArray(l))try{for(var f=n(l),h=f.next();!h.done;h=f.next()){h.value.remove(this)}}catch(r){t={error:r}}finally{try{h&&!h.done&&(r=f.return)&&r.call(f)}finally{if(t)throw t.error}}else l.remove(this);var y=this.initialTeardown;if(u(y))try{y()}catch(t){a=t instanceof s?t.errors:[t]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var v=n(d),b=v.next();!b.done;b=v.next()){var m=b.value;try{p(m)}catch(t){a=null!=a?a:[],t instanceof s?a=i(i([],o(a)),o(t.errors)):a.push(t)}}}catch(t){e={error:t}}finally{try{b&&!b.done&&(c=v.return)&&c.call(v)}finally{if(e)throw e.error}}}if(a)throw new s(a)}},t.prototype.add=function(r){var e;if(r&&r!==this)if(this.closed)p(r);else{if(r instanceof t){if(r.closed||r._hasParent(this))return;r._addParent(this)}(this._finalizers=null!==(e=this._finalizers)&&void 0!==e?e:[]).push(r)}},t.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},t.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},t.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&a(r,t)},t.prototype.remove=function(r){var e=this._finalizers;e&&a(e,r),r instanceof t&&r._removeParent(this)},t.EMPTY=((r=new t).closed=!0,r),t}();function f(t){return t instanceof l||t&&"closed"in t&&u(t.remove)&&u(t.add)&&u(t.unsubscribe)}function p(t){u(t)?t():t.unsubscribe()}l.EMPTY;var h={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},y={setTimeout:function(t,r){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];var u=y.delegate;return(null==u?void 0:u.setTimeout)?u.setTimeout.apply(u,i([t,r],o(e))):setTimeout.apply(void 0,i([t,r],o(e)))},clearTimeout:function(t){var r=y.delegate;return((null==r?void 0:r.clearTimeout)||clearTimeout)(t)},delegate:void 0};function d(){}var v=function(t){function r(r){var e=t.call(this)||this;return e.isStopped=!1,r?(e.destination=r,f(r)&&r.add(e)):e.destination=x,e}return e(r,t),r.create=function(t,r,e){return new g(t,r,e)},r.prototype.next=function(t){this.isStopped||this._next(t)},r.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},r.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(t){this.destination.next(t)},r.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r}(l),b=Function.prototype.bind;function m(t,r){return b.call(t,r)}var _=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(t){w(t)}},t.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(t){w(t)}else w(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){w(t)}},t}(),g=function(t){function r(r,e,n){var o,i,c=t.call(this)||this;u(r)||!r?o={next:null!=r?r:void 0,error:null!=e?e:void 0,complete:null!=n?n:void 0}:c&&h.useDeprecatedNextContext?((i=Object.create(r)).unsubscribe=function(){return c.unsubscribe()},o={next:r.next&&m(r.next,i),error:r.error&&m(r.error,i),complete:r.complete&&m(r.complete,i)}):o=r;return c.destination=new _(o),c}return e(r,t),r}(v);function w(t){var r;r=t,y.setTimeout((function(){throw r}))}var x={closed:!0,next:d,error:function(t){throw t},complete:d},S="function"==typeof Symbol&&Symbol.observable||"@@observable";function P(t){return t}var T=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(r){var e=new t;return e.source=this,e.operator=r,e},t.prototype.subscribe=function(t,r,e){var n,o=this,i=(n=t)&&n instanceof v||function(t){return t&&u(t.next)&&u(t.error)&&u(t.complete)}(n)&&f(n)?t:new g(t,r,e);return function(){var t=o,r=t.operator,e=t.source;i.add(r?r.call(i,e):e?o._subscribe(i):o._trySubscribe(i))}(),i},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},t.prototype.forEach=function(t,r){var e=this;return new(r=O(r))((function(r,n){var o=new g({next:function(r){try{t(r)}catch(t){n(t),o.unsubscribe()}},error:n,complete:r});e.subscribe(o)}))},t.prototype._subscribe=function(t){var r;return null===(r=this.source)||void 0===r?void 0:r.subscribe(t)},t.prototype[S]=function(){return this},t.prototype.pipe=function(){for(var t,r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return(0===(t=r).length?P:1===t.length?t[0]:function(r){return t.reduce((function(t,r){return r(t)}),r)})(this)},t.prototype.toPromise=function(t){var r=this;return new(t=O(t))((function(t,e){var n;r.subscribe((function(t){return n=t}),(function(t){return e(t)}),(function(){return t(n)}))}))},t.create=function(r){return new t(r)},t}();function O(t){var r;return null!==(r=null!=t?t:h.Promise)&&void 0!==r?r:Promise}function E(t){return function(r){if(function(t){return u(null==t?void 0:t.lift)}(r))return r.lift((function(r){try{return t(r,this)}catch(t){this.error(t)}}));throw new TypeError("Unable to lift unknown Observable type")}}var A=function(t){function r(r,e,n,o,i,u){var c=t.call(this,r)||this;return c.onFinalize=i,c.shouldUnsubscribe=u,c._next=e?function(t){try{e(t)}catch(t){r.error(t)}}:t.prototype._next,c._error=o?function(t){try{o(t)}catch(t){r.error(t)}finally{this.unsubscribe()}}:t.prototype._error,c._complete=n?function(){try{n()}catch(t){r.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,c}return e(r,t),r.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var e=this.closed;t.prototype.unsubscribe.call(this),!e&&(null===(r=this.onFinalize)||void 0===r||r.call(this))}},r}(v),j=new T((function(t){return t.complete()}));function z(t){return t<=0?function(){return j}:E((function(r,e){var n,o,i,u=0;r.subscribe(new A(e,(function(r){++u<=t&&(e.next(r),t<=u&&e.complete())}),n,o,i))}))}var U="http://localhost:3000";function q(t,r){var e=t+"__"+Math.random().toString(36).substr(3),n={requestId:e,type:t,data:r};return new T((function(t){var r=window.opener||window.parent,o=function(){r.postMessage({requestId:e,type:"cancellation",data:null},U)};return window.addEventListener("message",(function(r){var n=r.data;if(n&&n.requestId===e){if(n.complete)return t.complete(),void o();if(n.error)return t.error(n.data),void o();t.next(n.data)}})),r.postMessage(n,U),o}))}t.getActivatedRoute=function(){return q("active-route",{}).toPromise()},t.graphQlMutation=function(t,r){var e=q("graphql-mutation",{document:t,variables:r});return{then:function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return(t=e.pipe(z(1)).toPromise()).then.apply(t,r)},stream:e}},t.graphQlQuery=function(t,r,e){var n=q("graphql-query",{document:t,variables:r,fetchPolicy:e});return{then:function(){for(var t,r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return(t=n.pipe(z(1)).toPromise()).then.apply(t,r)},stream:n}},t.notify=function(t){q("notification",t).toPromise()},t.setTargetOrigin=function(t){U=t}}));
|
package/compiler/compile.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -50,13 +54,8 @@ function runCompileMode(outputPath, baseHref, extensions, usingYarn, args) {
|
|
|
50
54
|
const distPath = path.join(outputPath, 'dist');
|
|
51
55
|
const compile = () => new Promise(async (resolve, reject) => {
|
|
52
56
|
await (0, scaffold_1.setupScaffold)(outputPath, extensions);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
'build',
|
|
56
|
-
`--outputPath="${distPath}"`,
|
|
57
|
-
`--base-href=${baseHref}`,
|
|
58
|
-
...buildProcessArguments(args),
|
|
59
|
-
];
|
|
57
|
+
await (0, scaffold_1.setBaseHref)(outputPath, baseHref);
|
|
58
|
+
const commandArgs = ['run', 'build', ...buildProcessArguments(args)];
|
|
60
59
|
if (!usingYarn) {
|
|
61
60
|
// npm requires `--` before any command line args being passed to a script
|
|
62
61
|
commandArgs.splice(2, 0, '--');
|
|
@@ -91,12 +90,13 @@ function runWatchMode(outputPath, baseHref, port, extensions, usingYarn, args) {
|
|
|
91
90
|
};
|
|
92
91
|
const compile = () => new Promise(async (resolve, reject) => {
|
|
93
92
|
await (0, scaffold_1.setupScaffold)(outputPath, extensions);
|
|
93
|
+
await (0, scaffold_1.setBaseHref)(outputPath, baseHref);
|
|
94
94
|
const adminUiExtensions = extensions.filter(utils_1.isAdminUiExtension);
|
|
95
95
|
const normalizedExtensions = (0, utils_1.normalizeExtensions)(adminUiExtensions);
|
|
96
96
|
const globalStylesExtensions = extensions.filter(utils_1.isGlobalStylesExtension);
|
|
97
97
|
const staticAssetExtensions = extensions.filter(utils_1.isStaticAssetExtension);
|
|
98
98
|
const allTranslationFiles = (0, translations_1.getAllTranslationFiles)(extensions.filter(utils_1.isTranslationExtension));
|
|
99
|
-
buildProcess = (0, child_process_1.spawn)(cmd, ['run', 'start', `--port=${port}`,
|
|
99
|
+
buildProcess = (0, child_process_1.spawn)(cmd, ['run', 'start', `--port=${port}`, ...buildProcessArguments(args)], {
|
|
100
100
|
cwd: outputPath,
|
|
101
101
|
shell: true,
|
|
102
102
|
stdio: 'inherit',
|
|
@@ -193,7 +193,7 @@ function runWatchMode(outputPath, baseHref, port, extensions, usingYarn, args) {
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
for (const languageCode of Object.keys(allTranslationFiles)) {
|
|
196
|
-
//
|
|
196
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
197
197
|
const translationFiles = allTranslationFiles[languageCode];
|
|
198
198
|
for (const file of translationFiles) {
|
|
199
199
|
if (filePath.includes(path.normalize(file))) {
|
|
@@ -209,7 +209,7 @@ function runWatchMode(outputPath, baseHref, port, extensions, usingYarn, args) {
|
|
|
209
209
|
});
|
|
210
210
|
close = () => {
|
|
211
211
|
if (watcher) {
|
|
212
|
-
watcher.close();
|
|
212
|
+
void watcher.close();
|
|
213
213
|
}
|
|
214
214
|
if (buildProcess) {
|
|
215
215
|
buildProcess.kill();
|
package/compiler/compile.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../src/compiler/compile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../src/compiler/compile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,iDAAoD;AACpD,uCAA6D;AAC7D,6CAA+B;AAC/B,2CAA6B;AAE7B,2CAAoE;AACpE,yCAA6E;AAC7E,iDAAoF;AAOpF,mCAUiB;AAEjB;;;;;GAKG;AACH,SAAgB,mBAAmB,CAC/B,OAAmC;IAEnC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EAAE,KAAK,CAAC,GAAG,GAAG,CAAC;YAEzB,OAAO,GAAG,GAAG,IAAI,KAAe,EAAE,CAAC;SACtC;QAED,OAAO,GAAG,CAAC;IACf,CAAC,CAAC,CAAC;AACP,CAAC;AAED,SAAS,eAAe,CAAC,QAAgB;IACrC,OAAO,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAC1D,CAAC"}
|
package/compiler/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/compiler/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/compiler/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/compiler/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,4CAA0B;AAC1B,0CAAwB"}
|
package/compiler/scaffold.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Extension } from './types';
|
|
2
2
|
export declare function setupScaffold(outputPath: string, extensions: Extension[]): Promise<void>;
|
|
3
3
|
export declare function copyGlobalStyleFile(outputPath: string, stylePath: string): Promise<void>;
|
|
4
|
+
export declare function setBaseHref(outputPath: string, baseHref: string): Promise<void>;
|
package/compiler/scaffold.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -19,34 +23,28 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
23
|
return result;
|
|
20
24
|
};
|
|
21
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.copyGlobalStyleFile = exports.setupScaffold = void 0;
|
|
23
|
-
/* tslint:disable:no-console */
|
|
24
|
-
const child_process_1 = require("child_process");
|
|
26
|
+
exports.setBaseHref = exports.copyGlobalStyleFile = exports.setupScaffold = void 0;
|
|
25
27
|
const fs = __importStar(require("fs-extra"));
|
|
28
|
+
const glob_1 = require("glob");
|
|
26
29
|
const path = __importStar(require("path"));
|
|
27
30
|
const constants_1 = require("./constants");
|
|
28
31
|
const translations_1 = require("./translations");
|
|
29
32
|
const utils_1 = require("./utils");
|
|
30
33
|
async function setupScaffold(outputPath, extensions) {
|
|
31
34
|
deleteExistingExtensionModules(outputPath);
|
|
32
|
-
copyAdminUiSource(outputPath);
|
|
33
35
|
const adminUiExtensions = extensions.filter(utils_1.isAdminUiExtension);
|
|
34
36
|
const normalizedExtensions = (0, utils_1.normalizeExtensions)(adminUiExtensions);
|
|
37
|
+
const modulePathMapping = generateModulePathMapping(normalizedExtensions);
|
|
38
|
+
copyAdminUiSource(outputPath, modulePathMapping);
|
|
35
39
|
await copyExtensionModules(outputPath, normalizedExtensions);
|
|
36
40
|
const staticAssetExtensions = extensions.filter(utils_1.isStaticAssetExtension);
|
|
37
41
|
await copyStaticAssets(outputPath, staticAssetExtensions);
|
|
38
42
|
const globalStyleExtensions = extensions.filter(utils_1.isGlobalStylesExtension);
|
|
39
|
-
|
|
43
|
+
const sassVariableOverridesExtension = extensions.find(utils_1.isSassVariableOverridesExtension);
|
|
44
|
+
await addGlobalStyles(outputPath, globalStyleExtensions, sassVariableOverridesExtension);
|
|
40
45
|
const allTranslationFiles = (0, translations_1.getAllTranslationFiles)(extensions.filter(utils_1.isTranslationExtension));
|
|
41
46
|
await (0, translations_1.mergeExtensionTranslations)(outputPath, allTranslationFiles);
|
|
42
47
|
(0, utils_1.copyUiDevkit)(outputPath);
|
|
43
|
-
try {
|
|
44
|
-
await checkIfNgccWasRun();
|
|
45
|
-
}
|
|
46
|
-
catch (e) {
|
|
47
|
-
const cmd = (0, utils_1.shouldUseYarn)() ? 'yarn ngcc' : 'npx ngcc';
|
|
48
|
-
utils_1.logger.log(`An error occurred when running ngcc. Try removing node_modules, re-installing, and then manually running "${cmd}" in the project root.`);
|
|
49
|
-
}
|
|
50
48
|
}
|
|
51
49
|
exports.setupScaffold = setupScaffold;
|
|
52
50
|
/**
|
|
@@ -56,6 +54,23 @@ exports.setupScaffold = setupScaffold;
|
|
|
56
54
|
function deleteExistingExtensionModules(outputPath) {
|
|
57
55
|
fs.removeSync(path.join(outputPath, constants_1.MODULES_OUTPUT_DIR));
|
|
58
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Generates a module path mapping object for all extensions with a "pathAlias"
|
|
59
|
+
* property declared (if any).
|
|
60
|
+
*/
|
|
61
|
+
function generateModulePathMapping(extensions) {
|
|
62
|
+
const extensionsWithAlias = extensions.filter(e => e.pathAlias);
|
|
63
|
+
if (extensionsWithAlias.length === 0) {
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
return extensionsWithAlias.reduce((acc, e) => {
|
|
67
|
+
// for imports from the index file if there is one
|
|
68
|
+
acc[e.pathAlias] = [`src/extensions/${e.id}`];
|
|
69
|
+
// direct access to files / deep imports
|
|
70
|
+
acc[`${e.pathAlias}/*`] = [`src/extensions/${e.id}/*`];
|
|
71
|
+
return acc;
|
|
72
|
+
}, {});
|
|
73
|
+
}
|
|
59
74
|
/**
|
|
60
75
|
* Copies all files from the extensionPaths of the configured extensions into the
|
|
61
76
|
* admin-ui source tree.
|
|
@@ -67,7 +82,16 @@ async function copyExtensionModules(outputPath, extensions) {
|
|
|
67
82
|
fs.writeFileSync(path.join(outputPath, constants_1.SHARED_EXTENSIONS_FILE), sharedExtensionModulesSource, 'utf8');
|
|
68
83
|
for (const extension of extensions) {
|
|
69
84
|
const dest = path.join(outputPath, constants_1.MODULES_OUTPUT_DIR, extension.id);
|
|
70
|
-
|
|
85
|
+
if (!extension.exclude) {
|
|
86
|
+
fs.copySync(extension.extensionPath, dest);
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
const exclude = extension.exclude
|
|
90
|
+
.map(e => (0, glob_1.globSync)(path.join(extension.extensionPath, e)))
|
|
91
|
+
.flatMap(e => e);
|
|
92
|
+
fs.copySync(extension.extensionPath, dest, {
|
|
93
|
+
filter: name => name === extension.extensionPath || exclude.every(e => e !== name),
|
|
94
|
+
});
|
|
71
95
|
}
|
|
72
96
|
}
|
|
73
97
|
async function copyStaticAssets(outputPath, extensions) {
|
|
@@ -79,12 +103,12 @@ async function copyStaticAssets(outputPath, extensions) {
|
|
|
79
103
|
}
|
|
80
104
|
}
|
|
81
105
|
}
|
|
82
|
-
async function addGlobalStyles(outputPath,
|
|
106
|
+
async function addGlobalStyles(outputPath, globalStylesExtensions, sassVariableOverridesExtension) {
|
|
83
107
|
const globalStylesDir = path.join(outputPath, 'src', constants_1.GLOBAL_STYLES_OUTPUT_DIR);
|
|
84
108
|
await fs.remove(globalStylesDir);
|
|
85
109
|
await fs.ensureDir(globalStylesDir);
|
|
86
110
|
const imports = [];
|
|
87
|
-
for (const extension of
|
|
111
|
+
for (const extension of globalStylesExtensions) {
|
|
88
112
|
const styleFiles = Array.isArray(extension.globalStyles)
|
|
89
113
|
? extension.globalStyles
|
|
90
114
|
: [extension.globalStyles];
|
|
@@ -93,7 +117,14 @@ async function addGlobalStyles(outputPath, extensions) {
|
|
|
93
117
|
imports.push(path.basename(styleFile, path.extname(styleFile)));
|
|
94
118
|
}
|
|
95
119
|
}
|
|
96
|
-
|
|
120
|
+
let overridesImport = '';
|
|
121
|
+
if (sassVariableOverridesExtension) {
|
|
122
|
+
const overridesFile = sassVariableOverridesExtension.sassVariableOverrides;
|
|
123
|
+
await copyGlobalStyleFile(outputPath, overridesFile);
|
|
124
|
+
overridesImport = `@import "./${constants_1.GLOBAL_STYLES_OUTPUT_DIR}/${path.basename(overridesFile, path.extname(overridesFile))}";\n`;
|
|
125
|
+
}
|
|
126
|
+
const globalStylesSource = overridesImport +
|
|
127
|
+
'@import "./styles/styles";\n' +
|
|
97
128
|
imports.map(file => `@import "./${constants_1.GLOBAL_STYLES_OUTPUT_DIR}/${file}";`).join('\n');
|
|
98
129
|
const globalStylesFile = path.join(outputPath, 'src', 'global-styles.scss');
|
|
99
130
|
await fs.writeFile(globalStylesFile, globalStylesSource, 'utf-8');
|
|
@@ -144,13 +175,14 @@ function getModuleFilePath(id, module) {
|
|
|
144
175
|
return `./extensions/${id}/${path.basename(module.ngModuleFileName, '.ts')}`;
|
|
145
176
|
}
|
|
146
177
|
/**
|
|
147
|
-
*
|
|
148
|
-
*
|
|
178
|
+
* Copies the Admin UI sources & static assets to the outputPath if it does not already
|
|
179
|
+
* exist there.
|
|
149
180
|
*/
|
|
150
|
-
function copyAdminUiSource(outputPath) {
|
|
151
|
-
const
|
|
152
|
-
const
|
|
153
|
-
if (fs.existsSync(
|
|
181
|
+
function copyAdminUiSource(outputPath, modulePathMapping) {
|
|
182
|
+
const tsconfigFilePath = path.join(outputPath, 'tsconfig.json');
|
|
183
|
+
const indexFilePath = path.join(outputPath, '/src/index.html');
|
|
184
|
+
if (fs.existsSync(tsconfigFilePath) && fs.existsSync(indexFilePath)) {
|
|
185
|
+
configureModulePathMapping(tsconfigFilePath, modulePathMapping);
|
|
154
186
|
return;
|
|
155
187
|
}
|
|
156
188
|
const scaffoldDir = path.join(__dirname, '../scaffold');
|
|
@@ -165,55 +197,29 @@ function copyAdminUiSource(outputPath) {
|
|
|
165
197
|
fs.removeSync(outputPath);
|
|
166
198
|
fs.ensureDirSync(outputPath);
|
|
167
199
|
fs.copySync(scaffoldDir, outputPath);
|
|
200
|
+
configureModulePathMapping(tsconfigFilePath, modulePathMapping);
|
|
168
201
|
// copy source files from admin-ui package
|
|
169
202
|
const outputSrc = path.join(outputPath, 'src');
|
|
170
203
|
fs.ensureDirSync(outputSrc);
|
|
171
204
|
fs.copySync(adminUiSrc, outputSrc);
|
|
172
205
|
}
|
|
206
|
+
async function setBaseHref(outputPath, baseHref) {
|
|
207
|
+
const angularJsonFilePath = path.join(outputPath, '/angular.json');
|
|
208
|
+
const angularJson = await fs.readJSON(angularJsonFilePath, 'utf-8');
|
|
209
|
+
angularJson.projects['vendure-admin'].architect.build.options.baseHref = baseHref;
|
|
210
|
+
await fs.writeJSON(angularJsonFilePath, angularJson, { spaces: 2 });
|
|
211
|
+
}
|
|
212
|
+
exports.setBaseHref = setBaseHref;
|
|
173
213
|
/**
|
|
174
|
-
*
|
|
175
|
-
* attemps to run it. This is done this way because attempting to run ngcc from a sub-directory
|
|
176
|
-
* where the angular libs are in a higher-level node_modules folder currently results in the error
|
|
177
|
-
* NG6002, see https://github.com/angular/angular/issues/35747.
|
|
178
|
-
*
|
|
179
|
-
* However, when ngcc is run from the root, it works.
|
|
214
|
+
* Adds module path mapping to the bundled tsconfig.json file if defined as a UI extension.
|
|
180
215
|
*/
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
if (!coreUmdFile) {
|
|
184
|
-
utils_1.logger.error(`Could not resolve the "@vendure/admin-ui/core" package!`);
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
// ngcc creates a particular folder after it has been run once
|
|
188
|
-
const ivyDir = path.join(coreUmdFile, '../..', '__ivy_ngcc__');
|
|
189
|
-
if (fs.existsSync(ivyDir)) {
|
|
216
|
+
function configureModulePathMapping(tsconfigFilePath, modulePathMapping) {
|
|
217
|
+
if (!modulePathMapping) {
|
|
190
218
|
return;
|
|
191
219
|
}
|
|
192
|
-
//
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
'(this is only needed on the first run)...');
|
|
197
|
-
const cmd = (0, utils_1.shouldUseYarn)() ? 'yarn' : 'npx';
|
|
198
|
-
const ngccProcess = (0, child_process_1.spawn)(cmd, [
|
|
199
|
-
'ngcc',
|
|
200
|
-
'--properties es2015 browser module main',
|
|
201
|
-
'--first-only',
|
|
202
|
-
'--create-ivy-entry-points',
|
|
203
|
-
'-l=error',
|
|
204
|
-
], {
|
|
205
|
-
cwd: rootDir,
|
|
206
|
-
shell: true,
|
|
207
|
-
stdio: 'inherit',
|
|
208
|
-
});
|
|
209
|
-
ngccProcess.on('close', code => {
|
|
210
|
-
if (code !== 0) {
|
|
211
|
-
reject(code);
|
|
212
|
-
}
|
|
213
|
-
else {
|
|
214
|
-
resolve();
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
});
|
|
220
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
221
|
+
const tsconfig = require(tsconfigFilePath);
|
|
222
|
+
tsconfig.compilerOptions.paths = modulePathMapping;
|
|
223
|
+
fs.writeFileSync(tsconfigFilePath, JSON.stringify(tsconfig, null, 2));
|
|
218
224
|
}
|
|
219
225
|
//# sourceMappingURL=scaffold.js.map
|
package/compiler/scaffold.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../src/compiler/scaffold.ts"],"names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AC,aAAa,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC1E,CAAC"}
|
package/compiler/translations.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -18,13 +22,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
18
22
|
__setModuleDefault(result, mod);
|
|
19
23
|
return result;
|
|
20
24
|
};
|
|
21
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
-
};
|
|
24
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
26
|
exports.mergeExtensionTranslations = exports.getAllTranslationFiles = void 0;
|
|
26
27
|
const fs = __importStar(require("fs-extra"));
|
|
27
|
-
const glob_1 =
|
|
28
|
+
const glob_1 = require("glob");
|
|
28
29
|
const path = __importStar(require("path"));
|
|
29
30
|
const utils_1 = require("./utils");
|
|
30
31
|
/**
|
|
@@ -42,7 +43,7 @@ function getAllTranslationFiles(extensions) {
|
|
|
42
43
|
allTranslationsWithGlobs[code] = [globPattern];
|
|
43
44
|
}
|
|
44
45
|
else {
|
|
45
|
-
//
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
46
47
|
allTranslationsWithGlobs[code].push(globPattern);
|
|
47
48
|
}
|
|
48
49
|
}
|
|
@@ -56,8 +57,8 @@ function getAllTranslationFiles(extensions) {
|
|
|
56
57
|
continue;
|
|
57
58
|
}
|
|
58
59
|
for (const pattern of globs) {
|
|
59
|
-
const files = glob_1.
|
|
60
|
-
//
|
|
60
|
+
const files = (0, glob_1.globSync)(pattern);
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
61
62
|
allTranslationsWithFiles[code].push(...files);
|
|
62
63
|
}
|
|
63
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.js","sourceRoot":"","sources":["../src/compiler/translations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translations.js","sourceRoot":"","sources":["../src/compiler/translations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAA+B;AAC/B,+BAAgC;AAChC,2CAA6B;AAG7B,mCAAiC;AAEjC;;;GAGG;AACH,SAAgB,sBAAsB,CAAC,UAAkC;IAGrE,sCAAsC;IACtC,MAAM,wBAAwB,GAAkD,EAAE,CAAC;IACnF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;QAChC,KAAK,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,YAAY,IAAI,EAAE,CAAC,EAAE;YACpF,MAAM,IAAI,GAAG,YAA4B,CAAC;YAC1C,IAAI,WAAW,EAAE;gBACb,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE;oBACjC,wBAAwB,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;iBAClD;qBAAM;oBACH,oEAAoE;oBACpE,wBAAwB,CAAC,IAAI,CAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;iBACrD;aACJ;SACJ;KACJ;IAED,MAAM,wBAAwB,GAAkD,EAAE,CAAC;IAEn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,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAChD,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACrE,MAAM,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC;KAClC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;;;GAGG;AACH,SAAS,iBAAiB,CAAC,EAAgB,EAAE,EAAgB;IACzD,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC;IACzB,KAAK,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;QACtD,MAAM,CAAC,OAAO,CAAC,GAAG;YACd,GAAG,EAAE,CAAC,OAAO,CAAC;YACd,GAAG,YAAY;SAClB,CAAC;KACL;IACD,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
package/compiler/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LanguageCode } from '@vendure/common/lib/generated-types';
|
|
2
|
-
export
|
|
2
|
+
export type Extension = AdminUiExtension | TranslationExtension | StaticAssetExtension | GlobalStylesExtension | SassVariableOverridesExtension;
|
|
3
3
|
/**
|
|
4
4
|
* @description
|
|
5
5
|
* Defines extensions to the Admin UI translations. Can be used as a stand-alone extension definition which only adds translations
|
|
@@ -58,6 +58,21 @@ export interface GlobalStylesExtension {
|
|
|
58
58
|
*/
|
|
59
59
|
globalStyles: string[] | string;
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* @description
|
|
63
|
+
* Defines an extension which allows overriding Clarity Design System's Sass variables used in styles on the Admin UI.
|
|
64
|
+
*
|
|
65
|
+
* @docsCategory UiDevkit
|
|
66
|
+
* @docsPage AdminUiExtension
|
|
67
|
+
*/
|
|
68
|
+
export interface SassVariableOverridesExtension {
|
|
69
|
+
/**
|
|
70
|
+
* @description
|
|
71
|
+
* Specifies a path to a Sass style file containing variable declarations, which will take precedence over
|
|
72
|
+
* default values defined in Clarity.
|
|
73
|
+
*/
|
|
74
|
+
sassVariableOverrides: string;
|
|
75
|
+
}
|
|
61
76
|
/**
|
|
62
77
|
* @description
|
|
63
78
|
* Defines extensions to the Admin UI application by specifying additional
|
|
@@ -90,6 +105,103 @@ export interface AdminUiExtension extends Partial<TranslationExtension>, Partial
|
|
|
90
105
|
* One or more Angular modules which extend the default Admin UI.
|
|
91
106
|
*/
|
|
92
107
|
ngModules: Array<AdminUiExtensionSharedModule | AdminUiExtensionLazyModule>;
|
|
108
|
+
/**
|
|
109
|
+
* @description
|
|
110
|
+
* An optional alias for the module so it can be referenced by other UI extension modules.
|
|
111
|
+
*
|
|
112
|
+
* By default, Angular modules declared in an AdminUiExtension do not have access to code outside the directory
|
|
113
|
+
* defined by the `extensionPath`. A scenario in which that can be useful though is in a monorepo codebase where
|
|
114
|
+
* a common NgModule is shared across different plugins, each defined in its own package. An example can be found
|
|
115
|
+
* below - note that the main `tsconfig.json` also maps the target module but using a path relative to the project's
|
|
116
|
+
* root folder. The UI module is not part of the main TypeScript build task as explained in
|
|
117
|
+
* [Extending the Admin UI](https://www.vendure.io/docs/plugins/extending-the-admin-ui/) but having `paths`
|
|
118
|
+
* properly configured helps with usual IDE code editing features such as code completion and quick navigation, as
|
|
119
|
+
* well as linting.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```ts
|
|
123
|
+
* // packages/common-ui-module/src/ui/ui-shared.module.ts
|
|
124
|
+
* import { NgModule } from '\@angular/core';
|
|
125
|
+
* import { SharedModule } from '\@vendure/admin-ui/core';
|
|
126
|
+
* import { CommonUiComponent } from './components/common-ui/common-ui.component';
|
|
127
|
+
*
|
|
128
|
+
* export { CommonUiComponent };
|
|
129
|
+
*
|
|
130
|
+
* \@NgModule({
|
|
131
|
+
* imports: [SharedModule],
|
|
132
|
+
* exports: [CommonUiComponent],
|
|
133
|
+
* declarations: [CommonUiComponent],
|
|
134
|
+
* })
|
|
135
|
+
* export class CommonSharedUiModule {}
|
|
136
|
+
* ```
|
|
137
|
+
*
|
|
138
|
+
* ```ts
|
|
139
|
+
* // packages/common-ui-module/src/index.ts
|
|
140
|
+
* import path from 'path';
|
|
141
|
+
*
|
|
142
|
+
* import { AdminUiExtension } from '\@vendure/ui-devkit/compiler';
|
|
143
|
+
*
|
|
144
|
+
* export const uiExtensions: AdminUiExtension = {
|
|
145
|
+
* pathAlias: '\@common-ui-module', // this is the important part
|
|
146
|
+
* extensionPath: path.join(__dirname, 'ui'),
|
|
147
|
+
* ngModules: [
|
|
148
|
+
* {
|
|
149
|
+
* type: 'shared' as const,
|
|
150
|
+
* ngModuleFileName: 'ui-shared.module.ts',
|
|
151
|
+
* ngModuleName: 'CommonSharedUiModule',
|
|
152
|
+
* },
|
|
153
|
+
* ],
|
|
154
|
+
* };
|
|
155
|
+
* ```
|
|
156
|
+
*
|
|
157
|
+
* ```json
|
|
158
|
+
* // tsconfig.json
|
|
159
|
+
* {
|
|
160
|
+
* "compilerOptions": {
|
|
161
|
+
* "baseUrl": ".",
|
|
162
|
+
* "paths": {
|
|
163
|
+
* "\@common-ui-module/*": ["packages/common-ui-module/src/ui/*"]
|
|
164
|
+
* }
|
|
165
|
+
* }
|
|
166
|
+
* }
|
|
167
|
+
* ```
|
|
168
|
+
*
|
|
169
|
+
* ```ts
|
|
170
|
+
* // packages/sample-plugin/src/ui/ui-extension.module.ts
|
|
171
|
+
* import { NgModule } from '\@angular/core';
|
|
172
|
+
* import { SharedModule } from '\@vendure/admin-ui/core';
|
|
173
|
+
* // the import below works both in the context of the custom Admin UI app as well as the main project
|
|
174
|
+
* // '\@common-ui-module' is the value of "pathAlias" and 'ui-shared.module' is the file we want to reference inside "extensionPath"
|
|
175
|
+
* import { CommonSharedUiModule, CommonUiComponent } from '\@common-ui-module/ui-shared.module';
|
|
176
|
+
*
|
|
177
|
+
* \@NgModule({
|
|
178
|
+
* imports: [
|
|
179
|
+
* SharedModule,
|
|
180
|
+
* CommonSharedUiModule,
|
|
181
|
+
* RouterModule.forChild([
|
|
182
|
+
* {
|
|
183
|
+
* path: '',
|
|
184
|
+
* pathMatch: 'full',
|
|
185
|
+
* component: CommonUiComponent,
|
|
186
|
+
* },
|
|
187
|
+
* ]),
|
|
188
|
+
* ],
|
|
189
|
+
* })
|
|
190
|
+
* export class SampleUiExtensionModule {}
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
pathAlias?: string;
|
|
194
|
+
/**
|
|
195
|
+
* @description
|
|
196
|
+
* Optional array specifying filenames or [glob](https://github.com/isaacs/node-glob) patterns that should
|
|
197
|
+
* be skipped when copying the directory defined by `extensionPath`.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```ts
|
|
201
|
+
* exclude: ['**\/*.spec.ts']
|
|
202
|
+
* ```
|
|
203
|
+
*/
|
|
204
|
+
exclude?: string[];
|
|
93
205
|
}
|
|
94
206
|
/**
|
|
95
207
|
* @description
|
|
@@ -99,7 +211,7 @@ export interface AdminUiExtension extends Partial<TranslationExtension>, Partial
|
|
|
99
211
|
* @docsCategory UiDevkit
|
|
100
212
|
* @docsPage AdminUiExtension
|
|
101
213
|
*/
|
|
102
|
-
export
|
|
214
|
+
export type StaticAssetDefinition = string | {
|
|
103
215
|
path: string;
|
|
104
216
|
rename: string;
|
|
105
217
|
};
|
|
@@ -167,7 +279,7 @@ export interface AdminUiExtensionLazyModule {
|
|
|
167
279
|
*
|
|
168
280
|
* @docsCategory UiDevkit
|
|
169
281
|
*/
|
|
170
|
-
export
|
|
282
|
+
export type UiExtensionCompilerProcessArgument = string | [string, any];
|
|
171
283
|
/**
|
|
172
284
|
* @description
|
|
173
285
|
* Options to configure how the Admin UI should be compiled.
|
|
@@ -202,6 +314,23 @@ export interface UiExtensionCompilerOptions {
|
|
|
202
314
|
* of the app, for example with the default value of `'/admin/'`, the Admin UI app
|
|
203
315
|
* will be configured to be served from `http://<host>/admin/`.
|
|
204
316
|
*
|
|
317
|
+
* Note: if you are using this in conjunction with the {@link AdminUiPlugin} then you should
|
|
318
|
+
* also set the `route` option to match this value.
|
|
319
|
+
*
|
|
320
|
+
* @example
|
|
321
|
+
* ```TypeScript
|
|
322
|
+
* AdminUiPlugin.init({
|
|
323
|
+
* route: 'my-route',
|
|
324
|
+
* port: 5001,
|
|
325
|
+
* app: compileUiExtensions({
|
|
326
|
+
* baseHref: '/my-route/',
|
|
327
|
+
* outputPath: path.join(__dirname, './custom-admin-ui'),
|
|
328
|
+
* extensions: [],
|
|
329
|
+
* devMode: true,
|
|
330
|
+
* }),
|
|
331
|
+
* }),
|
|
332
|
+
* ```
|
|
333
|
+
*
|
|
205
334
|
* @default '/admin/'
|
|
206
335
|
*/
|
|
207
336
|
baseHref?: string;
|
|
@@ -236,7 +365,7 @@ export interface UiExtensionCompilerOptions {
|
|
|
236
365
|
*/
|
|
237
366
|
additionalProcessArguments?: UiExtensionCompilerProcessArgument[];
|
|
238
367
|
}
|
|
239
|
-
export
|
|
368
|
+
export type Translations = {
|
|
240
369
|
[section: string]: {
|
|
241
370
|
[token: string]: string;
|
|
242
371
|
};
|
|
@@ -246,3 +375,6 @@ export interface BrandingOptions {
|
|
|
246
375
|
largeLogoPath?: string;
|
|
247
376
|
faviconPath?: string;
|
|
248
377
|
}
|
|
378
|
+
export interface AdminUiExtensionWithId extends AdminUiExtension {
|
|
379
|
+
id: string;
|
|
380
|
+
}
|
package/compiler/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AdminUiExtension, Extension, GlobalStylesExtension, StaticAssetDefinition, StaticAssetExtension, TranslationExtension } from './types';
|
|
1
|
+
import { AdminUiExtension, AdminUiExtensionWithId, Extension, GlobalStylesExtension, SassVariableOverridesExtension, StaticAssetDefinition, StaticAssetExtension, TranslationExtension } from './types';
|
|
2
2
|
export declare const logger: {
|
|
3
3
|
log: (message: string) => void;
|
|
4
4
|
error: (message: string) => void;
|
|
@@ -26,8 +26,9 @@ export declare function copyStaticAsset(outputPath: string, staticAssetDef: Stat
|
|
|
26
26
|
* If not defined by the user, a deterministic ID is generated
|
|
27
27
|
* from a hash of the extension config.
|
|
28
28
|
*/
|
|
29
|
-
export declare function normalizeExtensions(extensions?: AdminUiExtension[]):
|
|
29
|
+
export declare function normalizeExtensions(extensions?: AdminUiExtension[]): AdminUiExtensionWithId[];
|
|
30
30
|
export declare function isAdminUiExtension(input: Extension): input is AdminUiExtension;
|
|
31
31
|
export declare function isTranslationExtension(input: Extension): input is TranslationExtension;
|
|
32
32
|
export declare function isStaticAssetExtension(input: Extension): input is StaticAssetExtension;
|
|
33
33
|
export declare function isGlobalStylesExtension(input: Extension): input is GlobalStylesExtension;
|
|
34
|
+
export declare function isSassVariableOverridesExtension(input: Extension): input is SassVariableOverridesExtension;
|
package/compiler/utils.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -22,8 +26,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
27
|
};
|
|
24
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.isGlobalStylesExtension = exports.isStaticAssetExtension = exports.isTranslationExtension = exports.isAdminUiExtension = exports.normalizeExtensions = exports.copyStaticAsset = exports.copyUiDevkit = exports.getStaticAssetPath = exports.shouldUseYarn = exports.logger = void 0;
|
|
26
|
-
/*
|
|
29
|
+
exports.isSassVariableOverridesExtension = exports.isGlobalStylesExtension = exports.isStaticAssetExtension = exports.isTranslationExtension = exports.isAdminUiExtension = exports.normalizeExtensions = exports.copyStaticAsset = exports.copyUiDevkit = exports.getStaticAssetPath = exports.shouldUseYarn = exports.logger = void 0;
|
|
30
|
+
/* eslint-disable no-console */
|
|
27
31
|
const chalk_1 = __importDefault(require("chalk"));
|
|
28
32
|
const child_process_1 = require("child_process");
|
|
29
33
|
const crypto_1 = require("crypto");
|
|
@@ -70,9 +74,8 @@ exports.copyUiDevkit = copyUiDevkit;
|
|
|
70
74
|
*/
|
|
71
75
|
async function copyStaticAsset(outputPath, staticAssetDef) {
|
|
72
76
|
const staticAssetPath = getStaticAssetPath(staticAssetDef);
|
|
73
|
-
let assetOutputPath;
|
|
74
77
|
const assetBasename = path.basename(staticAssetPath);
|
|
75
|
-
assetOutputPath = path.join(outputPath, constants_1.STATIC_ASSETS_OUTPUT_DIR, assetBasename);
|
|
78
|
+
const assetOutputPath = path.join(outputPath, constants_1.STATIC_ASSETS_OUTPUT_DIR, assetBasename);
|
|
76
79
|
fs.copySync(staticAssetPath, assetOutputPath);
|
|
77
80
|
if (typeof staticAssetDef !== 'string') {
|
|
78
81
|
// The asset is being renamed
|
|
@@ -122,4 +125,8 @@ function isGlobalStylesExtension(input) {
|
|
|
122
125
|
return input.hasOwnProperty('globalStyles');
|
|
123
126
|
}
|
|
124
127
|
exports.isGlobalStylesExtension = isGlobalStylesExtension;
|
|
128
|
+
function isSassVariableOverridesExtension(input) {
|
|
129
|
+
return input.hasOwnProperty('sassVariableOverrides');
|
|
130
|
+
}
|
|
131
|
+
exports.isSassVariableOverridesExtension = isSassVariableOverridesExtension;
|
|
125
132
|
//# sourceMappingURL=utils.js.map
|
package/compiler/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/compiler/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/compiler/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA+B;AAC/B,kDAA0B;AAC1B,iDAAyC;AACzC,mCAAoC;AACpC,6CAA+B;AAC/B,2CAA6B;AAE7B,2CAAuD;AAY1C,QAAA,MAAM,GAAG;IAClB,GAAG,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3D,KAAK,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CAC9D,CAAC;AAEF;;GAEG;AACH,SAAgB,aAAa;IACzB,IAAI;QACA,IAAA,wBAAQ,EAAC,mBAAmB,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC;KACf;IAAC,OAAO,CAAM,EAAE;QACb,OAAO,KAAK,CAAC;KAChB;AACL,CAAC;AAPD,sCAOC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAC,cAAqC;IACpE,OAAO,OAAO,cAAc,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC;AACrF,CAAC;AAFD,gDAEC;AAED;;GAEG;AACH,SAAgB,YAAY,CAAC,UAAkB;IAC3C,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,oCAAwB,EAAE,QAAQ,CAAC,CA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
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"gitHead": "817b49e80bbfe6f1feeda1cdab0be45d887e689f"
|
|
2
|
+
"name": "@vendure/ui-devkit",
|
|
3
|
+
"version": "2.0.0",
|
|
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.mjs --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.mjs -w",
|
|
33
|
+
"lint": "eslint --fix ."
|
|
34
|
+
},
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/vendure-ecommerce/vendure/issues"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@angular-devkit/build-angular": "^16.0.3",
|
|
40
|
+
"@angular/cli": "^16.0.3",
|
|
41
|
+
"@angular/compiler": "^16.0.3",
|
|
42
|
+
"@angular/compiler-cli": "^16.0.3",
|
|
43
|
+
"@vendure/admin-ui": "^2.0.0",
|
|
44
|
+
"@vendure/common": "^2.0.0",
|
|
45
|
+
"chalk": "^4.1.0",
|
|
46
|
+
"chokidar": "^3.5.1",
|
|
47
|
+
"fs-extra": "^10.0.0",
|
|
48
|
+
"glob": "^9.2.1",
|
|
49
|
+
"rxjs": "^7.5.4"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
53
|
+
"@types/fs-extra": "^11.0.1",
|
|
54
|
+
"@vendure/core": "^2.0.0",
|
|
55
|
+
"rimraf": "^3.0.2",
|
|
56
|
+
"rollup": "^3.18.0",
|
|
57
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
58
|
+
"rollup-plugin-typescript2": "^0.34.1",
|
|
59
|
+
"tslib": "^2.5.0",
|
|
60
|
+
"typescript": "4.9.5"
|
|
61
|
+
},
|
|
62
|
+
"gitHead": "302bd68796e0136f70dd199369616d362c920ea4"
|
|
64
63
|
}
|
package/scaffold/angular.json
CHANGED
|
@@ -50,15 +50,27 @@
|
|
|
50
50
|
],
|
|
51
51
|
"stylePreprocessorOptions": {
|
|
52
52
|
"includePaths": [
|
|
53
|
-
"./src/styles"
|
|
53
|
+
"./src/styles",
|
|
54
|
+
"./src/fonts"
|
|
54
55
|
]
|
|
55
56
|
},
|
|
56
57
|
"allowedCommonJsDependencies": [
|
|
57
58
|
"graphql-tag",
|
|
58
59
|
"zen-observable",
|
|
59
60
|
"lodash",
|
|
61
|
+
"dayjs",
|
|
60
62
|
"apollo-upload-client",
|
|
61
|
-
"@
|
|
63
|
+
"@clr/icons",
|
|
64
|
+
"@clr/icons/shapes/all-shapes",
|
|
65
|
+
"@vendure/common/lib/generated-types",
|
|
66
|
+
"@vendure/common/lib/simple-deep-clone",
|
|
67
|
+
"@vendure/common/lib/shared-constants",
|
|
68
|
+
"@vendure/common/lib/shared-utils",
|
|
69
|
+
"@vendure/common/lib/normalize-string",
|
|
70
|
+
"@vendure/common/lib/unique",
|
|
71
|
+
"@vendure/common/lib/omit",
|
|
72
|
+
"@vendure/common/lib/pick",
|
|
73
|
+
"@messageformat/core"
|
|
62
74
|
],
|
|
63
75
|
"vendorChunk": true,
|
|
64
76
|
"extractLicenses": false,
|
|
@@ -103,7 +115,6 @@
|
|
|
103
115
|
}
|
|
104
116
|
}
|
|
105
117
|
},
|
|
106
|
-
"defaultProject": "vendure-admin",
|
|
107
118
|
"schematics": {
|
|
108
119
|
"@schematics/angular:component": {
|
|
109
120
|
"skipTests": true,
|
package/scaffold/src/main.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "./styles";
|
package/scaffold/tsconfig.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"baseUrl": "./",
|
|
5
5
|
"importHelpers": true,
|
|
6
|
-
"module": "
|
|
6
|
+
"module": "es2020",
|
|
7
7
|
"outDir": "./dist/out-tsc",
|
|
8
8
|
"sourceMap": true,
|
|
9
9
|
"declaration": false,
|
|
@@ -12,15 +12,16 @@
|
|
|
12
12
|
"strict": true,
|
|
13
13
|
"noImplicitAny": false,
|
|
14
14
|
"strictPropertyInitialization": false,
|
|
15
|
-
"target": "
|
|
15
|
+
"target": "ES2022",
|
|
16
16
|
"skipLibCheck": true,
|
|
17
17
|
"esModuleInterop": true,
|
|
18
18
|
"allowSyntheticDefaultImports": true,
|
|
19
19
|
"typeRoots": [],
|
|
20
20
|
"lib": [
|
|
21
|
-
"
|
|
21
|
+
"es2019",
|
|
22
22
|
"dom",
|
|
23
23
|
"esnext.asynciterable"
|
|
24
|
-
]
|
|
24
|
+
],
|
|
25
|
+
"useDefineForClassFields": false
|
|
25
26
|
}
|
|
26
27
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import "./styles/styles";
|