ansensational 1.1.0 → 1.2.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/CHANGELOG.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ### Added
6
6
 
7
- - `scaffold` command (also the default command) with non-interactive flags:
7
+ - `ansensational` command (also the default command) with non-interactive flags:
8
8
  `--git`, `--pm`, `--force`, and `--yes`.
9
9
  - `--json` output for `list` and `search`.
10
10
  - Support for GitHub/GitLab tree URLs that point at a subdirectory.
@@ -27,5 +27,5 @@
27
27
  - Non-interactive runs no longer hang on prompts.
28
28
  - Tree/subdirectory template URLs are supported instead of being passed to
29
29
  `git clone` unchanged.
30
- - Scaffolding into an existing empty directory works; `--force` is required
30
+ - ANSensationaling into an existing empty directory works; `--force` is required
31
31
  for non-empty directories.
package/LICENSE ADDED
@@ -0,0 +1,194 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship made available under
36
+ the License, as indicated by a copyright notice that is included in
37
+ or attached to the work (an example is provided in the Appendix below).
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based on (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other modifications
42
+ represent, as a whole, an original work of authorship. For the purposes
43
+ of this License, Derivative Works shall not include works that remain
44
+ separable from, or merely link (or bind by name) to the interfaces of,
45
+ the Work and Derivative Works thereof.
46
+
47
+ "Contribution" shall mean, as submitted to the Licensor for inclusion
48
+ in the Work by the copyright owner or by an individual or Legal Entity
49
+ authorized to submit on behalf of the copyright owner. For the purposes
50
+ of this definition, "submitted" means any form of electronic, verbal,
51
+ or written communication sent to the Licensor or its representatives,
52
+ including but not limited to communication on electronic mailing lists,
53
+ source code control systems, and issue tracking systems that are managed
54
+ by, or on behalf of, the Licensor for the purpose of discussing and
55
+ improving the Work, but excluding communication that is conspicuously
56
+ marked or designated in writing by the copyright owner as "Not a
57
+ Contribution."
58
+
59
+ "Contributor" shall mean Licensor and any Legal Entity on behalf of
60
+ whom a Contribution has been received by the Licensor and included
61
+ within the Work.
62
+
63
+ 2. Grant of Copyright License. Subject to the terms and conditions of
64
+ this License, each Contributor hereby grants to You a perpetual,
65
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
66
+ copyright license to reproduce, prepare Derivative Works of,
67
+ publicly display, publicly perform, sublicense, and distribute the
68
+ Work and such Derivative Works in Source or Object form.
69
+
70
+ 3. Grant of Patent License. Subject to the terms and conditions of
71
+ this License, each Contributor hereby grants to You a perpetual,
72
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
73
+ (except as stated in this section) patent license to make, have made,
74
+ use, offer to sell, sell, import, and otherwise transfer the Work,
75
+ where such license applies only to those patent claims licensable
76
+ by such Contributor that are necessarily infringed by their
77
+ Contribution(s) alone or by their combined Contributions with the Work.
78
+ If You institute patent litigation against any entity (including a
79
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
80
+ or a Contribution incorporated within the Work constitutes direct
81
+ or contributory patent infringement, then any patent licenses
82
+ granted to You under this License for that Work shall terminate
83
+ as of the date such litigation is filed.
84
+
85
+ 4. Redistribution. You may reproduce and distribute copies of the
86
+ Work or Derivative Works thereof in any medium, with or without
87
+ modifications, and in Source or Object form, provided that You
88
+ meet the following conditions:
89
+
90
+ (a) You must give any other recipients of the Work or Derivative
91
+ Works a copy of this License; and
92
+
93
+ (b) You must cause any modified files to carry prominent notices
94
+ stating that You changed the files; and
95
+
96
+ (c) You must retain, in the Source form of any Derivative Works
97
+ that You distribute, all copyright, patent, trademark, and
98
+ attribution notices from the Source form of the Work,
99
+ excluding those notices that do not pertain to any part of
100
+ the Derivative Works; and
101
+
102
+ (d) If the Work includes a "NOTICE" text file as part of its
103
+ distribution, You must include a readable copy of the
104
+ attribution notices contained within such NOTICE file, in
105
+ at least one of the following places: within a NOTICE text
106
+ file distributed as part of the Derivative Works; within
107
+ the Source form or documentation, if provided along with the
108
+ Derivative Works; or, within a display generated by the
109
+ Derivative Works, if and wherever such third-party notices
110
+ normally appear. The contents of the NOTICE file are for
111
+ informational purposes only and do not modify the License.
112
+ You may add Your own attribution notices within Derivative
113
+ Works that You distribute, alongside or as an addendum to
114
+ the NOTICE text from the Work, provided that such additional
115
+ attribution notices cannot be construed as modifying the License.
116
+
117
+ You may add Your own license statement for Your modifications and
118
+ may provide additional grant of rights to use, copy, modify, merge,
119
+ publish, distribute, sublicense, and/or sell copies of Your modifications,
120
+ and to permit persons to whom Your modifications are furnished to do
121
+ so, provided that such rights are in addition to the rights granted
122
+ above.
123
+
124
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
125
+ any Contribution intentionally submitted for inclusion in the Work
126
+ by You to the Licensor shall be under the terms and conditions of
127
+ this License, without any additional terms or conditions.
128
+ Notwithstanding the above, nothing herein shall supersede or modify
129
+ the terms of any separate license agreement you may have executed
130
+ with Licensor regarding such Contributions.
131
+
132
+ 6. Trademarks. This License does not grant permission to use the trade
133
+ names, trademarks, service marks, or product names of the Licensor,
134
+ except as required for reasonable and customary use in describing the
135
+ origin of the Work and reproducing the content of the NOTICE file.
136
+
137
+ 7. Disclaimer of Warranty. Unless required by applicable law or
138
+ agreed to in writing, Licensor provides the Work (and each
139
+ Contributor provides its Contributions) on an "AS IS" BASIS,
140
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
141
+ implied, including, without limitation, any warranties or conditions
142
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
143
+ PARTICULAR PURPOSE. You are solely responsible for determining the
144
+ appropriateness of using or reproducing the Work and assume any
145
+ risks associated with Your exercise of permissions under this License.
146
+
147
+ 8. Limitation of Liability. In no event and under no legal theory,
148
+ whether in tort (including negligence), contract, or otherwise,
149
+ unless required by applicable law (such as deliberate and grossly
150
+ negligent acts) or agreed to in writing, shall any Contributor be
151
+ liable to You for damages, including any direct, indirect, special,
152
+ incidental, or exemplary damages of any character arising as a
153
+ result of this License or out of the use or inability to use the
154
+ Work (including but not limited to damages for loss of goodwill,
155
+ work stoppage, computer failure or malfunction, or all other
156
+ commercial damages or losses), even if such Contributor has been
157
+ advised of the possibility of such damages.
158
+
159
+ 9. Accepting Warranty or Liability. While redistributing the Work or
160
+ Derivative Works thereof, You may choose to offer, and charge a fee
161
+ for, acceptance of support, warranty, indemnity, or other liability
162
+ obligations and/or rights consistent with this License. However, in
163
+ accepting such obligations, You may offer such obligations only on
164
+ Your own behalf and on Your sole responsibility, not on behalf of
165
+ any other Contributor, and only if You agree to indemnify, defend,
166
+ and hold each Contributor harmless for any liability incurred by,
167
+ or claims asserted against, such Contributor by reason of your
168
+ accepting any warranty or additional liability.
169
+
170
+ END OF TERMS AND CONDITIONS
171
+
172
+ APPENDIX: How to apply the Apache License to your work.
173
+
174
+ To apply the Apache License to your work, attach the following
175
+ boilerplate notice, with the fields enclosed by brackets "[]"
176
+ replaced with your own identifying information. (Don't include
177
+ the brackets!) The text should be enclosed in the appropriate
178
+ comment syntax for the format in question. It may also be
179
+ distributed in a "work representing file" form as described in
180
+ Section 4 d of the Apache License, Version 2.0.
181
+
182
+ Copyright 2024 Andi Nugroho
183
+
184
+ Licensed under the Apache License, Version 2.0 (the "License");
185
+ you may not use this file except in compliance with the License.
186
+ You may obtain a copy of the License at
187
+
188
+ http://www.apache.org/licenses/LICENSE-2.0
189
+
190
+ Unless required by applicable law or agreed to in writing, software
191
+ distributed under the License is distributed on an "AS IS" BASIS,
192
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
193
+ See the License for the specific language governing permissions and
194
+ limitations under the License.
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
6
6
  [![Node.js](https://img.shields.io/node/v/ansensational.svg)](https://nodejs.org/)
7
7
 
8
- **Scaffold new projects from GitHub or GitLab templates with a single command.**
8
+ **ANSensational new projects from GitHub or GitLab templates with a single command.**
9
9
 
10
10
  Ansensational is a community-driven template registry and CLI. Discover a
11
11
  template, clone it into a clean project, choose how git and your package
@@ -13,7 +13,7 @@ manager should be handled, and start building.
13
13
 
14
14
  ## Features
15
15
 
16
- - **One-command scaffolding** — `ansensational @author/template my-app`
16
+ - **One-command ansensationaling** — `ansensational @author/template my-app`
17
17
  - **GitHub, GitLab, and custom Git hosts** — including URLs that point at a
18
18
  branch or subdirectory.
19
19
  - **Clean starts** — keep the original history, create a fresh repository, or
@@ -57,7 +57,7 @@ ansensational sync
57
57
  # Browse templates
58
58
  ansensational list --remote
59
59
 
60
- # Scaffold one
60
+ # ANSensational one
61
61
  ansensational @andi-nugroho/nest-backend my-app
62
62
  ```
63
63
 
@@ -65,8 +65,8 @@ ansensational @andi-nugroho/nest-backend my-app
65
65
 
66
66
  | Command | Description |
67
67
  | --------------------------------------- | ----------------------------------------------- |
68
- | `ansensational <slug> [dest]` | Scaffold a template (default command) |
69
- | `ansensational scaffold <slug> [dest]` | Explicit form of the same command |
68
+ | `ansensational <slug> [dest]` | ANSensational a template (default command) |
69
+ | `ansensational ansensational <slug> [dest]` | Explicit form of the same command |
70
70
  | `ansensational list` | List templates in the local cache |
71
71
  | `ansensational search <query>` | Search local and remote templates |
72
72
  | `ansensational sync` | Download the latest community registry |
@@ -75,7 +75,7 @@ ansensational @andi-nugroho/nest-backend my-app
75
75
  Templates can be referenced as `@author/slug`, `author/slug`, or a bare `slug`
76
76
  when the slug is unique.
77
77
 
78
- ### Scaffold options
78
+ ### ANSensational options
79
79
 
80
80
  | Option | Description |
81
81
  | ---------------------- | ------------------------------------------------------------ |
@@ -88,7 +88,7 @@ when the slug is unique.
88
88
  # Non-interactive setup for CI or scripts
89
89
  ansensational @andi-nugroho/backend my-api --git fresh --pm pnpm --yes
90
90
 
91
- # Scaffold into the current (empty) directory
91
+ # ANSensational into the current (empty) directory
92
92
  ansensational @andi-nugroho/webapp .
93
93
 
94
94
  # Add files to an existing directory (explicit opt-in)
package/dist/index.js CHANGED
@@ -150,8 +150,8 @@ ${text}
150
150
  }
151
151
  console.log("");
152
152
  },
153
- scaffoldSuccess: (slug, dest, url, packageManager) => {
154
- UI.success(`Successfully scaffolded @${slug} into ${dest}`);
153
+ ansensationalSuccess: (slug, dest, url, packageManager) => {
154
+ UI.success(`Successfully ansensationaled @${slug} into ${dest}`);
155
155
  const manager = packageManager === "unknown" ? "npm" : packageManager;
156
156
  const installCommand = packageManager === "unknown" ? "install dependencies with your package manager" : INSTALL_COMMANDS[manager];
157
157
  const devCommand = packageManager === "unknown" ? "run your dev script" : DEV_COMMANDS[manager];
@@ -207,16 +207,13 @@ var VERSION = pkg.version ?? "0.0.0";
207
207
 
208
208
  // src/registry.ts
209
209
  var DEFAULT_REGISTRY_URL = "https://raw.githubusercontent.com/andi-nugroho/ansensational/main/registry/registry.json";
210
- var configuredHome = (process.env.ANSENSATIONAL_HOME || process.env.SCAFFOLDOR_HOME)?.trim();
210
+ var configuredHome = process.env.ANSENSATIONAL_HOME?.trim();
211
211
  var ANSENSATIONAL_DIR = configuredHome ? path.resolve(configuredHome) : path.join(os.homedir(), ".ansensational");
212
- var SCAFFOLDOR_DIR = ANSENSATIONAL_DIR;
213
212
  var LOCAL_REGISTRY_PATH = path.join(ANSENSATIONAL_DIR, "registry.json");
214
213
  var LOCAL_AUTHOR = "local";
215
- var REMOTE_REGISTRY_URL = (process.env.ANSENSATIONAL_REGISTRY_URL || process.env.SCAFFOLDOR_REGISTRY_URL)?.trim() || DEFAULT_REGISTRY_URL;
214
+ var REMOTE_REGISTRY_URL = process.env.ANSENSATIONAL_REGISTRY_URL?.trim() || DEFAULT_REGISTRY_URL;
216
215
  var FETCH_TIMEOUT_MS = (() => {
217
- const configured = Number(
218
- process.env.ANSENSATIONAL_REGISTRY_TIMEOUT || process.env.SCAFFOLDOR_REGISTRY_TIMEOUT
219
- );
216
+ const configured = Number(process.env.ANSENSATIONAL_REGISTRY_TIMEOUT);
220
217
  return Number.isFinite(configured) && configured > 0 ? configured : 15e3;
221
218
  })();
222
219
  async function ensureAnsensationalDir() {
@@ -274,7 +271,7 @@ async function readLocalRegistry() {
274
271
  return result.data;
275
272
  } catch {
276
273
  const backupPath = path.join(
277
- SCAFFOLDOR_DIR,
274
+ ANSENSATIONAL_DIR,
278
275
  `registry.corrupt-${Date.now()}.json`
279
276
  );
280
277
  let backedUp = false;
@@ -1024,10 +1021,10 @@ ${formatZodError(result.error)}`);
1024
1021
  UI.success(
1025
1022
  `Template @${LOCAL_AUTHOR}/${result.data.slug} ${updated ? "updated in" : "added to"} your local registry.`
1026
1023
  );
1027
- UI.dim(`Scaffold it with: ansensational @${LOCAL_AUTHOR}/${result.data.slug}`);
1024
+ UI.dim(`ANSensational it with: ansensational @${LOCAL_AUTHOR}/${result.data.slug}`);
1028
1025
  }
1029
1026
 
1030
- // src/commands/scaffold.ts
1027
+ // src/commands/ansensational.ts
1031
1028
  import path3 from "path";
1032
1029
  import fs3 from "fs-extra";
1033
1030
  import inquirer2 from "inquirer";
@@ -1083,7 +1080,7 @@ Choose a different directory, or pass --force to overwrite conflicting files.`
1083
1080
  }
1084
1081
  return { absoluteDest, exists: true };
1085
1082
  }
1086
- async function scaffoldCommand(slugInput, dest, options = {}) {
1083
+ async function ansensationalCommand(slugInput, dest, options = {}) {
1087
1084
  if (!slugInput || !slugInput.trim()) {
1088
1085
  throw new CliError(
1089
1086
  "Missing template name.\nUsage: ansensational <@author/slug> [destination]"
@@ -1131,7 +1128,7 @@ Try the @author/slug form, or run "ansensational search <query>" to find templat
1131
1128
  const purchase = template.pricing?.purchaseUrl ? `
1132
1129
  Learn more: ${template.pricing.purchaseUrl}` : "";
1133
1130
  throw new CliError(
1134
- `"${template.name}" is a premium template and cannot be scaffolded yet.${purchase}`
1131
+ `"${template.name}" is a premium template and cannot be ansensationaled yet.${purchase}`
1135
1132
  );
1136
1133
  }
1137
1134
  const gitChoice = await resolveGitStrategy(options);
@@ -1146,7 +1143,7 @@ Learn more: ${template.pricing.purchaseUrl}` : "";
1146
1143
  let placed = false;
1147
1144
  try {
1148
1145
  UI.info(
1149
- `Scaffolding @${template.author.github || parsed.author || "local"}/${template.slug}...`
1146
+ `ANSensationaling @${template.author.github || parsed.author || "local"}/${template.slug}...`
1150
1147
  );
1151
1148
  UI.dim(`Name: ${template.name}`);
1152
1149
  UI.dim(`Type: ${template.type}`);
@@ -1175,7 +1172,7 @@ Learn more: ${template.pricing.purchaseUrl}` : "";
1175
1172
  await fs3.remove(tempDest);
1176
1173
  }
1177
1174
  placed = true;
1178
- UI.scaffoldSuccess(
1175
+ UI.ansensationalSuccess(
1179
1176
  `${template.author.github || parsed.author || "local"}/${template.slug}`,
1180
1177
  destination,
1181
1178
  template.url,
@@ -1188,14 +1185,14 @@ Learn more: ${template.pricing.purchaseUrl}` : "";
1188
1185
  }
1189
1186
  if (error instanceof CliError) throw error;
1190
1187
  const detail = error instanceof Error ? error.message : String(error);
1191
- throw new CliError(`Scaffolding failed: ${detail}`);
1188
+ throw new CliError(`ANSensationaling failed: ${detail}`);
1192
1189
  }
1193
1190
  }
1194
1191
 
1195
1192
  // src/index.ts
1196
1193
  var program = new Command();
1197
- program.name("ansensational").description("Scaffold new projects from GitHub/GitLab templates").version(VERSION, "-v, --version", "output the version number").showHelpAfterError().showSuggestionAfterError();
1198
- program.command("scaffold", { isDefault: true }).description("Scaffold a template (default command)").argument("[slug]", "Template slug (e.g., @andi-nugroho/backend)").argument("[dest]", "Destination directory").option(
1194
+ program.name("ansensational").description("ANSensational new projects from GitHub/GitLab templates").version(VERSION, "-v, --version", "output the version number").showHelpAfterError().showSuggestionAfterError();
1195
+ program.command("ansensational", { isDefault: true }).description("ANSensational a template (default command)").argument("[slug]", "Template slug (e.g., @andi-nugroho/backend)").argument("[dest]", "Destination directory").option(
1199
1196
  "-g, --git <strategy>",
1200
1197
  "Git handling: keep, fresh, or remove (default: prompt)"
1201
1198
  ).option(
@@ -1207,7 +1204,7 @@ program.command("scaffold", { isDefault: true }).description("Scaffold a templat
1207
1204
  program.help();
1208
1205
  return;
1209
1206
  }
1210
- await scaffoldCommand(slug, dest, options);
1207
+ await ansensationalCommand(slug, dest, options);
1211
1208
  }
1212
1209
  );
1213
1210
  program.command("list").description("List templates from the local registry").option("-r, --remote", "Include templates from the remote registry").option("-t, --type <type>", "Filter by type (frontend, backend, etc.)").option("-f, --framework <framework>", "Filter by framework").option("-a, --author <author>", "Filter by author username").option("--json", "Output machine-readable JSON").action(listCommand);
@@ -1236,7 +1233,7 @@ async function main() {
1236
1233
  console.log(pc3.dim("\nCancelled."));
1237
1234
  process.exit(130);
1238
1235
  }
1239
- const isDebug = process.env.ANSENSATIONAL_DEBUG || process.env.SCAFFOLDOR_DEBUG;
1236
+ const isDebug = process.env.ANSENSATIONAL_DEBUG;
1240
1237
  if (error instanceof CliError) {
1241
1238
  UI.error(error.message);
1242
1239
  if (isDebug) console.error(error.stack);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ansensational",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "ANSensational new projects from GitHub or GitLab templates with a single command",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -13,8 +13,7 @@
13
13
  "./package.json": "./package.json"
14
14
  },
15
15
  "bin": {
16
- "ansensational": "dist/index.js",
17
- "scaffoldor": "dist/index.js"
16
+ "ansensational": "dist/index.js"
18
17
  },
19
18
  "scripts": {
20
19
  "build": "tsup",
@@ -26,8 +25,8 @@
26
25
  },
27
26
  "keywords": [
28
27
  "cli",
29
- "scaffold",
30
- "scaffolding",
28
+ "ansensational",
29
+ "ansensationaling",
31
30
  "template",
32
31
  "templates",
33
32
  "generator",