create-loutre 0.8.1 → 0.9.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/dist/app.d.ts CHANGED
@@ -14,8 +14,8 @@ export declare class ProjectScaffolder {
14
14
  }
15
15
  export declare const createProject: import("@loutrejs/loutre/tasks").TaskDefinition<CreateProjectInput, CreateProjectResult>;
16
16
  declare const _default: import("@loutrejs/loutre").ApplicationDefinition<readonly [import("@loutrejs/loutre").ModuleInstance<{
17
- readonly name: "CreateLoutreModule";
18
- readonly providers: readonly [typeof ProjectScaffolder];
19
- readonly executions: readonly [import("@loutrejs/loutre/tasks").TaskDefinition<CreateProjectInput, CreateProjectResult>];
17
+ name: string;
18
+ providers: (typeof ProjectScaffolder)[];
19
+ executions: import("@loutrejs/loutre/tasks").TaskDefinition<CreateProjectInput, CreateProjectResult>[];
20
20
  }>], undefined>;
21
21
  export default _default;
package/dist/app.js CHANGED
@@ -45,12 +45,18 @@ function isMissingDirectory(error) {
45
45
  error.code === 'ENOENT');
46
46
  }
47
47
  function packageNameFor(targetDirectory) {
48
- const name = basename(targetDirectory)
48
+ const normalized = basename(targetDirectory)
49
49
  .trim()
50
50
  .toLowerCase()
51
51
  .replace(/\s+/gu, '-')
52
- .replace(/[^a-z0-9._-]+/gu, '-')
53
- .replace(/^-+|-+$/gu, '');
52
+ .replace(/[^a-z0-9._-]+/gu, '-');
53
+ let start = 0;
54
+ let end = normalized.length;
55
+ while (normalized[start] === '-')
56
+ start += 1;
57
+ while (end > start && normalized[end - 1] === '-')
58
+ end -= 1;
59
+ const name = normalized.slice(start, end);
54
60
  if (name.length === 0 ||
55
61
  name.length > 214 ||
56
62
  name.startsWith('.') ||
package/dist/cli.js CHANGED
@@ -3,10 +3,12 @@ import { relative } from 'node:path';
3
3
  import { select, text } from '@clack/prompts';
4
4
  import { Command, CommanderError, Option } from 'commander';
5
5
  import { bootstrapApplication } from '@loutrejs/loutre';
6
+ import { assertSupportedBunVersion } from '@loutrejs/loutre/runtime';
6
7
  import { detectPresentationTerminal, renderLoutreBrand, } from '@loutrejs/loutre/presentation';
7
8
  import application, { createProject } from './app.js';
8
9
  import { createIsTarget, installCommand, packageManagerLabels, packageManagers, projectTargets, runScriptCommand, targetLabels, } from './options.js';
9
10
  export async function runCreateLoutre(args, io = createProcessIO()) {
11
+ assertSupportedBunVersion();
10
12
  const parsed = parseArgs(args);
11
13
  if ('error' in parsed) {
12
14
  io.stderr(parsed.error);
package/dist/starter.js CHANGED
@@ -63,6 +63,7 @@ function targetManifest(target) {
63
63
  start: 'bun dist/main.js',
64
64
  },
65
65
  devDependencies: { '@types/bun': '^1.4.0' },
66
+ engines: { bun: '>=1.4.0' },
66
67
  types: ['bun'],
67
68
  }))
68
69
  .with('cloudflare-workers', () => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-loutre",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
4
4
  "description": "Loutre project initializer",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@clack/prompts": "^1.8.1",
21
- "@loutrejs/loutre": "^0.8.1",
21
+ "@loutrejs/loutre": "^0.9.0",
22
22
  "commander": "^15.0.0",
23
23
  "ts-pattern": "^5.9.0"
24
24
  },
@@ -1,12 +1,12 @@
1
1
  import { defineApplication, defineModule } from '@loutrejs/loutre'
2
2
  import { AppController } from './hello/controller.js'
3
3
 
4
- const AppModule = defineModule(() => ({
4
+ const AppModule = defineModule({
5
5
  name: 'AppModule',
6
6
  description: 'HTTP Application entry module',
7
7
  executions: [AppController],
8
- }))
8
+ })
9
9
 
10
10
  export default defineApplication({
11
- modules: [AppModule()],
11
+ modules: [AppModule],
12
12
  })