@codejen/pack-yeoman 1.0.0 → 2.0.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/dist/common.d.ts CHANGED
@@ -29,7 +29,7 @@ export declare const toArgv: ({ flags, positionals }: Args) => string[];
29
29
  /**
30
30
  * Runs a generator with the network cut off – fetch() and every TCP connection
31
31
  * fail – and fails the run if it tried, even when the generator swallowed the
32
- * error: jen never touches the network, nor do generators it runs.
32
+ * error: whatever a generator downloads or sends would bypass jen's plan.
33
33
  */
34
34
  export declare function offline<T>(run: () => Promise<T>): Promise<T>;
35
35
  /** The files a generator left pending in mem-fs, as jen actions with paths from the project root. */
package/dist/common.js CHANGED
@@ -77,7 +77,7 @@ export const toArgv = ({ flags, positionals }) => [
77
77
  /**
78
78
  * Runs a generator with the network cut off – fetch() and every TCP connection
79
79
  * fail – and fails the run if it tried, even when the generator swallowed the
80
- * error: jen never touches the network, nor do generators it runs.
80
+ * error: whatever a generator downloads or sends would bypass jen's plan.
81
81
  */
82
82
  export async function offline(run) {
83
83
  const tried = [];
@@ -86,19 +86,19 @@ export async function offline(run) {
86
86
  globalThis.fetch = async (input) => {
87
87
  const url = input instanceof Request ? input.url : String(input);
88
88
  tried.push(url);
89
- throw new Error(`${url}: jen never touches the network.`);
89
+ throw new Error(`${url}: Yeoman generators run offline under jen.`);
90
90
  };
91
91
  Socket.prototype.connect = function (...args) {
92
92
  const [target] = args;
93
93
  const where = typeof target === 'object' ? (target.path ?? `${target.host ?? 'localhost'}:${target.port}`) : String(target);
94
94
  tried.push(where);
95
- process.nextTick(() => this.destroy(new Error(`${where}: jen never touches the network.`)));
95
+ process.nextTick(() => this.destroy(new Error(`${where}: Yeoman generators run offline under jen.`)));
96
96
  return this;
97
97
  };
98
98
  try {
99
99
  const result = await run();
100
100
  if (tried.length > 0)
101
- throw new Error(`The generator tried to reach ${[...new Set(tried)].join(', ')} – jen never touches the network.`);
101
+ throw new Error(`The generator tried to reach ${[...new Set(tried)].join(', ')} – Yeoman generators run offline under jen.`);
102
102
  return result;
103
103
  }
104
104
  finally {
package/dist/jhipster.js CHANGED
@@ -81,7 +81,7 @@ async function run(cliFile, baseCoreFile, ctx) {
81
81
  const here = process.cwd();
82
82
  const cwd = destination(ctx);
83
83
  const { EnvironmentBuilder } = (await import(__rewriteRelativeImportExtension(pathToFileURL(cliFile).href)));
84
- // blueprints that aren't installed would be fetched – jen never does that implicitly
84
+ // blueprints that aren't installed would be fetched by name from the generator's config, outside jen's plan
85
85
  const builder = await EnvironmentBuilder.create({ cwd, skipInstall: true }).prepare({ disableBlueprints: true });
86
86
  const env = builder.getEnvironment();
87
87
  env.adapter.prompt = async (questions) => answerPrompt(questions, args.flags);
@@ -115,6 +115,7 @@ async function run(cliFile, baseCoreFile, ctx) {
115
115
  export function jhipsterGenerator(env, description) {
116
116
  return {
117
117
  description,
118
+ passthrough: true,
118
119
  actions: async (_answers, _helpers, ctx) => {
119
120
  const cliFile = await locate(env, 'generator-jhipster', ['generator-jhipster/cli']);
120
121
  const baseCoreFile = await locate(env, 'generator-jhipster', ['generator-jhipster/generators/base-core']);
package/dist/shim.js CHANGED
@@ -78,6 +78,7 @@ async function run(resolved, namespace, ctx) {
78
78
  export function shimGenerator(name, short, env, description) {
79
79
  return {
80
80
  description,
81
+ passthrough: true,
81
82
  actions: async (_answers, _helpers, ctx) => {
82
83
  // the package's main, else where yo looks: generators/app, then app
83
84
  const resolved = await locate(env, name, [name, `${name}/generators/app`, `${name}/app`]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codejen/pack-yeoman",
3
- "version": "1.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "jen pack that runs Yeoman generators, JHipster included, through jen's plan: never interactive, nothing written before you see it",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -35,10 +35,10 @@
35
35
  "author": "Lea Rosema",
36
36
  "license": "ISC",
37
37
  "peerDependencies": {
38
- "@codejen/jen": "^2.0.0"
38
+ "@codejen/jen": "^2.0.0 || ^3.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@codejen/jen": "^2.0.0",
41
+ "@codejen/jen": "^2.0.0 || ^3.0.0",
42
42
  "@types/node": "^26.6.3",
43
43
  "mem-fs": "^6.0.0",
44
44
  "typescript": "^6.0.3",