@contember/create 2.2.0-alpha.2 → 2.2.0-alpha.20
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/CLAUDE.md +22 -0
- package/dist/development/run.cjs +7 -7
- package/dist/development/run.cjs.map +1 -1
- package/dist/development/run.js +8 -8
- package/dist/development/run.js.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs +36 -23
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.js +37 -24
- package/dist/development/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/development/src/lib/FileSystem.cjs +10 -4
- package/dist/development/src/lib/FileSystem.cjs.map +1 -1
- package/dist/development/src/lib/FileSystem.js +8 -2
- package/dist/development/src/lib/FileSystem.js.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.cjs +71 -60
- package/dist/development/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.js +71 -60
- package/dist/development/src/lib/TemplateInstaller.js.map +1 -1
- package/dist/development/src/lib/fsErrors.cjs +7 -0
- package/dist/development/src/lib/fsErrors.cjs.map +1 -0
- package/dist/development/src/lib/fsErrors.js +7 -0
- package/dist/development/src/lib/fsErrors.js.map +1 -0
- package/dist/development/src/lib/projectPath.cjs +66 -0
- package/dist/development/src/lib/projectPath.cjs.map +1 -0
- package/dist/development/src/lib/projectPath.js +66 -0
- package/dist/development/src/lib/projectPath.js.map +1 -0
- package/dist/development/src/lib/remoteTemplate.cjs +108 -0
- package/dist/development/src/lib/remoteTemplate.cjs.map +1 -0
- package/dist/development/src/lib/remoteTemplate.js +108 -0
- package/dist/development/src/lib/remoteTemplate.js.map +1 -0
- package/dist/development/src/lib/tar.cjs +243 -0
- package/dist/development/src/lib/tar.cjs.map +1 -0
- package/dist/development/src/lib/tar.js +243 -0
- package/dist/development/src/lib/tar.js.map +1 -0
- package/dist/production/run.cjs +7 -7
- package/dist/production/run.cjs.map +1 -1
- package/dist/production/run.js +8 -8
- package/dist/production/run.js.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs +36 -23
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.js +37 -24
- package/dist/production/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/production/src/lib/FileSystem.cjs +10 -4
- package/dist/production/src/lib/FileSystem.cjs.map +1 -1
- package/dist/production/src/lib/FileSystem.js +8 -2
- package/dist/production/src/lib/FileSystem.js.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.cjs +71 -60
- package/dist/production/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.js +71 -60
- package/dist/production/src/lib/TemplateInstaller.js.map +1 -1
- package/dist/production/src/lib/fsErrors.cjs +7 -0
- package/dist/production/src/lib/fsErrors.cjs.map +1 -0
- package/dist/production/src/lib/fsErrors.js +7 -0
- package/dist/production/src/lib/fsErrors.js.map +1 -0
- package/dist/production/src/lib/projectPath.cjs +66 -0
- package/dist/production/src/lib/projectPath.cjs.map +1 -0
- package/dist/production/src/lib/projectPath.js +66 -0
- package/dist/production/src/lib/projectPath.js.map +1 -0
- package/dist/production/src/lib/remoteTemplate.cjs +108 -0
- package/dist/production/src/lib/remoteTemplate.cjs.map +1 -0
- package/dist/production/src/lib/remoteTemplate.js +108 -0
- package/dist/production/src/lib/remoteTemplate.js.map +1 -0
- package/dist/production/src/lib/tar.cjs +243 -0
- package/dist/production/src/lib/tar.cjs.map +1 -0
- package/dist/production/src/lib/tar.js +243 -0
- package/dist/production/src/lib/tar.js.map +1 -0
- package/dist/types/commands/WorkspaceCreateCommand.d.ts +15 -3
- package/dist/types/commands/WorkspaceCreateCommand.d.ts.map +1 -1
- package/dist/types/lib/FileSystem.d.ts +2 -0
- package/dist/types/lib/FileSystem.d.ts.map +1 -1
- package/dist/types/lib/TemplateInstaller.d.ts +9 -1
- package/dist/types/lib/TemplateInstaller.d.ts.map +1 -1
- package/dist/types/lib/fsErrors.d.ts +3 -0
- package/dist/types/lib/fsErrors.d.ts.map +1 -0
- package/dist/types/lib/projectPath.d.ts +12 -0
- package/dist/types/lib/projectPath.d.ts.map +1 -0
- package/dist/types/lib/remoteTemplate.d.ts +15 -0
- package/dist/types/lib/remoteTemplate.d.ts.map +1 -0
- package/dist/types/lib/tar.d.ts +28 -0
- package/dist/types/lib/tar.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -7
- package/resources/templates/default/README.md +3 -1
- package/resources/templates/default/admin/app/components/navigation.tsx +95 -8
- package/resources/templates/default/admin/app/pages/tenant.tsx +328 -77
- package/resources/templates/default/admin/entrypoint/components/login.tsx +1 -1
- package/resources/templates/default/admin/entrypoint/pages/magicLink.tsx +1 -1
- package/resources/templates/default/admin/entrypoint/pages/magicLinkSent.tsx +1 -1
- package/resources/templates/default/admin/entrypoint/pages/passwordReset.tsx +1 -1
- package/resources/templates/default/admin/entrypoint/pages/resetRequest.tsx +1 -1
- package/resources/templates/default/admin/entrypoint/pages/resetRequestSuccess.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/editor-inline-toolbar.tsx +3 -0
- package/resources/templates/default/admin/lib/editor/sortable-block.tsx +5 -4
- package/resources/templates/default/admin/lib/tenant/config/auth-policy-list.tsx +86 -0
- package/resources/templates/default/admin/lib/tenant/config/common.tsx +71 -0
- package/resources/templates/default/admin/lib/tenant/config/identity-provider-list.tsx +113 -0
- package/resources/templates/default/admin/lib/tenant/config/index.ts +5 -0
- package/resources/templates/default/admin/lib/tenant/config/mail-template-list.tsx +108 -0
- package/resources/templates/default/admin/lib/tenant/config/tenant-config-view.tsx +182 -0
- package/resources/templates/default/admin/lib/tenant/dict.ts +453 -4
- package/resources/templates/default/admin/lib/tenant/errors.ts +10 -0
- package/resources/templates/default/admin/lib/tenant/forms/add-project-member.tsx +57 -0
- package/resources/templates/default/admin/lib/tenant/forms/change-my-profile.tsx +40 -0
- package/resources/templates/default/admin/lib/tenant/forms/change-profile.tsx +55 -0
- package/resources/templates/default/admin/lib/tenant/forms/common.tsx +9 -2
- package/resources/templates/default/admin/lib/tenant/forms/create-global-api-key.tsx +69 -0
- package/resources/templates/default/admin/lib/tenant/forms/global-roles-control.tsx +113 -0
- package/resources/templates/default/admin/lib/tenant/forms/index.ts +11 -0
- package/resources/templates/default/admin/lib/tenant/forms/invite.tsx +42 -4
- package/resources/templates/default/admin/lib/tenant/forms/login.tsx +4 -10
- package/resources/templates/default/admin/lib/tenant/forms/memberships-control.tsx +3 -1
- package/resources/templates/default/admin/lib/tenant/forms/mfa-code-fields.tsx +81 -0
- package/resources/templates/default/admin/lib/tenant/forms/passwordless-signin.tsx +4 -10
- package/resources/templates/default/admin/lib/tenant/forms/set-person-password.tsx +58 -0
- package/resources/templates/default/admin/lib/tenant/forms/set-project-secret.tsx +59 -0
- package/resources/templates/default/admin/lib/tenant/forms/sign-up.tsx +73 -0
- package/resources/templates/default/admin/lib/tenant/hooks/index.ts +2 -0
- package/resources/templates/default/admin/lib/tenant/idp/identity-provider-connections.tsx +124 -0
- package/resources/templates/default/admin/lib/tenant/idp/index.ts +1 -0
- package/resources/templates/default/admin/lib/tenant/index.ts +7 -0
- package/resources/templates/default/admin/lib/tenant/listing/api-key-list.tsx +160 -22
- package/resources/templates/default/admin/lib/tenant/listing/auth-log-list.tsx +179 -0
- package/resources/templates/default/admin/lib/tenant/listing/global-api-key-list.tsx +149 -0
- package/resources/templates/default/admin/lib/tenant/listing/index.ts +7 -0
- package/resources/templates/default/admin/lib/tenant/listing/member-delete-dialog.tsx +1 -1
- package/resources/templates/default/admin/lib/tenant/listing/member-list.tsx +20 -11
- package/resources/templates/default/admin/lib/tenant/listing/mfa.tsx +29 -0
- package/resources/templates/default/admin/lib/tenant/listing/person-actions.tsx +179 -0
- package/resources/templates/default/admin/lib/tenant/listing/person-detail.tsx +141 -0
- package/resources/templates/default/admin/lib/tenant/listing/person-list.tsx +13 -2
- package/resources/templates/default/admin/lib/tenant/listing/persons-list.tsx +128 -0
- package/resources/templates/default/admin/lib/tenant/listing/project-secret-list.tsx +82 -0
- package/resources/templates/default/admin/lib/tenant/otp/backup-codes.tsx +81 -0
- package/resources/templates/default/admin/lib/tenant/otp/email-otp-setup.tsx +133 -0
- package/resources/templates/default/admin/lib/tenant/otp/index.ts +2 -0
- package/resources/templates/default/admin/lib/tenant/security/index.ts +2 -0
- package/resources/templates/default/admin/lib/tenant/security/passwordless-toggle.tsx +63 -0
- package/resources/templates/default/admin/lib/tenant/security/session-list.tsx +143 -0
- package/resources/templates/default/admin/lib/ui/label.tsx +25 -2
- package/resources/templates/default/admin/lib/ui/menu.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/progress.tsx +75 -11
- package/resources/templates/default/admin/lib/ui/separator.tsx +27 -3
- package/resources/templates/default/admin/lib/ui/sidebar.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/toggle.tsx +41 -2
- package/resources/templates/default/admin/lib/utils/classNames.ts +107 -0
- package/resources/templates/default/admin/lib/utils/cn.ts +3 -3
- package/resources/templates/default/admin/lib/utils/index.ts +1 -0
- package/resources/templates/default/admin/lib/utils/uic.tsx +2 -3
- package/resources/templates/default/admin/package.json +1 -7
- package/resources/templates/default/docker/object-storage/README.md +13 -0
- package/resources/templates/default/docker/object-storage/identities.json +13 -0
- package/resources/templates/default/docker-compose.yaml +29 -7
- package/src/commands/WorkspaceCreateCommand.ts +51 -24
- package/src/lib/FileSystem.ts +7 -2
- package/src/lib/TemplateInstaller.ts +87 -69
- package/src/lib/fsErrors.ts +2 -0
- package/src/lib/projectPath.ts +79 -0
- package/src/lib/remoteTemplate.ts +130 -0
- package/src/lib/tar.ts +283 -0
- package/src/run.ts +8 -7
- package/tests/cases/unit/create-process.test.ts +66 -0
- package/tests/cases/unit/fileSystem.test.ts +14 -0
- package/tests/cases/unit/fixtures/template.tar.gz +0 -0
- package/tests/cases/unit/remoteTemplate.test.ts +277 -0
- package/tests/cases/unit/template-installer-cleanup.test.ts +150 -0
- package/tests/cases/unit/template-installer-containment.test.ts +133 -0
- package/tests/cases/unit/template-installer-symlinks.test.ts +37 -0
- package/tests/cases/unit/workspace-create.test.ts +81 -0
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# create
|
|
2
|
+
|
|
3
|
+
`npm create @contember/…` scaffolder. The project template lives in `resources/templates/default/` — `admin/`, `api/`, `client/`, `docker/` and the compose/config files a new project starts from.
|
|
4
|
+
|
|
5
|
+
## `admin/lib` is generated, not source
|
|
6
|
+
|
|
7
|
+
`resources/templates/default/admin/lib/` is **gitignored** (root `.gitignore`) and assembled at pre-build by `resources/templates/default/scripts/assemble-ui-lib.mjs`:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
bun run --cwd packages/create pre-build # refresh it after changing a UI package
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The script merges `react-ui-lib-base` (flat) + `react-ui-lib-tenant` (into `tenant/`) + `react-ui-lib` (flat), rebuilds the colliding `index.ts` / `form/index.ts` barrels, and rewrites `@contember/react-ui-lib-base` → `~/lib` and `@contember/react-ui-lib-tenant` → `~/lib/tenant`. A generated project owns that tree outright, which is the point — the user customises it freely.
|
|
14
|
+
|
|
15
|
+
**Why this trips people up:** the output looks byte-identical to the package sources except for the imports, so it reads like a hand-maintained copy that has drifted. It has not — a diff against the packages only tells you which branch was last built. Never mirror files into it by hand and never commit it.
|
|
16
|
+
|
|
17
|
+
Two consequences:
|
|
18
|
+
|
|
19
|
+
- **The template is not typechecked by CI** (it has no `node_modules`). To verify template code, temporarily add `customConditions: ["typescript"]` to `admin/tsconfig.json` (it already maps `~/*`) — node resolution then finds the repo-root `node_modules` and the workspace packages' sources. Expect unavoidable errors for `import.meta.env` / `glob`, `index.css` and `@sentry/react`.
|
|
20
|
+
- Because base's dictionary lands at `~/lib/dict` and tenant's at `~/lib/tenant/dict`, template code reading `dict.tenant.*` must import the latter.
|
|
21
|
+
|
|
22
|
+
Only `admin/app/`, `admin/entrypoint/` and the other tracked template directories are real source.
|
package/dist/development/run.cjs
CHANGED
|
@@ -2,15 +2,18 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
const cliCommon = require("@contember/cli-common");
|
|
4
4
|
const WorkspaceCreateCommand = require("./src/commands/WorkspaceCreateCommand.cjs");
|
|
5
|
+
const FileSystem = require("./src/lib/FileSystem.cjs");
|
|
5
6
|
const TemplateInstaller = require("./src/lib/TemplateInstaller.cjs");
|
|
6
7
|
const paths = require("./src/paths.cjs");
|
|
7
|
-
const
|
|
8
|
+
const output = new cliCommon.Output();
|
|
9
|
+
output.applyGlobalOptions(cliCommon.readGlobalOptionsFromArgs(process.argv.slice(2)));
|
|
8
10
|
(async () => {
|
|
9
11
|
const commandManager = new cliCommon.CommandManager({
|
|
10
12
|
["workspace"]: () => new WorkspaceCreateCommand.WorkspaceCreateCommand(
|
|
11
13
|
new TemplateInstaller.TemplateInstaller(
|
|
12
14
|
paths.resourcesDir,
|
|
13
|
-
new FileSystem.FileSystem()
|
|
15
|
+
new FileSystem.FileSystem(),
|
|
16
|
+
output
|
|
14
17
|
)
|
|
15
18
|
)
|
|
16
19
|
});
|
|
@@ -18,10 +21,7 @@ const FileSystem = require("./src/lib/FileSystem.cjs");
|
|
|
18
21
|
if (nodeVersion && Number(nodeVersion[1]) < 18) {
|
|
19
22
|
throw `Node >= 18 is required`;
|
|
20
23
|
}
|
|
21
|
-
const app = new cliCommon.Application(commandManager, `Contember installer
|
|
24
|
+
const app = new cliCommon.Application(commandManager, `Contember installer`, output);
|
|
22
25
|
await app.runCommand("workspace", process.argv.slice(2));
|
|
23
|
-
})().catch((
|
|
24
|
-
console.log(e);
|
|
25
|
-
process.exit(1);
|
|
26
|
-
});
|
|
26
|
+
})().catch((error) => cliCommon.exitProcess(cliCommon.renderCliError(error, output)));
|
|
27
27
|
//# sourceMappingURL=run.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.cjs","sources":["../../../packages/create/src/run.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Application, CommandManager } from '@contember/cli-common'\nimport { WorkspaceCreateCommand } from './commands/index.js'\nimport {
|
|
1
|
+
{"version":3,"file":"run.cjs","sources":["../../../packages/create/src/run.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Application, CommandManager, exitProcess, Output, readGlobalOptionsFromArgs, renderCliError } from '@contember/cli-common'\nimport { WorkspaceCreateCommand } from './commands/index.js'\nimport { FileSystem } from './lib/FileSystem.js'\nimport { TemplateInstaller } from './lib/TemplateInstaller.js'\nimport { resourcesDir } from './paths.js'\n\nconst output = new Output()\noutput.applyGlobalOptions(readGlobalOptionsFromArgs(process.argv.slice(2)))\n;(async () => {\n\tconst commandManager = new CommandManager({\n\t\t['workspace']: () =>\n\t\t\tnew WorkspaceCreateCommand(\n\t\t\t\tnew TemplateInstaller(\n\t\t\t\t\tresourcesDir,\n\t\t\t\t\tnew FileSystem(),\n\t\t\t\t\toutput,\n\t\t\t\t),\n\t\t\t),\n\t})\n\n\tconst nodeVersion = process.version.match(/^v?(\\d+)\\..+$/)\n\tif (nodeVersion && Number(nodeVersion[1]) < 18) {\n\t\tthrow `Node >= 18 is required`\n\t}\n\tconst app = new Application(commandManager, `Contember installer`, output)\n\tawait app.runCommand('workspace', process.argv.slice(2))\n})().catch(error => exitProcess(renderCliError(error, output)))\n"],"names":["Output","readGlobalOptionsFromArgs","CommandManager","WorkspaceCreateCommand","TemplateInstaller","resourcesDir","FileSystem","Application","exitProcess","renderCliError"],"mappings":";;;;;;;AAOA,MAAM,SAAS,IAAIA,UAAAA,OAAA;AACnB,OAAO,mBAAmBC,UAAAA,0BAA0B,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC;AAAA,CACxE,YAAY;AACb,QAAM,iBAAiB,IAAIC,yBAAe;AAAA,IACzC,CAAC,WAAW,GAAG,MACd,IAAIC,uBAAAA;AAAAA,MACH,IAAIC,kBAAAA;AAAAA,QACHC,MAAAA;AAAAA,QACA,IAAIC,sBAAA;AAAA,QACJ;AAAA,MAAA;AAAA,IACD;AAAA,EACD,CACD;AAED,QAAM,cAAc,QAAQ,QAAQ,MAAM,eAAe;AACzD,MAAI,eAAe,OAAO,YAAY,CAAC,CAAC,IAAI,IAAI;AAC/C,UAAM;AAAA,EACP;AACA,QAAM,MAAM,IAAIC,UAAAA,YAAY,gBAAgB,uBAAuB,MAAM;AACzE,QAAM,IAAI,WAAW,aAAa,QAAQ,KAAK,MAAM,CAAC,CAAC;AACxD,KAAK,MAAM,CAAA,UAASC,UAAAA,YAAYC,UAAAA,eAAe,OAAO,MAAM,CAAC,CAAC;"}
|
package/dist/development/run.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { CommandManager, Application } from "@contember/cli-common";
|
|
2
|
+
import { Output, readGlobalOptionsFromArgs, CommandManager, Application, exitProcess, renderCliError } from "@contember/cli-common";
|
|
3
3
|
import { WorkspaceCreateCommand } from "./src/commands/WorkspaceCreateCommand.js";
|
|
4
|
+
import { FileSystem } from "./src/lib/FileSystem.js";
|
|
4
5
|
import { TemplateInstaller } from "./src/lib/TemplateInstaller.js";
|
|
5
6
|
import { resourcesDir } from "./src/paths.js";
|
|
6
|
-
|
|
7
|
+
const output = new Output();
|
|
8
|
+
output.applyGlobalOptions(readGlobalOptionsFromArgs(process.argv.slice(2)));
|
|
7
9
|
(async () => {
|
|
8
10
|
const commandManager = new CommandManager({
|
|
9
11
|
["workspace"]: () => new WorkspaceCreateCommand(
|
|
10
12
|
new TemplateInstaller(
|
|
11
13
|
resourcesDir,
|
|
12
|
-
new FileSystem()
|
|
14
|
+
new FileSystem(),
|
|
15
|
+
output
|
|
13
16
|
)
|
|
14
17
|
)
|
|
15
18
|
});
|
|
@@ -17,10 +20,7 @@ import { FileSystem } from "./src/lib/FileSystem.js";
|
|
|
17
20
|
if (nodeVersion && Number(nodeVersion[1]) < 18) {
|
|
18
21
|
throw `Node >= 18 is required`;
|
|
19
22
|
}
|
|
20
|
-
const app = new Application(commandManager, `Contember installer
|
|
23
|
+
const app = new Application(commandManager, `Contember installer`, output);
|
|
21
24
|
await app.runCommand("workspace", process.argv.slice(2));
|
|
22
|
-
})().catch((
|
|
23
|
-
console.log(e);
|
|
24
|
-
process.exit(1);
|
|
25
|
-
});
|
|
25
|
+
})().catch((error) => exitProcess(renderCliError(error, output)));
|
|
26
26
|
//# sourceMappingURL=run.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sources":["../../../packages/create/src/run.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Application, CommandManager } from '@contember/cli-common'\nimport { WorkspaceCreateCommand } from './commands/index.js'\nimport {
|
|
1
|
+
{"version":3,"file":"run.js","sources":["../../../packages/create/src/run.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Application, CommandManager, exitProcess, Output, readGlobalOptionsFromArgs, renderCliError } from '@contember/cli-common'\nimport { WorkspaceCreateCommand } from './commands/index.js'\nimport { FileSystem } from './lib/FileSystem.js'\nimport { TemplateInstaller } from './lib/TemplateInstaller.js'\nimport { resourcesDir } from './paths.js'\n\nconst output = new Output()\noutput.applyGlobalOptions(readGlobalOptionsFromArgs(process.argv.slice(2)))\n;(async () => {\n\tconst commandManager = new CommandManager({\n\t\t['workspace']: () =>\n\t\t\tnew WorkspaceCreateCommand(\n\t\t\t\tnew TemplateInstaller(\n\t\t\t\t\tresourcesDir,\n\t\t\t\t\tnew FileSystem(),\n\t\t\t\t\toutput,\n\t\t\t\t),\n\t\t\t),\n\t})\n\n\tconst nodeVersion = process.version.match(/^v?(\\d+)\\..+$/)\n\tif (nodeVersion && Number(nodeVersion[1]) < 18) {\n\t\tthrow `Node >= 18 is required`\n\t}\n\tconst app = new Application(commandManager, `Contember installer`, output)\n\tawait app.runCommand('workspace', process.argv.slice(2))\n})().catch(error => exitProcess(renderCliError(error, output)))\n"],"names":[],"mappings":";;;;;;AAOA,MAAM,SAAS,IAAI,OAAA;AACnB,OAAO,mBAAmB,0BAA0B,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC;AAAA,CACxE,YAAY;AACb,QAAM,iBAAiB,IAAI,eAAe;AAAA,IACzC,CAAC,WAAW,GAAG,MACd,IAAI;AAAA,MACH,IAAI;AAAA,QACH;AAAA,QACA,IAAI,WAAA;AAAA,QACJ;AAAA,MAAA;AAAA,IACD;AAAA,EACD,CACD;AAED,QAAM,cAAc,QAAQ,QAAQ,MAAM,eAAe;AACzD,MAAI,eAAe,OAAO,YAAY,CAAC,CAAC,IAAI,IAAI;AAC/C,UAAM;AAAA,EACP;AACA,QAAM,MAAM,IAAI,YAAY,gBAAgB,uBAAuB,MAAM;AACzE,QAAM,IAAI,WAAW,aAAa,QAAQ,KAAK,MAAM,CAAC,CAAC;AACxD,KAAK,MAAM,CAAA,UAAS,YAAY,eAAe,OAAO,MAAM,CAAC,CAAC;"}
|
|
@@ -2,63 +2,76 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const cliCommon = require("@contember/cli-common");
|
|
4
4
|
const path = require("node:path");
|
|
5
|
-
const chalk = require("chalk");
|
|
6
5
|
const version = require("../lib/version.cjs");
|
|
7
6
|
const packageManagerDetector = require("../lib/packageManagerDetector.cjs");
|
|
7
|
+
const defaultRuntime = {
|
|
8
|
+
cwd: () => process.cwd(),
|
|
9
|
+
getPackageVersion: version.getPackageVersion,
|
|
10
|
+
detectPackageManager: packageManagerDetector.detectPackageManager
|
|
11
|
+
};
|
|
8
12
|
class WorkspaceCreateCommand extends cliCommon.Command {
|
|
9
|
-
constructor(templateInstaller) {
|
|
13
|
+
constructor(templateInstaller, runtime = defaultRuntime) {
|
|
10
14
|
super();
|
|
11
15
|
this.templateInstaller = templateInstaller;
|
|
16
|
+
this.runtime = runtime;
|
|
12
17
|
}
|
|
13
18
|
configure(configuration) {
|
|
14
19
|
configuration.description("Creates a new Contember project");
|
|
15
20
|
configuration.argument("projectName");
|
|
16
21
|
configuration.option("template").shortcut("t").valueRequired().description("Template name or remote source");
|
|
17
22
|
}
|
|
18
|
-
async execute(input) {
|
|
23
|
+
async execute(input, output) {
|
|
19
24
|
const projectName = input.getArgument("projectName");
|
|
20
|
-
const projectDirectory = path.join(
|
|
21
|
-
const packageManager =
|
|
25
|
+
const projectDirectory = path.join(this.runtime.cwd(), projectName);
|
|
26
|
+
const packageManager = this.runtime.detectPackageManager();
|
|
22
27
|
const template = input.getOption("template") ?? "default";
|
|
23
28
|
await this.templateInstaller.installTemplate(template, projectDirectory, {
|
|
24
|
-
version: await
|
|
29
|
+
version: await this.runtime.getPackageVersion(),
|
|
25
30
|
projectName,
|
|
26
31
|
packageManager
|
|
27
32
|
});
|
|
28
|
-
|
|
33
|
+
const result = { projectName, projectDirectory, template, packageManager };
|
|
34
|
+
output.data(result, {
|
|
35
|
+
human: (value) => createDocs(value),
|
|
36
|
+
quiet: (value) => value.projectDirectory
|
|
37
|
+
});
|
|
29
38
|
}
|
|
30
39
|
}
|
|
31
|
-
const createDocs = (projectDirectory, projectName, packageManager) =>
|
|
32
|
-
|
|
40
|
+
const createDocs = ({ projectDirectory, projectName, packageManager }) => {
|
|
41
|
+
const safeProjectDirectory = cliCommon.escapeTerminalText(projectDirectory);
|
|
42
|
+
const safeProjectName = cliCommon.escapeTerminalText(projectName);
|
|
43
|
+
const safePackageManager = cliCommon.escapeTerminalText(packageManager);
|
|
44
|
+
return `
|
|
45
|
+
Contember project successfully created in ${safeProjectDirectory}
|
|
33
46
|
|
|
34
47
|
Next steps:
|
|
35
48
|
|
|
36
49
|
1. Navigate to the project directory:
|
|
37
|
-
$ ${
|
|
50
|
+
$ ${cliCommon.style("green", `cd ${safeProjectName}`)}
|
|
38
51
|
|
|
39
52
|
2. Install dependencies:
|
|
40
|
-
$ ${
|
|
53
|
+
$ ${cliCommon.style("green", `${safePackageManager} install`)}
|
|
41
54
|
|
|
42
55
|
3. Start the Contember stack:
|
|
43
|
-
$ ${
|
|
56
|
+
$ ${cliCommon.style("green", `${safePackageManager} start`)}
|
|
44
57
|
|
|
45
58
|
Available services:
|
|
46
59
|
|
|
47
|
-
${
|
|
48
|
-
- Contember Admin ${
|
|
60
|
+
${cliCommon.style("bold", "UI & Admin")}
|
|
61
|
+
- Contember Admin ${cliCommon.style("blue", "http://localhost:1480")}
|
|
49
62
|
|
|
50
|
-
${
|
|
51
|
-
- Contember Engine API ${
|
|
63
|
+
${cliCommon.style("bold", "API & Backend")}
|
|
64
|
+
- Contember Engine API ${cliCommon.style("blue", "http://localhost:1481")}
|
|
52
65
|
Auth token: 0000000000000000000000000000000000000000
|
|
53
66
|
|
|
54
|
-
${
|
|
55
|
-
- PostgreSQL database ${
|
|
56
|
-
-
|
|
57
|
-
- Mailpit SMTP testing ${
|
|
58
|
-
- Adminer DB manager ${
|
|
59
|
-
- Minio Dashboard ${chalk.blue("http://localhost:1486")} ${chalk.grey("credentials: contember / contember")}
|
|
67
|
+
${cliCommon.style("bold", "Development Tools")}
|
|
68
|
+
- PostgreSQL database ${cliCommon.style("blue", "http://localhost:1482")} ${cliCommon.style("grey", "credentials: contember / contember")}
|
|
69
|
+
- S3 object storage ${cliCommon.style("blue", "http://localhost:1483")} ${cliCommon.style("grey", "credentials: contember / contember")}
|
|
70
|
+
- Mailpit SMTP testing ${cliCommon.style("blue", "http://localhost:1484")}
|
|
71
|
+
- Adminer DB manager ${cliCommon.style("blue", "http://localhost:1485")}
|
|
60
72
|
|
|
61
|
-
${
|
|
73
|
+
${cliCommon.style("bold", "Need help?")} Ask the community: https://github.com/orgs/contember/discussions
|
|
62
74
|
`;
|
|
75
|
+
};
|
|
63
76
|
exports.WorkspaceCreateCommand = WorkspaceCreateCommand;
|
|
64
77
|
//# sourceMappingURL=WorkspaceCreateCommand.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceCreateCommand.cjs","sources":["../../../../../packages/create/src/commands/WorkspaceCreateCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { join } from 'node:path'\nimport
|
|
1
|
+
{"version":3,"file":"WorkspaceCreateCommand.cjs","sources":["../../../../../packages/create/src/commands/WorkspaceCreateCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, escapeTerminalText, Input, Output, style } from '@contember/cli-common'\nimport { join } from 'node:path'\nimport { TemplateInstaller } from '../lib/TemplateInstaller.js'\nimport { getPackageVersion } from '../lib/version.js'\nimport { detectPackageManager } from '../lib/packageManagerDetector.js'\n\ntype Args = {\n\tprojectName: string\n}\n\ntype Options = {\n\ttemplate: string\n}\n\nexport interface WorkspaceCreateResult {\n\tprojectName: string\n\tprojectDirectory: string\n\ttemplate: string\n\tpackageManager: string\n}\n\nexport interface WorkspaceCreateRuntime {\n\tcwd(): string\n\tgetPackageVersion(): Promise<string>\n\tdetectPackageManager(): string\n}\n\nconst defaultRuntime: WorkspaceCreateRuntime = {\n\tcwd: () => process.cwd(),\n\tgetPackageVersion,\n\tdetectPackageManager,\n}\n\nexport class WorkspaceCreateCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly templateInstaller: Pick<TemplateInstaller, 'installTemplate'>,\n\t\tprivate readonly runtime: WorkspaceCreateRuntime = defaultRuntime,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Creates a new Contember project')\n\t\tconfiguration.argument('projectName')\n\t\tconfiguration.option('template').shortcut('t').valueRequired().description('Template name or remote source')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>, output: Output): Promise<void> {\n\t\tconst projectName = input.getArgument('projectName')\n\t\tconst projectDirectory = join(this.runtime.cwd(), projectName)\n\t\tconst packageManager = this.runtime.detectPackageManager()\n\t\tconst template = input.getOption('template') ?? 'default'\n\n\t\tawait this.templateInstaller.installTemplate(template, projectDirectory, {\n\t\t\tversion: await this.runtime.getPackageVersion(),\n\t\t\tprojectName: projectName,\n\t\t\tpackageManager: packageManager,\n\t\t})\n\n\t\tconst result: WorkspaceCreateResult = { projectName, projectDirectory, template, packageManager }\n\t\toutput.data(result, {\n\t\t\thuman: value => createDocs(value),\n\t\t\tquiet: value => value.projectDirectory,\n\t\t})\n\t}\n}\n\nconst createDocs = ({ projectDirectory, projectName, packageManager }: WorkspaceCreateResult) => {\n\tconst safeProjectDirectory = escapeTerminalText(projectDirectory)\n\tconst safeProjectName = escapeTerminalText(projectName)\n\tconst safePackageManager = escapeTerminalText(packageManager)\n\treturn `\nContember project successfully created in ${safeProjectDirectory}\n\nNext steps:\n\n1. Navigate to the project directory:\n $ ${style('green', `cd ${safeProjectName}`)}\n\n2. Install dependencies:\n $ ${style('green', `${safePackageManager} install`)}\n\n3. Start the Contember stack:\n $ ${style('green', `${safePackageManager} start`)}\n\nAvailable services:\n\n${style('bold', 'UI & Admin')}\n- Contember Admin ${style('blue', 'http://localhost:1480')}\n\n${style('bold', 'API & Backend')}\n- Contember Engine API ${style('blue', 'http://localhost:1481')}\n Auth token: 0000000000000000000000000000000000000000\n\n${style('bold', 'Development Tools')}\n- PostgreSQL database ${style('blue', 'http://localhost:1482')} ${style('grey', 'credentials: contember / contember')}\n- S3 object storage ${style('blue', 'http://localhost:1483')} ${style('grey', 'credentials: contember / contember')}\n- Mailpit SMTP testing ${style('blue', 'http://localhost:1484')}\n- Adminer DB manager ${style('blue', 'http://localhost:1485')}\n\n${style('bold', 'Need help?')} Ask the community: https://github.com/orgs/contember/discussions\n`\n}\n"],"names":["getPackageVersion","detectPackageManager","Command","join","escapeTerminalText","style"],"mappings":";;;;;;AA2BA,MAAM,iBAAyC;AAAA,EAC9C,KAAK,MAAM,QAAQ,IAAA;AAAA,EAAI,mBACvBA,QAAAA;AAAAA,EAAA,sBACAC,uBAAAA;AACD;AAEO,MAAM,+BAA+BC,UAAAA,QAAuB;AAAA,EAClE,YACkB,mBACA,UAAkC,gBAClD;AACD,UAAA;AAHiB,SAAA,oBAAA;AACA,SAAA,UAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,iCAAiC;AAC3D,kBAAc,SAAS,aAAa;AACpC,kBAAc,OAAO,UAAU,EAAE,SAAS,GAAG,EAAE,cAAA,EAAgB,YAAY,gCAAgC;AAAA,EAC5G;AAAA,EAEA,MAAgB,QAAQ,OAA6B,QAA+B;AACnF,UAAM,cAAc,MAAM,YAAY,aAAa;AACnD,UAAM,mBAAmBC,KAAAA,KAAK,KAAK,QAAQ,IAAA,GAAO,WAAW;AAC7D,UAAM,iBAAiB,KAAK,QAAQ,qBAAA;AACpC,UAAM,WAAW,MAAM,UAAU,UAAU,KAAK;AAEhD,UAAM,KAAK,kBAAkB,gBAAgB,UAAU,kBAAkB;AAAA,MACxE,SAAS,MAAM,KAAK,QAAQ,kBAAA;AAAA,MAC5B;AAAA,MACA;AAAA,IAAA,CACA;AAED,UAAM,SAAgC,EAAE,aAAa,kBAAkB,UAAU,eAAA;AACjF,WAAO,KAAK,QAAQ;AAAA,MACnB,OAAO,CAAA,UAAS,WAAW,KAAK;AAAA,MAChC,OAAO,WAAS,MAAM;AAAA,IAAA,CACtB;AAAA,EACF;AACD;AAEA,MAAM,aAAa,CAAC,EAAE,kBAAkB,aAAa,qBAA4C;AAChG,QAAM,uBAAuBC,UAAAA,mBAAmB,gBAAgB;AAChE,QAAM,kBAAkBA,UAAAA,mBAAmB,WAAW;AACtD,QAAM,qBAAqBA,UAAAA,mBAAmB,cAAc;AAC5D,SAAO;AAAA,4CACoC,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA,OAKzDC,UAAAA,MAAM,SAAS,MAAM,eAAe,EAAE,CAAC;AAAA;AAAA;AAAA,OAGvCA,UAAAA,MAAM,SAAS,GAAG,kBAAkB,UAAU,CAAC;AAAA;AAAA;AAAA,OAG/CA,UAAAA,MAAM,SAAS,GAAG,kBAAkB,QAAQ,CAAC;AAAA;AAAA;AAAA;AAAA,EAIlDA,UAAAA,MAAM,QAAQ,YAAY,CAAC;AAAA,4BACDA,UAAAA,MAAM,QAAQ,uBAAuB,CAAC;AAAA;AAAA,EAEhEA,UAAAA,MAAM,QAAQ,eAAe,CAAC;AAAA,4BACJA,UAAAA,MAAM,QAAQ,uBAAuB,CAAC;AAAA;AAAA;AAAA,EAGhEA,UAAAA,MAAM,QAAQ,mBAAmB,CAAC;AAAA,4BACRA,UAAAA,MAAM,QAAQ,uBAAuB,CAAC,OAAOA,UAAAA,MAAM,QAAQ,oCAAoC,CAAC;AAAA,4BAChGA,UAAAA,MAAM,QAAQ,uBAAuB,CAAC,OAAOA,UAAAA,MAAM,QAAQ,oCAAoC,CAAC;AAAA,4BAChGA,UAAAA,MAAM,QAAQ,uBAAuB,CAAC;AAAA,4BACtCA,UAAAA,MAAM,QAAQ,uBAAuB,CAAC;AAAA;AAAA,EAEhEA,gBAAM,QAAQ,YAAY,CAAC;AAAA;AAE7B;;"}
|
|
@@ -1,63 +1,76 @@
|
|
|
1
|
-
import { Command } from "@contember/cli-common";
|
|
1
|
+
import { Command, escapeTerminalText, style } from "@contember/cli-common";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import chalk from "chalk";
|
|
4
3
|
import { getPackageVersion } from "../lib/version.js";
|
|
5
4
|
import { detectPackageManager } from "../lib/packageManagerDetector.js";
|
|
5
|
+
const defaultRuntime = {
|
|
6
|
+
cwd: () => process.cwd(),
|
|
7
|
+
getPackageVersion,
|
|
8
|
+
detectPackageManager
|
|
9
|
+
};
|
|
6
10
|
class WorkspaceCreateCommand extends Command {
|
|
7
|
-
constructor(templateInstaller) {
|
|
11
|
+
constructor(templateInstaller, runtime = defaultRuntime) {
|
|
8
12
|
super();
|
|
9
13
|
this.templateInstaller = templateInstaller;
|
|
14
|
+
this.runtime = runtime;
|
|
10
15
|
}
|
|
11
16
|
configure(configuration) {
|
|
12
17
|
configuration.description("Creates a new Contember project");
|
|
13
18
|
configuration.argument("projectName");
|
|
14
19
|
configuration.option("template").shortcut("t").valueRequired().description("Template name or remote source");
|
|
15
20
|
}
|
|
16
|
-
async execute(input) {
|
|
21
|
+
async execute(input, output) {
|
|
17
22
|
const projectName = input.getArgument("projectName");
|
|
18
|
-
const projectDirectory = join(
|
|
19
|
-
const packageManager = detectPackageManager();
|
|
23
|
+
const projectDirectory = join(this.runtime.cwd(), projectName);
|
|
24
|
+
const packageManager = this.runtime.detectPackageManager();
|
|
20
25
|
const template = input.getOption("template") ?? "default";
|
|
21
26
|
await this.templateInstaller.installTemplate(template, projectDirectory, {
|
|
22
|
-
version: await getPackageVersion(),
|
|
27
|
+
version: await this.runtime.getPackageVersion(),
|
|
23
28
|
projectName,
|
|
24
29
|
packageManager
|
|
25
30
|
});
|
|
26
|
-
|
|
31
|
+
const result = { projectName, projectDirectory, template, packageManager };
|
|
32
|
+
output.data(result, {
|
|
33
|
+
human: (value) => createDocs(value),
|
|
34
|
+
quiet: (value) => value.projectDirectory
|
|
35
|
+
});
|
|
27
36
|
}
|
|
28
37
|
}
|
|
29
|
-
const createDocs = (projectDirectory, projectName, packageManager) =>
|
|
30
|
-
|
|
38
|
+
const createDocs = ({ projectDirectory, projectName, packageManager }) => {
|
|
39
|
+
const safeProjectDirectory = escapeTerminalText(projectDirectory);
|
|
40
|
+
const safeProjectName = escapeTerminalText(projectName);
|
|
41
|
+
const safePackageManager = escapeTerminalText(packageManager);
|
|
42
|
+
return `
|
|
43
|
+
Contember project successfully created in ${safeProjectDirectory}
|
|
31
44
|
|
|
32
45
|
Next steps:
|
|
33
46
|
|
|
34
47
|
1. Navigate to the project directory:
|
|
35
|
-
$ ${
|
|
48
|
+
$ ${style("green", `cd ${safeProjectName}`)}
|
|
36
49
|
|
|
37
50
|
2. Install dependencies:
|
|
38
|
-
$ ${
|
|
51
|
+
$ ${style("green", `${safePackageManager} install`)}
|
|
39
52
|
|
|
40
53
|
3. Start the Contember stack:
|
|
41
|
-
$ ${
|
|
54
|
+
$ ${style("green", `${safePackageManager} start`)}
|
|
42
55
|
|
|
43
56
|
Available services:
|
|
44
57
|
|
|
45
|
-
${
|
|
46
|
-
- Contember Admin ${
|
|
58
|
+
${style("bold", "UI & Admin")}
|
|
59
|
+
- Contember Admin ${style("blue", "http://localhost:1480")}
|
|
47
60
|
|
|
48
|
-
${
|
|
49
|
-
- Contember Engine API ${
|
|
61
|
+
${style("bold", "API & Backend")}
|
|
62
|
+
- Contember Engine API ${style("blue", "http://localhost:1481")}
|
|
50
63
|
Auth token: 0000000000000000000000000000000000000000
|
|
51
64
|
|
|
52
|
-
${
|
|
53
|
-
- PostgreSQL database ${
|
|
54
|
-
-
|
|
55
|
-
- Mailpit SMTP testing ${
|
|
56
|
-
- Adminer DB manager ${
|
|
57
|
-
- Minio Dashboard ${chalk.blue("http://localhost:1486")} ${chalk.grey("credentials: contember / contember")}
|
|
65
|
+
${style("bold", "Development Tools")}
|
|
66
|
+
- PostgreSQL database ${style("blue", "http://localhost:1482")} ${style("grey", "credentials: contember / contember")}
|
|
67
|
+
- S3 object storage ${style("blue", "http://localhost:1483")} ${style("grey", "credentials: contember / contember")}
|
|
68
|
+
- Mailpit SMTP testing ${style("blue", "http://localhost:1484")}
|
|
69
|
+
- Adminer DB manager ${style("blue", "http://localhost:1485")}
|
|
58
70
|
|
|
59
|
-
${
|
|
71
|
+
${style("bold", "Need help?")} Ask the community: https://github.com/orgs/contember/discussions
|
|
60
72
|
`;
|
|
73
|
+
};
|
|
61
74
|
export {
|
|
62
75
|
WorkspaceCreateCommand
|
|
63
76
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceCreateCommand.js","sources":["../../../../../packages/create/src/commands/WorkspaceCreateCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { join } from 'node:path'\nimport
|
|
1
|
+
{"version":3,"file":"WorkspaceCreateCommand.js","sources":["../../../../../packages/create/src/commands/WorkspaceCreateCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, escapeTerminalText, Input, Output, style } from '@contember/cli-common'\nimport { join } from 'node:path'\nimport { TemplateInstaller } from '../lib/TemplateInstaller.js'\nimport { getPackageVersion } from '../lib/version.js'\nimport { detectPackageManager } from '../lib/packageManagerDetector.js'\n\ntype Args = {\n\tprojectName: string\n}\n\ntype Options = {\n\ttemplate: string\n}\n\nexport interface WorkspaceCreateResult {\n\tprojectName: string\n\tprojectDirectory: string\n\ttemplate: string\n\tpackageManager: string\n}\n\nexport interface WorkspaceCreateRuntime {\n\tcwd(): string\n\tgetPackageVersion(): Promise<string>\n\tdetectPackageManager(): string\n}\n\nconst defaultRuntime: WorkspaceCreateRuntime = {\n\tcwd: () => process.cwd(),\n\tgetPackageVersion,\n\tdetectPackageManager,\n}\n\nexport class WorkspaceCreateCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly templateInstaller: Pick<TemplateInstaller, 'installTemplate'>,\n\t\tprivate readonly runtime: WorkspaceCreateRuntime = defaultRuntime,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Creates a new Contember project')\n\t\tconfiguration.argument('projectName')\n\t\tconfiguration.option('template').shortcut('t').valueRequired().description('Template name or remote source')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>, output: Output): Promise<void> {\n\t\tconst projectName = input.getArgument('projectName')\n\t\tconst projectDirectory = join(this.runtime.cwd(), projectName)\n\t\tconst packageManager = this.runtime.detectPackageManager()\n\t\tconst template = input.getOption('template') ?? 'default'\n\n\t\tawait this.templateInstaller.installTemplate(template, projectDirectory, {\n\t\t\tversion: await this.runtime.getPackageVersion(),\n\t\t\tprojectName: projectName,\n\t\t\tpackageManager: packageManager,\n\t\t})\n\n\t\tconst result: WorkspaceCreateResult = { projectName, projectDirectory, template, packageManager }\n\t\toutput.data(result, {\n\t\t\thuman: value => createDocs(value),\n\t\t\tquiet: value => value.projectDirectory,\n\t\t})\n\t}\n}\n\nconst createDocs = ({ projectDirectory, projectName, packageManager }: WorkspaceCreateResult) => {\n\tconst safeProjectDirectory = escapeTerminalText(projectDirectory)\n\tconst safeProjectName = escapeTerminalText(projectName)\n\tconst safePackageManager = escapeTerminalText(packageManager)\n\treturn `\nContember project successfully created in ${safeProjectDirectory}\n\nNext steps:\n\n1. Navigate to the project directory:\n $ ${style('green', `cd ${safeProjectName}`)}\n\n2. Install dependencies:\n $ ${style('green', `${safePackageManager} install`)}\n\n3. Start the Contember stack:\n $ ${style('green', `${safePackageManager} start`)}\n\nAvailable services:\n\n${style('bold', 'UI & Admin')}\n- Contember Admin ${style('blue', 'http://localhost:1480')}\n\n${style('bold', 'API & Backend')}\n- Contember Engine API ${style('blue', 'http://localhost:1481')}\n Auth token: 0000000000000000000000000000000000000000\n\n${style('bold', 'Development Tools')}\n- PostgreSQL database ${style('blue', 'http://localhost:1482')} ${style('grey', 'credentials: contember / contember')}\n- S3 object storage ${style('blue', 'http://localhost:1483')} ${style('grey', 'credentials: contember / contember')}\n- Mailpit SMTP testing ${style('blue', 'http://localhost:1484')}\n- Adminer DB manager ${style('blue', 'http://localhost:1485')}\n\n${style('bold', 'Need help?')} Ask the community: https://github.com/orgs/contember/discussions\n`\n}\n"],"names":[],"mappings":";;;;AA2BA,MAAM,iBAAyC;AAAA,EAC9C,KAAK,MAAM,QAAQ,IAAA;AAAA,EACnB;AAAA,EACA;AACD;AAEO,MAAM,+BAA+B,QAAuB;AAAA,EAClE,YACkB,mBACA,UAAkC,gBAClD;AACD,UAAA;AAHiB,SAAA,oBAAA;AACA,SAAA,UAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,iCAAiC;AAC3D,kBAAc,SAAS,aAAa;AACpC,kBAAc,OAAO,UAAU,EAAE,SAAS,GAAG,EAAE,cAAA,EAAgB,YAAY,gCAAgC;AAAA,EAC5G;AAAA,EAEA,MAAgB,QAAQ,OAA6B,QAA+B;AACnF,UAAM,cAAc,MAAM,YAAY,aAAa;AACnD,UAAM,mBAAmB,KAAK,KAAK,QAAQ,IAAA,GAAO,WAAW;AAC7D,UAAM,iBAAiB,KAAK,QAAQ,qBAAA;AACpC,UAAM,WAAW,MAAM,UAAU,UAAU,KAAK;AAEhD,UAAM,KAAK,kBAAkB,gBAAgB,UAAU,kBAAkB;AAAA,MACxE,SAAS,MAAM,KAAK,QAAQ,kBAAA;AAAA,MAC5B;AAAA,MACA;AAAA,IAAA,CACA;AAED,UAAM,SAAgC,EAAE,aAAa,kBAAkB,UAAU,eAAA;AACjF,WAAO,KAAK,QAAQ;AAAA,MACnB,OAAO,CAAA,UAAS,WAAW,KAAK;AAAA,MAChC,OAAO,WAAS,MAAM;AAAA,IAAA,CACtB;AAAA,EACF;AACD;AAEA,MAAM,aAAa,CAAC,EAAE,kBAAkB,aAAa,qBAA4C;AAChG,QAAM,uBAAuB,mBAAmB,gBAAgB;AAChE,QAAM,kBAAkB,mBAAmB,WAAW;AACtD,QAAM,qBAAqB,mBAAmB,cAAc;AAC5D,SAAO;AAAA,4CACoC,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA,OAKzD,MAAM,SAAS,MAAM,eAAe,EAAE,CAAC;AAAA;AAAA;AAAA,OAGvC,MAAM,SAAS,GAAG,kBAAkB,UAAU,CAAC;AAAA;AAAA;AAAA,OAG/C,MAAM,SAAS,GAAG,kBAAkB,QAAQ,CAAC;AAAA;AAAA;AAAA;AAAA,EAIlD,MAAM,QAAQ,YAAY,CAAC;AAAA,4BACD,MAAM,QAAQ,uBAAuB,CAAC;AAAA;AAAA,EAEhE,MAAM,QAAQ,eAAe,CAAC;AAAA,4BACJ,MAAM,QAAQ,uBAAuB,CAAC;AAAA;AAAA;AAAA,EAGhE,MAAM,QAAQ,mBAAmB,CAAC;AAAA,4BACR,MAAM,QAAQ,uBAAuB,CAAC,OAAO,MAAM,QAAQ,oCAAoC,CAAC;AAAA,4BAChG,MAAM,QAAQ,uBAAuB,CAAC,OAAO,MAAM,QAAQ,oCAAoC,CAAC;AAAA,4BAChG,MAAM,QAAQ,uBAAuB,CAAC;AAAA,4BACtC,MAAM,QAAQ,uBAAuB,CAAC;AAAA;AAAA,EAEhE,MAAM,QAAQ,YAAY,CAAC;AAAA;AAE7B;"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const fs = require("node:fs/promises");
|
|
4
4
|
const os = require("node:os");
|
|
5
|
+
const path = require("node:path");
|
|
5
6
|
function _interopNamespaceDefault(e) {
|
|
6
7
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
7
8
|
if (e) {
|
|
@@ -27,20 +28,25 @@ class FileSystem {
|
|
|
27
28
|
__publicField(this, "readFile", fs__namespace.readFile);
|
|
28
29
|
__publicField(this, "writeFile", fs__namespace.writeFile);
|
|
29
30
|
__publicField(this, "rename", fs__namespace.rename);
|
|
31
|
+
__publicField(this, "realPath", fs__namespace.realpath);
|
|
32
|
+
__publicField(this, "lstat", fs__namespace.lstat);
|
|
30
33
|
__publicField(this, "readDir", fs__namespace.readdir);
|
|
31
|
-
__publicField(this, "copy", (source, destination, options) =>
|
|
34
|
+
__publicField(this, "copy", (source, destination, options) => (
|
|
35
|
+
// verbatimSymlinks: by default fs.cp rewrites relative links into absolute paths into the source tree
|
|
36
|
+
fs__namespace.cp(source, destination, { recursive: true, verbatimSymlinks: true, ...options })
|
|
37
|
+
));
|
|
32
38
|
__publicField(this, "unlink", fs__namespace.unlink);
|
|
33
39
|
__publicField(this, "remove", fs__namespace.rm);
|
|
34
|
-
__publicField(this, "pathExists", async (
|
|
40
|
+
__publicField(this, "pathExists", async (path2) => {
|
|
35
41
|
try {
|
|
36
|
-
await fs.access(
|
|
42
|
+
await fs.access(path2);
|
|
37
43
|
return true;
|
|
38
44
|
} catch {
|
|
39
45
|
return false;
|
|
40
46
|
}
|
|
41
47
|
});
|
|
42
48
|
__publicField(this, "createTempDir", async () => {
|
|
43
|
-
return await fs__namespace.mkdtemp(os.tmpdir());
|
|
49
|
+
return await fs__namespace.mkdtemp(path.join(os.tmpdir(), "contember-template-"));
|
|
44
50
|
});
|
|
45
51
|
}
|
|
46
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileSystem.cjs","sources":["../../../../../packages/create/src/lib/FileSystem.ts"],"sourcesContent":["import * as fs from 'node:fs/promises'\nimport { access } from 'node:fs/promises'\nimport { tmpdir } from 'node:os'\n\nexport class FileSystem {\n\treadFile = fs.readFile\n\twriteFile = fs.writeFile\n\trename = fs.rename\n\treadDir = fs.readdir\n\tcopy = (source: string, destination: string, options?: { filter?: (source: string, destination: string) => boolean }) =>\n\t\tfs.cp(source, destination, { recursive: true, ...options })\n\tunlink = fs.unlink\n\tremove = fs.rm\n\tpathExists = async (path: string) => {\n\t\ttry {\n\t\t\tawait access(path)\n\t\t\treturn true\n\t\t} catch {\n\t\t\treturn false\n\t\t}\n\t}\n\tcreateTempDir = async () => {\n\t\treturn await fs.mkdtemp(tmpdir())\n\t}\n}\n"],"names":["fs","access","tmpdir"],"mappings":"
|
|
1
|
+
{"version":3,"file":"FileSystem.cjs","sources":["../../../../../packages/create/src/lib/FileSystem.ts"],"sourcesContent":["import * as fs from 'node:fs/promises'\nimport { access } from 'node:fs/promises'\nimport { tmpdir } from 'node:os'\nimport { join } from 'node:path'\n\nexport class FileSystem {\n\treadFile = fs.readFile\n\twriteFile = fs.writeFile\n\trename = fs.rename\n\trealPath = fs.realpath\n\tlstat = fs.lstat\n\treadDir = fs.readdir\n\tcopy = (source: string, destination: string, options?: { filter?: (source: string, destination: string) => boolean }) =>\n\t\t// verbatimSymlinks: by default fs.cp rewrites relative links into absolute paths into the source tree\n\t\tfs.cp(source, destination, { recursive: true, verbatimSymlinks: true, ...options })\n\tunlink = fs.unlink\n\tremove = fs.rm\n\tpathExists = async (path: string) => {\n\t\ttry {\n\t\t\tawait access(path)\n\t\t\treturn true\n\t\t} catch {\n\t\t\treturn false\n\t\t}\n\t}\n\tcreateTempDir = async () => {\n\t\t// mkdtemp appends random characters to the prefix, so without a separator it would create `/tmpXXXXXX`\n\t\treturn await fs.mkdtemp(join(tmpdir(), 'contember-template-'))\n\t}\n}\n"],"names":["fs","path","access","join","tmpdir"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAKO,MAAM,WAAW;AAAA,EAAjB,cAAA;AACN,kBAAA,MAAA,YAAWA,cAAG,QAAA;AACd,kBAAA,MAAA,aAAYA,cAAG,SAAA;AACf,kBAAA,MAAA,UAASA,cAAG,MAAA;AACZ,kBAAA,MAAA,YAAWA,cAAG,QAAA;AACd,kBAAA,MAAA,SAAQA,cAAG,KAAA;AACX,kBAAA,MAAA,WAAUA,cAAG,OAAA;AACb,kBAAA,MAAA,QAAO,CAAC,QAAgB,aAAqB;AAAA;AAAA,MAE5CA,cAAG,GAAG,QAAQ,aAAa,EAAE,WAAW,MAAM,kBAAkB,MAAM,GAAG,QAAA,CAAS;AAAA,KAAA;AACnF,kBAAA,MAAA,UAASA,cAAG,MAAA;AACZ,kBAAA,MAAA,UAASA,cAAG,EAAA;AACZ,kBAAA,MAAA,cAAa,OAAOC,UAAiB;AACpC,UAAI;AACH,cAAMC,GAAAA,OAAOD,KAAI;AACjB,eAAO;AAAA,MACR,QAAQ;AACP,eAAO;AAAA,MACR;AAAA,IACD,CAAA;AACA,kBAAA,MAAA,iBAAgB,YAAY;AAE3B,aAAO,MAAMD,cAAG,QAAQG,KAAAA,KAAKC,GAAAA,OAAA,GAAU,qBAAqB,CAAC;AAAA,IAC9D,CAAA;AAAA,EAAA;AACD;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as fs from "node:fs/promises";
|
|
2
2
|
import { access } from "node:fs/promises";
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
4
5
|
var __defProp = Object.defineProperty;
|
|
5
6
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
7
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
@@ -9,8 +10,13 @@ class FileSystem {
|
|
|
9
10
|
__publicField(this, "readFile", fs.readFile);
|
|
10
11
|
__publicField(this, "writeFile", fs.writeFile);
|
|
11
12
|
__publicField(this, "rename", fs.rename);
|
|
13
|
+
__publicField(this, "realPath", fs.realpath);
|
|
14
|
+
__publicField(this, "lstat", fs.lstat);
|
|
12
15
|
__publicField(this, "readDir", fs.readdir);
|
|
13
|
-
__publicField(this, "copy", (source, destination, options) =>
|
|
16
|
+
__publicField(this, "copy", (source, destination, options) => (
|
|
17
|
+
// verbatimSymlinks: by default fs.cp rewrites relative links into absolute paths into the source tree
|
|
18
|
+
fs.cp(source, destination, { recursive: true, verbatimSymlinks: true, ...options })
|
|
19
|
+
));
|
|
14
20
|
__publicField(this, "unlink", fs.unlink);
|
|
15
21
|
__publicField(this, "remove", fs.rm);
|
|
16
22
|
__publicField(this, "pathExists", async (path) => {
|
|
@@ -22,7 +28,7 @@ class FileSystem {
|
|
|
22
28
|
}
|
|
23
29
|
});
|
|
24
30
|
__publicField(this, "createTempDir", async () => {
|
|
25
|
-
return await fs.mkdtemp(tmpdir());
|
|
31
|
+
return await fs.mkdtemp(join(tmpdir(), "contember-template-"));
|
|
26
32
|
});
|
|
27
33
|
}
|
|
28
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileSystem.js","sources":["../../../../../packages/create/src/lib/FileSystem.ts"],"sourcesContent":["import * as fs from 'node:fs/promises'\nimport { access } from 'node:fs/promises'\nimport { tmpdir } from 'node:os'\n\nexport class FileSystem {\n\treadFile = fs.readFile\n\twriteFile = fs.writeFile\n\trename = fs.rename\n\treadDir = fs.readdir\n\tcopy = (source: string, destination: string, options?: { filter?: (source: string, destination: string) => boolean }) =>\n\t\tfs.cp(source, destination, { recursive: true, ...options })\n\tunlink = fs.unlink\n\tremove = fs.rm\n\tpathExists = async (path: string) => {\n\t\ttry {\n\t\t\tawait access(path)\n\t\t\treturn true\n\t\t} catch {\n\t\t\treturn false\n\t\t}\n\t}\n\tcreateTempDir = async () => {\n\t\treturn await fs.mkdtemp(tmpdir())\n\t}\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FileSystem.js","sources":["../../../../../packages/create/src/lib/FileSystem.ts"],"sourcesContent":["import * as fs from 'node:fs/promises'\nimport { access } from 'node:fs/promises'\nimport { tmpdir } from 'node:os'\nimport { join } from 'node:path'\n\nexport class FileSystem {\n\treadFile = fs.readFile\n\twriteFile = fs.writeFile\n\trename = fs.rename\n\trealPath = fs.realpath\n\tlstat = fs.lstat\n\treadDir = fs.readdir\n\tcopy = (source: string, destination: string, options?: { filter?: (source: string, destination: string) => boolean }) =>\n\t\t// verbatimSymlinks: by default fs.cp rewrites relative links into absolute paths into the source tree\n\t\tfs.cp(source, destination, { recursive: true, verbatimSymlinks: true, ...options })\n\tunlink = fs.unlink\n\tremove = fs.rm\n\tpathExists = async (path: string) => {\n\t\ttry {\n\t\t\tawait access(path)\n\t\t\treturn true\n\t\t} catch {\n\t\t\treturn false\n\t\t}\n\t}\n\tcreateTempDir = async () => {\n\t\t// mkdtemp appends random characters to the prefix, so without a separator it would create `/tmpXXXXXX`\n\t\treturn await fs.mkdtemp(join(tmpdir(), 'contember-template-'))\n\t}\n}\n"],"names":[],"mappings":";;;;;;;AAKO,MAAM,WAAW;AAAA,EAAjB,cAAA;AACN,kBAAA,MAAA,YAAW,GAAG,QAAA;AACd,kBAAA,MAAA,aAAY,GAAG,SAAA;AACf,kBAAA,MAAA,UAAS,GAAG,MAAA;AACZ,kBAAA,MAAA,YAAW,GAAG,QAAA;AACd,kBAAA,MAAA,SAAQ,GAAG,KAAA;AACX,kBAAA,MAAA,WAAU,GAAG,OAAA;AACb,kBAAA,MAAA,QAAO,CAAC,QAAgB,aAAqB;AAAA;AAAA,MAE5C,GAAG,GAAG,QAAQ,aAAa,EAAE,WAAW,MAAM,kBAAkB,MAAM,GAAG,QAAA,CAAS;AAAA,KAAA;AACnF,kBAAA,MAAA,UAAS,GAAG,MAAA;AACZ,kBAAA,MAAA,UAAS,GAAG,EAAA;AACZ,kBAAA,MAAA,cAAa,OAAO,SAAiB;AACpC,UAAI;AACH,cAAM,OAAO,IAAI;AACjB,eAAO;AAAA,MACR,QAAQ;AACP,eAAO;AAAA,MACR;AAAA,IACD,CAAA;AACA,kBAAA,MAAA,iBAAgB,YAAY;AAE3B,aAAO,MAAM,GAAG,QAAQ,KAAK,OAAA,GAAU,qBAAqB,CAAC;AAAA,IAC9D,CAAA;AAAA,EAAA;AACD;"}
|