at-builder 1.0.11 → 1.1.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.
- package/README.md +104 -1
- package/bin/index.js +0 -13
- package/package.json +1 -1
- package/puppeteer.js +1 -1
- package/webpack.config.js +27 -5
- package/.babelrc +0 -11
- package/.env +0 -6
- package/.eslintrc +0 -525
- package/.globals/css/abstract/color.scss +0 -28
- package/.globals/css/abstract/mixin.scss +0 -76
- package/.globals/css/base/common.scss +0 -184
- package/.globals/css/components/spinner.scss +0 -95
- package/.globals/services/analyticsHelper/index.ts +0 -82
- package/.globals/services/analyticsHelper/types.ts +0 -31
- package/.globals/services/domHandler.js +0 -36
- package/.globals/services/logger.js +0 -55
- package/.globals/services/observer.js +0 -46
- package/.globals/services/prebuiltEventHandler.js +0 -24
- package/.globals/services/utility.js +0 -207
- package/.globals/services/xmlhttp.interceptor.ts +0 -112
- package/.plop/constants/index.js +0 -11
- package/.plop/generators/actions.js +0 -82
- package/.plop/generators/components.js +0 -8
- package/.plop/generators/prompts.js +0 -31
- package/.plop/index.js +0 -5
- package/.plop/templates/analytics.hbs +0 -23
- package/.plop/templates/build-template.hbs +0 -7
- package/.plop/templates/component.cb.hbs +0 -34
- package/.plop/templates/constants.hbs +0 -7
- package/.plop/templates/index.hbs +0 -10
- package/.plop/templates/observer.hbs +0 -18
- package/.plop/templates/style.hbs +0 -3
- package/.plop/utils/index.js +0 -10
package/README.md
CHANGED
|
@@ -1,2 +1,105 @@
|
|
|
1
|
-
# at-builder
|
|
1
|
+
# **at-builder**
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/at-builder)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
|
|
6
|
+
`at-builder` is a simple command-line tool designed to streamline Adobe Target activity creation and building processes.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## **Features**
|
|
11
|
+
|
|
12
|
+
- 🔧 **Prod Build**: Build target ready code in your local and ship to any target activity.
|
|
13
|
+
- 🚀 **Help Information**: Get detailed instructions on available commands and usage directly from the CLI.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## **Installation**
|
|
18
|
+
|
|
19
|
+
Install the package globally using NPM:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install -g at-builder
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## **Usage**
|
|
28
|
+
|
|
29
|
+
Run the command-line tool:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
atb
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### **Available Commands**
|
|
36
|
+
|
|
37
|
+
- **`new`**: Creates a new activity.
|
|
38
|
+
- **`build`**: Creates a build.
|
|
39
|
+
|
|
40
|
+
### **Examples**
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Create a new activity
|
|
44
|
+
atb -c new
|
|
45
|
+
|
|
46
|
+
# Build the project
|
|
47
|
+
atb -c
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## **API Documentation**
|
|
53
|
+
|
|
54
|
+
### **`getVersion()`**
|
|
55
|
+
|
|
56
|
+
- **Description**: Retrieves the version number from the `package.json` file.
|
|
57
|
+
- **Returns**: *(string)* - The version number of the package.
|
|
58
|
+
|
|
59
|
+
#### **Example**
|
|
60
|
+
|
|
61
|
+
```javascript
|
|
62
|
+
const { getVersion } = require("at-builder");
|
|
63
|
+
|
|
64
|
+
console.log(getVersion()); // Outputs the version number of the package
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### **`getHelpInfo()`**
|
|
68
|
+
|
|
69
|
+
- **Description**: Provides a string containing help information for the `atb` command-line tool.
|
|
70
|
+
- **Returns**: *(string)* - The help information string.
|
|
71
|
+
|
|
72
|
+
#### **Example**
|
|
73
|
+
|
|
74
|
+
```javascript
|
|
75
|
+
const { getHelpInfo } = require("at-builder");
|
|
76
|
+
|
|
77
|
+
console.log(getHelpInfo());
|
|
78
|
+
// Outputs detailed help information for the CLI tool
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## **Contributing**
|
|
84
|
+
|
|
85
|
+
Contributions are welcome! To contribute:
|
|
86
|
+
|
|
87
|
+
1. Fork the repository.
|
|
88
|
+
2. Create a new branch (`git checkout -b feature-branch-name`).
|
|
89
|
+
3. Commit your changes (`git commit -m 'Add some feature'`).
|
|
90
|
+
4. Push to the branch (`git push origin feature-branch-name`).
|
|
91
|
+
5. Open a pull request.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## **License**
|
|
96
|
+
|
|
97
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## **Support**
|
|
102
|
+
|
|
103
|
+
If you encounter any issues or have questions, feel free to open an [issue](https://github.com/upendrasengar/at-builder/issues).
|
|
104
|
+
|
|
105
|
+
---
|
package/bin/index.js
CHANGED
|
@@ -6,19 +6,6 @@ const config_1 = require("./constants/config");
|
|
|
6
6
|
const path = require("path");
|
|
7
7
|
const fs = require("fs");
|
|
8
8
|
const readline = require('readline');
|
|
9
|
-
// inquirer
|
|
10
|
-
// .prompt([
|
|
11
|
-
// ])
|
|
12
|
-
// .then((answers) => {
|
|
13
|
-
// // Use user feedback for... whatever!!
|
|
14
|
-
// })
|
|
15
|
-
// .catch((error) => {
|
|
16
|
-
// if (error.isTtyError) {
|
|
17
|
-
// // Prompt couldn't be rendered in the current environment
|
|
18
|
-
// } else {
|
|
19
|
-
// // Something else went wrong
|
|
20
|
-
// }
|
|
21
|
-
// });
|
|
22
9
|
try {
|
|
23
10
|
fs.accessSync(path.join(process.cwd(), ".env"), fs.constants.R_OK);
|
|
24
11
|
}
|
package/package.json
CHANGED
package/puppeteer.js
CHANGED
package/webpack.config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const { PWD } = process.env;
|
|
2
2
|
const path = require('path');
|
|
3
|
-
require('dotenv').config({ path: path.join(
|
|
3
|
+
require('dotenv').config({ path: path.join(PWD,".env") });
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
const WrapperPlugin = require('wrapper-webpack-plugin');
|
|
6
6
|
const TerserPlugin = require("terser-webpack-plugin");
|
|
@@ -90,7 +90,7 @@ var traversePath = function (dir) {
|
|
|
90
90
|
|
|
91
91
|
console.log("\x1b[33m%s\x1b[0m", `${process.env.ACTIVITY_FOLDER_NAME}`);
|
|
92
92
|
|
|
93
|
-
const filepath =
|
|
93
|
+
const filepath = PWD;
|
|
94
94
|
|
|
95
95
|
var files = traversePath(path.join(filepath, 'Activities', process.env.ACTIVITY_FOLDER_NAME).toString());
|
|
96
96
|
|
|
@@ -107,7 +107,7 @@ files.forEach((file) => {
|
|
|
107
107
|
}
|
|
108
108
|
var newPath = `${distFolderPath}/build`;
|
|
109
109
|
// Replace path with absolute path before making a key of the entries object
|
|
110
|
-
entries[newPath.replace(
|
|
110
|
+
entries[newPath.replace(PWD, "")] = file;
|
|
111
111
|
});
|
|
112
112
|
|
|
113
113
|
console.log("++++ENTRIES++++", entries);
|
|
@@ -119,6 +119,28 @@ const plugins = [
|
|
|
119
119
|
extensions: "js",
|
|
120
120
|
outputReport: true,
|
|
121
121
|
fix: true
|
|
122
|
+
}),
|
|
123
|
+
|
|
124
|
+
new WrapperPlugin({
|
|
125
|
+
test: /\.js$/,
|
|
126
|
+
header: function (_, args) {
|
|
127
|
+
//Handle target issue for reloading the styles.
|
|
128
|
+
|
|
129
|
+
const preFix = process.env.TRACK ? process.env.TRACK : 'TargetBuild';
|
|
130
|
+
let _uniqueTestId = `${preFix}_${args.hash}`;
|
|
131
|
+
args._uniqueTestId = _uniqueTestId;
|
|
132
|
+
return `(function(){
|
|
133
|
+
if(!window.${_uniqueTestId}){
|
|
134
|
+
//# sourceURL=${_uniqueTestId}.js
|
|
135
|
+
`;
|
|
136
|
+
},
|
|
137
|
+
footer: function (_, args) {
|
|
138
|
+
return `\n
|
|
139
|
+
window.${args._uniqueTestId} = true;
|
|
140
|
+
}
|
|
141
|
+
})();`
|
|
142
|
+
},
|
|
143
|
+
afterOptimization: true,
|
|
122
144
|
})
|
|
123
145
|
];
|
|
124
146
|
|
|
@@ -144,7 +166,7 @@ module.exports = {
|
|
|
144
166
|
...entries
|
|
145
167
|
},
|
|
146
168
|
output: {
|
|
147
|
-
path:
|
|
169
|
+
path: PWD,
|
|
148
170
|
filename: '[name].js'
|
|
149
171
|
},
|
|
150
172
|
module: {
|
package/.babelrc
DELETED