create-loutre 0.9.1 → 0.10.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 +3 -2
- package/dist/app.js +3 -2
- package/dist/identity.d.ts +10 -0
- package/dist/identity.js +2 -0
- package/dist/starter.d.ts +3 -2
- package/dist/starter.js +3 -1
- package/package.json +2 -2
package/dist/app.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type AbsoluteFsPath, type GeneratedPackageName } from './identity.js';
|
|
1
2
|
import type { PackageManager, ProjectTarget } from './options.js';
|
|
2
3
|
export interface CreateProjectInput {
|
|
3
4
|
readonly cwd: string;
|
|
@@ -6,8 +7,8 @@ export interface CreateProjectInput {
|
|
|
6
7
|
readonly target: ProjectTarget;
|
|
7
8
|
}
|
|
8
9
|
export interface CreateProjectResult {
|
|
9
|
-
readonly packageName:
|
|
10
|
-
readonly targetDirectory:
|
|
10
|
+
readonly packageName: GeneratedPackageName;
|
|
11
|
+
readonly targetDirectory: AbsoluteFsPath;
|
|
11
12
|
}
|
|
12
13
|
export declare class ProjectScaffolder {
|
|
13
14
|
create(input: CreateProjectInput): Promise<CreateProjectResult>;
|
package/dist/app.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { absoluteFsPath, } from './identity.js';
|
|
1
2
|
import { readdir } from 'node:fs/promises';
|
|
2
|
-
import { basename
|
|
3
|
+
import { basename } from 'node:path';
|
|
3
4
|
import { defineApplication, defineModule, inject } from '@loutrejs/loutre';
|
|
4
5
|
import { task } from '@loutrejs/loutre/tasks';
|
|
5
6
|
import { writeStarter } from './starter.js';
|
|
6
7
|
export class ProjectScaffolder {
|
|
7
8
|
async create(input) {
|
|
8
|
-
const targetDirectory =
|
|
9
|
+
const targetDirectory = absoluteFsPath(input.cwd, input.directory);
|
|
9
10
|
const packageName = packageNameFor(targetDirectory);
|
|
10
11
|
await assertTargetIsEmpty(targetDirectory);
|
|
11
12
|
await writeStarter(targetDirectory, {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type AbsoluteFsPath = string & {
|
|
2
|
+
readonly '~loutre.scaffolder': 'absolute-path';
|
|
3
|
+
};
|
|
4
|
+
export type GeneratedPackageName = string & {
|
|
5
|
+
readonly '~loutre.scaffolder': 'package-name';
|
|
6
|
+
};
|
|
7
|
+
export type GeneratedWorkerName = string & {
|
|
8
|
+
readonly '~loutre.scaffolder': 'worker-name';
|
|
9
|
+
};
|
|
10
|
+
export declare const absoluteFsPath: (...paths: readonly string[]) => AbsoluteFsPath;
|
package/dist/identity.js
ADDED
package/dist/starter.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { type GeneratedPackageName } from './identity.js';
|
|
1
2
|
import { type PackageManager, type ProjectTarget } from './options.js';
|
|
2
3
|
export interface StarterOptions {
|
|
3
|
-
readonly packageName:
|
|
4
|
+
readonly packageName: GeneratedPackageName;
|
|
4
5
|
readonly packageManager: PackageManager;
|
|
5
6
|
readonly target: ProjectTarget;
|
|
6
7
|
}
|
|
7
|
-
export declare function writeStarter(
|
|
8
|
+
export declare function writeStarter(targetDirectoryInput: string, options: StarterOptions): Promise<void>;
|
package/dist/starter.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { absoluteFsPath, } from './identity.js';
|
|
1
2
|
import { readFileSync } from 'node:fs';
|
|
2
3
|
import { cp, readFile, rename, writeFile } from 'node:fs/promises';
|
|
3
4
|
import { join } from 'node:path';
|
|
@@ -19,7 +20,8 @@ const renamedTemplateFiles = new Map([
|
|
|
19
20
|
['_oxlintrc.json', '.oxlintrc.json'],
|
|
20
21
|
['_oxfmtrc.json', '.oxfmtrc.json'],
|
|
21
22
|
]);
|
|
22
|
-
export async function writeStarter(
|
|
23
|
+
export async function writeStarter(targetDirectoryInput, options) {
|
|
24
|
+
const targetDirectory = absoluteFsPath(targetDirectoryInput);
|
|
23
25
|
const isTarget = createIsTarget(options.target);
|
|
24
26
|
await cp(baseTemplateDirectory, targetDirectory, { recursive: true });
|
|
25
27
|
await cp(join(targetsTemplateDirectory, options.target), targetDirectory, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-loutre",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.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.
|
|
21
|
+
"@loutrejs/loutre": "^0.10.0",
|
|
22
22
|
"commander": "^15.0.0",
|
|
23
23
|
"ts-pattern": "^5.9.2"
|
|
24
24
|
},
|