Socket
Socket
Sign inDemoInstall

@adobe/aem-spa-component-mapping

Package Overview
Dependencies
Maintainers
78
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adobe/aem-spa-component-mapping - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

7

CHANGELOG.md

@@ -0,1 +1,8 @@

## [1.0.6](https://github.com/adobe/aem-spa-component-mapping/compare/v1.0.5...v1.0.6) (2020-09-27)
### Bug Fixes
* remove project and documentation clutter ([#27](https://github.com/adobe/aem-spa-component-mapping/issues/27)) ([19ece68](https://github.com/adobe/aem-spa-component-mapping/commit/19ece684cfaa835c0c045018f643297b4d70e974))
## [1.0.5](https://github.com/adobe/aem-spa-component-mapping/compare/v1.0.4...v1.0.5) (2020-08-31)

@@ -2,0 +9,0 @@

2

dist/aem-spa-component-mapping.js

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.cqSpaComponentMapping=e():t.cqSpaComponentMapping=e()}(function(){try{return"undefined"!=typeof self}catch(t){return!1}}()?self:this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";let r;n.r(e),n.d(e,"ComponentMapping",(function(){return o})),n.d(e,"MapTo",(function(){return u}));class o{constructor(){return r||(r=this),r}static get instance(){return new this}map(t,e){o.map(t,e)}static map(t,e){if(t&&e){("string"==typeof t?[t]:t).forEach(t=>{this.mapping[t]=e})}}get(t){return o.get(t)}static get(t){return this.mapping[t]}}function u(t){return e=>o.instance.map(t,e)}o.mapping={}}])}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.aemSpaComponentMapping=t():e.aemSpaComponentMapping=t()}(function(){try{return"undefined"!=typeof self}catch(e){return!1}}()?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";let r;n.r(t),n.d(t,"ComponentMapping",(function(){return o})),n.d(t,"MapTo",(function(){return u}));class o{constructor(){return r||(r=this),r}static get instance(){return new this}map(e,t){o.map(e,t)}static map(e,t){if(e&&t){("string"==typeof e?[e]:e).forEach(e=>{this.mapping[e]=t})}}get(e){return o.get(e)}static get(e){return this.mapping[e]}}o.mapping={};const u=e=>t=>o.instance.map(e,t)}])}));
//# sourceMappingURL=aem-spa-component-mapping.js.map
/**
* ComponentMapping instance.
* ComponentMapping interface.
* @private
*/
interface ComponentMappingObject {
[key: string]: any;
[key: string]: unknown;
}

@@ -11,2 +11,3 @@ /**

* JavaScript component class.
* @private
*/

@@ -19,33 +20,46 @@ declare class ComponentMappingImpl {

* Creates mapping for given resource type(s) and a component class.
*
* @param {string|array} resourceTypes - resource type(s)
* @param {object} clazz - component class that should be associated with given resource type(s)
*
* @param resourceTypes Resource type(s).
* @param clazz Component class that will be associated with given resource type(s).
* @protected
*/
map(resourceTypes: string | string[], clazz: any): void;
static map(resourceTypes: string | string[], clazz: any): void;
map(resourceTypes: string | string[], clazz: unknown): void;
/**
* Returns object (or undefined) matching with given resource type.
*
* @param {string} resourceType - resource type
* @returns {object|undefined} - class associated with given resource type
* Creates mapping for given resource type(s) and a component class.
* @param resourceTypes Resource type(s).
* @param clazz Component class that will be associated with given resource type(s).
* @protected
*/
get(resourceType: string): any | undefined;
static map(resourceTypes: string | string[], clazz: unknown): void;
/**
* Returns object (or undefined) matching with given resource type.
*
* @param {string} resourceType - resource type
* @returns {object|undefined} - class associated with given resource type
* Returns object (or `undefined`) matching with given resource type.
* @param resourceType Resource type.
* @returns Class associated with given resource type or `undefined`.
*/
static get(resourceType: string): any | undefined;
get(resourceType: string): any;
/**
* Returns object (or `undefined`) matching with given resource type.
* @param resourceType Resource type.
* @returns Class associated with given resource type or `undefined`.
*/
static get(resourceType: string): any;
}
/**
* Helper function that can be used to map a class to given resource type(s).
* Use to register resource types to Class mapping.
*
* @param {string|array} resourceTypes - resource type(s)
* @returns {function} - function meant to map a class with the previously given resource types
* Example:
* ```
* import { MapTo } from '@adobe/aem-spa-component-mapping';
*
* class MyComponent {
* ...
* }
*
* export default MapTo('my/resource/type')(MyComponent);
* ```
*
* @param resourceTypes AEM resource type(s).
* @returns Function mapping a class with the given resource types.
*/
declare function MapTo(resourceTypes: string | string[]): (clazz: any) => void;
declare const MapTo: (resourceTypes: string | string[]) => (clazz: unknown) => void;
export { ComponentMappingImpl as ComponentMapping, MapTo };
//# sourceMappingURL=ComponentMapping.d.ts.map

@@ -1,2 +0,2 @@

export * from './ComponentMapping';
export { ComponentMapping, MapTo } from './ComponentMapping';
//# sourceMappingURL=types.d.ts.map
{
"name": "@adobe/aem-spa-component-mapping",
"version": "1.0.5",
"repository": {
"type": "git",
"url": "https://github.com/adobe/aem-spa-component-mapping.git"
},
"auto-changelog": {
"template": "templates/CHANGELOG.hbs"
},
"version": "1.0.6",
"description": "Provides a mapping of SPA front-end components to AEM resource types.",
"keywords": [
"spa",
"aem",
"component-mapping",
"adobe"
],
"author": "Adobe Systems Inc. <sitexpci@adobe.com>",
"license": "Apache-2.0",
"repository": "github:adobe/aem-spa-component-mapping",
"homepage": "https://docs.adobe.com/content/help/en/experience-manager-65/developing/headless/spas/spa-reference-materials.html",
"bugs": {
"url": "https://www.adobe.com/go/aem6_4_support_en"
"url": "https://github.com/adobe/aem-spa-component-mapping/issues"
},
"engines": {
"npm": ">=5.5.1"
"npm": ">=6.14.8",
"node": ">=13.10.1"
},
"files": [
"dist/"
],
"homepage": "https://www.adobe.com/go/aem6_4_docs_spa_en",
"keywords": [
"the official",
"adobe",
"aem",
"spa editor",
"experience manager",
"marketing cloud",
"cq",
"componentmapping"
],
"main": "dist/aem-spa-component-mapping.js",
"types": "dist/types.d.ts",
"scripts": {
"clean": "rm -rf coverage/ dist/",
"linter": "eslint --ext .js,.ts ./src && tslint --project tsconfig.json",
"linter:fix": "eslint --ext .js,.ts ./src --fix && tslint --project tsconfig.json --fix",
"test": "jest --clearCache && jest",
"build:production": "WP_ARGS=--mode=production npm run build",
"build:types": "tsc -p src/tsconfig.types.json",
"build": "npm run clean && npm run linter && webpack $WP_ARGS && npm run build:types",
"clean": "rm -rf dist/",
"docs": "npm i && npx typedoc --excludePrivate ./src --out ./dist/docs --mode file",
"linter": "eslint --ext .js,.ts .",
"semantic-release": "semantic-release",
"test:coverage": "jest --clearCache && jest --coverage",
"test:debug": "jest --coverage --watchAll",
"build": "npm run clean && npm run linter && webpack $WP_ARGS && npm run build:types",
"build:production": "WP_ARGS=--mode=production npm run build",
"build:types": "tsc -p src/tsconfig.types.json",
"docs": "doxdox \"src/**/*.+(js|jsx)\" --layout templates/DOCUMENTATION.hbs --output DOCUMENTATION.md",
"preversion": "npm run test && npm run build:production && npm run docs",
"version": "npm run docs && git add -A",
"postversion": "git push && git push --tags",
"semantic-release": "semantic-release"
"test": "jest --clearCache && jest"
},
"author": "Adobe Systems Inc.",
"license": "Apache-2.0",
"dependencies": {},
"optionalDependencies": {
"babel-polyfill": "^6.26.0"
},
"devDependencies": {
"@adobe/eslint-config-editorxp": "^1.0.1",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"@semantic-release/github": "^7.0.7",
"@types/jest": "^26.0.8",
"@types/node": "^14.0.27",
"@typescript-eslint/eslint-plugin": "^3.7.1",
"@typescript-eslint/parser": "^3.7.1",
"ajv": "^6.12.3",
"auto-changelog": "^2.2.0",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-loader": "^8.1.0",
"babel-plugin-istanbul": "^6.0.0",
"babel-plugin-transform-decorators": "6.24.1",
"babel-preset-env": "^1.7.0",
"@types/jest": "^26.0.14",
"@typescript-eslint/eslint-plugin": "^4.2.0",
"@typescript-eslint/parser": "^4.2.0",
"clean-webpack-plugin": "^3.0.0",
"commitizen": "^4.2.1",
"cz-conventional-changelog": "^3.3.0",
"doxdox": "^2.0.3",
"doxdox-plugin-markdown": "^2.0.0",
"eslint": "^7.6.0",
"inject-loader": "^4.0.1",
"istanbul": "^0.4.5",
"istanbul-instrumenter-loader": "^3.0.1",
"jest": "^26.2.2",
"jsdoc": "^3.6.5",
"eslint": "^7.9.0",
"jest": "^26.4.2",
"semantic-release": "^17.1.1",
"ts-jest": "^26.1.4",
"ts-loader": "^8.0.2",
"tslint": "^6.1.3",
"tslint-etc": "^1.13.0",
"typescript": "^3.9.7",
"webpack": "^4.44.1",
"ts-jest": "^26.4.0",
"ts-loader": "^8.0.4",
"typedoc": "^0.19.2",
"typescript": "^4.0.3",
"webpack": "^4.44.2",
"webpack-cli": "^3.3.12"
},
"files": [
"dist/**/*.{js,ts,map}",
"!**/{docs,coverage}/"
],
"config": {

@@ -95,3 +66,9 @@ "commitizen": {

}
},
"eslintConfig": {
"root": true,
"extends": [
"@adobe/eslint-config-editorxp/typescript"
]
}
}

@@ -1,10 +0,16 @@

# Table of contents
# AEM Component Mapping package
* [Installation](#installation)
* [Usage](#usage)
* [Documentation](#documentation)
* [Contributing](#contributing)
* [Licensing](#licensing)
[![License](https://img.shields.io/badge/license-Apache%202-blue)](https://github.com/adobe/aem-spa-component-mapping/blob/master/LICENSE)
[![NPM Version](https://img.shields.io/npm/v/@adobe/aem-spa-component-mapping.svg)](https://www.npmjs.com/package/@adobe/aem-spa-component-mapping)
[![Documentation](https://img.shields.io/badge/docs-api-blue)](https://opensource.adobe.com/aem-spa-component-mapping/globals.html)
[![codecov](https://codecov.io/gh/adobe/aem-spa-component-mapping/branch/master/graph/badge.svg)](https://codecov.io/gh/adobe/aem-spa-component-mapping)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=adobe_aem-spa-component-mapping&metric=alert_status)](https://sonarcloud.io/dashboard?id=adobe_aem-spa-component-mapping)
[![Known Vulnerabilities](https://snyk.io/test/github/adobe/aem-spa-component-mapping/badge.svg)](https://snyk.io/test/github/adobe/aem-spa-component-mapping)
[![Dependencies](https://badges.renovateapi.com/github/adobe/aem-spa-component-mapping?)](https://app.renovatebot.com/dashboard#github/adobe/aem-spa-component-mapping)
A storage library for front-end components. Provides a way for the Single Page Application to map front-end components to Adobe Experience Manager resource types (AEM Components). The SPA Editor is the recommended solution for projects that use a SPA framework (React or Angular).
For more information please see the [documentation](https://docs.adobe.com/content/help/en/experience-manager-65/developing/headless/spas/spa-dynamic-model-to-component-mapping.html).
## Installation

@@ -15,31 +21,15 @@ ```

## Usage
This module provides helpers to map resource types with SPA components.
### MapTo
The `MapTo` helper can be used to directly associate resource type(s) with a given SPA component.
```
import { MapTo } from '@adobe/spa-component-mapping';
class MyComponent {
...
}
export default MapTo('my/resource/type')(MyComponent);
```
## Documentation
The [technical documentation](https://www.adobe.com/go/aem6_4_docs_spa_en) is already available, but if you are unable to solve your problem or you found a bug you can always create an issue or through other means [contact us](https://www.adobe.com/go/aem6_4_support_en) and ask for help!
* [SPA Editor Overview](https://www.adobe.com/go/aem6_5_docs_spa_en)
* [SPA Architecture](https://docs.adobe.com/content/help/en/experience-manager-65/developing/headless/spas/spa-architecture.html)
* [Getting Started with the AEM SPA Editor and Angular](https://docs.adobe.com/content/help/en/experience-manager-learn/spa-angular-tutorial/overview.html)
* [Getting Started with the AEM SPA Editor and React](https://docs.adobe.com/content/help/en/experience-manager-learn/spa-react-tutorial/overview.html)
### Contributing
## Contributing
Contributions are welcome! Read the [Contributing Guide](CONTRIBUTING.md) for more information.
### Licensing
## Licensing
This project is licensed under the Apache V2 License. See [LICENSE](LICENSE) for more information.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc