Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"env": {
"test": {
"presets": [
"@babel/preset-env"
]
}
}
}
2 changes: 0 additions & 2 deletions .browserslistrc

This file was deleted.

1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
steps:
- checkout
- node/install-packages
- run: npm run lint
- run: npm test
- run: bash <(curl -s https://codecov.io/bash)
workflows:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/workflows/npm-semantic-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: |
git config --local user.email "${{ github.actor }}@users.noreply.github.com"
git config --local user.name "Release action on behalf of ${{ github.actor }}"
npm run bumpVersion -- --version=${{ github.event.inputs.semantic_version }}
npm --no-git-tag-version version ${{ github.event.inputs.semantic_version }}
git commit -m "@releng - prepare release ${{ github.event.inputs.semantic_version }}" -a
npm version ${{ github.event.inputs.semantic_version }} -m '@releng - release %s'

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
.idea/
/dist
custom-lodash.js
.parcel-cache
2 changes: 0 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
/custom-lodash.js
/.editorconfig
/.gitignore
/gulpfile.js
/jest.config.js

/examples
/gulp
/src/__tests__
/test
5 changes: 5 additions & 0 deletions .terserrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"output": {
"comments": false
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ npm install
```

Then choose from the following npm scripts:
* `npm run dev` - run the tests, generates the build in the `./dist` folder and runs a development server on `localhost:3000`.
* `npm run build` - run the tests and generates the build in the `./dist` folder.
* `npm run dev` - generates the build in the `./dist` folder and runs a development server on `localhost:3000`.
* `npm run build` - generates the build in the `./dist` folder.
* `npm run test` - run the unit tests

> **Note** - you can [get some stats](https://bundlephobia.com/result?p=@adobe/[email protected]) (bundle size, download time) about the released version.
Expand Down
1 change: 1 addition & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<script>adobeDataLayer = [];</script>
<script src="../dist/adobe-client-data-layer.min.js" async></script>
<script src="js/datalayer.mocks.1.js"></script>
<script src="js/validate.js" type="module" async></script>
</head>
<body>
<h1>Adobe Client Data Layer | Examples</h1>
Expand Down
6 changes: 3 additions & 3 deletions examples/js/datalayer.mocks.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ governing permissions and limitations under the License.
// -----------------------------------------------------------------------------------------------------------------

adobeDataLayer.push({
event: 'carousel clicked',
event: 'carousel-clicked',
component: {
carousel: {
carousel3: {
Expand Down Expand Up @@ -137,12 +137,12 @@ governing permissions and limitations under the License.

let success6 = false;

adobeDataLayer.addEventListener('carousel clicked', function(event) {
adobeDataLayer.addEventListener('carousel-clicked', function(event) {
success6 = true;
});

adobeDataLayer.push({
event: 'carousel clicked',
event: 'carousel-clicked',
eventInfo: {
reference: '/content/mysite/en/home/jcr:content/root/carousel6'
}
Expand Down
23 changes: 23 additions & 0 deletions examples/js/schema/carousel-clicked.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"type": "object",
"properties": {
"event": {
"type": "string"
},
"eventInfo": {
"type": "object",
"properties": {
"reference": {
"type": "string"
}
},
"required": [
"reference"
]
}
},
"required": [
"event",
"eventInfo"
]
}
28 changes: 28 additions & 0 deletions examples/js/schema/component.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"definitions": {
"carouselItem": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"items": {
"type": "object"
}
},
"required": [
"id",
"items"
]
}
},
"type": "object",
"properties": {
"carousel": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/carouselItem"
}
}
}
}
19 changes: 19 additions & 0 deletions examples/js/validate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
await import('https://cdnjs.cloudflare.com/ajax/libs/ajv/8.12.0/ajv2020.min.js');
import AcdlValidator from '/dist/validator/validator.js';

const validator = new AcdlValidator();

// Define and load all schemas
const schemas = [
'component',
'carousel-clicked',
];
(await Promise.all(
schemas.map(async schema => {
const response = await fetch(`/examples/js/schema/${schema}.json`);
return [await response.json(), schema];
})
)).forEach(([schemaJson, schema]) => validator.addSchema(schemaJson, schema));

// Start validator
validator.start();
27 changes: 0 additions & 27 deletions gulp/configs/paths.config.js

This file was deleted.

12 changes: 0 additions & 12 deletions gulp/gulpfile.js

This file was deleted.

43 changes: 0 additions & 43 deletions gulp/index.js

This file was deleted.

26 changes: 0 additions & 26 deletions gulp/tasks/bumpVersion.js

This file was deleted.

25 changes: 0 additions & 25 deletions gulp/tasks/clean.js

This file was deleted.

29 changes: 0 additions & 29 deletions gulp/tasks/jest.js

This file was deleted.

26 changes: 0 additions & 26 deletions gulp/tasks/lint.js

This file was deleted.

21 changes: 0 additions & 21 deletions gulp/tasks/lodash.js

This file was deleted.

Loading