create-medplum 4.5.2 → 5.0.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/esm/index.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/main.ts"],
|
|
4
|
-
"sourcesContent": ["#!/usr/bin/env node\n// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors\n// SPDX-License-Identifier: Apache-2.0\nimport cp from 'node:child_process';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport readline from 'node:readline/promises';\n\ninterface StarterProject {\n id: string;\n name: string;\n description: string;\n}\n\ninterface ProjectConfig {\n starterProject: StarterProject;\n projectName: string;\n serverUrl: string;\n}\n\nconst STARTER_PROJECTS: StarterProject[] = [\n {\n id: 'medplum-hello-world',\n name: 'Hello World',\n description: 'Minimal starter application showing basic Medplum integration',\n },\n {\n id: 'foomedical',\n name: 'Foo Medical',\n description: 'Full featured patient portal with open registration',\n },\n {\n id: 'medplum-provider',\n name: 'Provider',\n description: 'Simple EHR application with patient and encounter management',\n },\n];\n\nasync function prompt(\n terminal: readline.Interface,\n question: string,\n defaultValue: string,\n validationFunc: (str: string) => boolean | string,\n validationMessage: string\n): Promise<string> {\n
|
|
5
|
-
"mappings": ";;;AAGA,OAAO,QAAQ;AACf,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,cAAc;AAcrB,IAAM,mBAAqC;AAAA,EACzC;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AACF;AAEA,eAAe,OACb,UACA,UACA,cACA,gBACA,mBACiB;
|
|
4
|
+
"sourcesContent": ["#!/usr/bin/env node\n// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors\n// SPDX-License-Identifier: Apache-2.0\nimport cp from 'node:child_process';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport readline from 'node:readline/promises';\n\ninterface StarterProject {\n id: string;\n name: string;\n description: string;\n}\n\ninterface ProjectConfig {\n starterProject: StarterProject;\n projectName: string;\n serverUrl: string;\n}\n\nconst STARTER_PROJECTS: StarterProject[] = [\n {\n id: 'medplum-hello-world',\n name: 'Hello World',\n description: 'Minimal starter application showing basic Medplum integration',\n },\n {\n id: 'foomedical',\n name: 'Foo Medical',\n description: 'Full featured patient portal with open registration',\n },\n {\n id: 'medplum-provider',\n name: 'Provider',\n description: 'Simple EHR application with patient and encounter management',\n },\n];\n\nasync function prompt(\n terminal: readline.Interface,\n question: string,\n defaultValue: string,\n validationFunc: (str: string) => boolean | string,\n validationMessage: string\n): Promise<string> {\n while (true) {\n const defaultPrompt = defaultValue ? ` (${defaultValue})` : '';\n const answer = (await terminal.question(`${question}${defaultPrompt}: `)) || defaultValue;\n if (validationFunc(answer)) {\n return answer;\n }\n console.log(validationMessage);\n }\n}\n\nasync function promptForConfig(): Promise<ProjectConfig> {\n const terminal = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n\n // Display the list of starter projects\n console.log('Which starter project would you like to use?');\n for (let i = 0; i < STARTER_PROJECTS.length; i++) {\n console.log(`${i + 1}) ${STARTER_PROJECTS[i].name} - ${STARTER_PROJECTS[i].description}`);\n }\n\n // Prompt the user to select a project\n const answer = await prompt(\n terminal,\n 'Enter number',\n '1',\n (str) => {\n const num = parseInt(str, 10);\n return num >= 1 && num <= STARTER_PROJECTS.length;\n },\n 'Please enter a number between 1 and ' + STARTER_PROJECTS.length\n );\n const starterProject = STARTER_PROJECTS[parseInt(answer, 10) - 1];\n\n // Prompt the user for the project name\n const projectName = await prompt(\n terminal,\n 'What is your project name?',\n starterProject.id,\n (name) => name && /^[a-zA-Z0-9-_]+$/.test(name),\n 'Project name may only include letters, numbers, dashes, and underscores'\n );\n\n // Prompt the user for the server URL\n const serverUrl = await prompt(\n terminal,\n 'What is your Medplum server URL?',\n 'https://api.medplum.com/',\n (url) => URL.canParse(url),\n 'Please enter a valid URL'\n );\n\n // Cleanup\n terminal.close();\n\n return { starterProject, projectName, serverUrl };\n}\n\nasync function initializeProject(config: ProjectConfig): Promise<void> {\n const projectDir = path.join(process.cwd(), config.projectName);\n\n try {\n // Clone the repository\n console.log('Cloning starter project...');\n cp.execSync(`git clone git@github.com:medplum/${config.starterProject.id} ${config.projectName}`, {\n stdio: 'inherit',\n });\n\n // Remove .git directory\n fs.rmSync(path.join(projectDir, '.git'), { recursive: true, force: true });\n\n // Update configuration\n const configPath = path.join(projectDir, 'src', 'config.ts');\n if (fs.existsSync(configPath)) {\n let configContent = fs.readFileSync(configPath, 'utf8');\n configContent = configContent.replace(/baseUrl:.*$/m, `baseUrl: '${config.serverUrl}',`);\n fs.writeFileSync(configPath, configContent);\n }\n\n // Initialize new git repository\n console.log('Initializing new git repository...');\n cp.execSync('git init', { cwd: projectDir, stdio: 'inherit' });\n cp.execSync('git add .', { cwd: projectDir, stdio: 'inherit' });\n cp.execSync('git commit -m \"Initial commit from Medplum initializer\"', {\n cwd: projectDir,\n stdio: 'inherit',\n });\n\n // Install dependencies\n console.log('Installing dependencies...');\n cp.execSync('npm install', { cwd: projectDir, stdio: 'inherit' });\n\n console.log(`Successfully created project ${config.projectName}!`);\n console.log(`Next steps:`);\n console.log(` cd ${config.projectName}`);\n console.log(' npm run dev');\n } catch (error) {\n console.error('Error initializing project:', error);\n // Clean up on failure\n if (fs.existsSync(projectDir)) {\n fs.rmSync(projectDir, { recursive: true, force: true });\n }\n throw error;\n }\n}\n\nexport async function main(): Promise<void> {\n console.log('Welcome to Medplum project initializer!');\n const config = await promptForConfig();\n await initializeProject(config);\n}\n\nif (process.env.NODE_ENV !== 'test') {\n main().catch((error) => {\n console.error('Unexpected error:',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C,OAAO,WAAW,GAAG;AACjE,YAAQ,IAAI,aAAa;AACzB,YAAQ,IAAI,QAAQ,OAAO,WAAW,EAAE;AACxC,YAAQ,IAAI,eAAe;AAAA,EAC7B,SAAS,OAAO;AACd,YAAQ,MAAM,+BAA+B,KAAK;AAElD,QAAI,GAAG,WAAW,UAAU,GAAG;AAC7B,SAAG,OAAO,YAAY,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AAAA,IACxD;AACA,UAAM;AAAA,EACR;AACF;AAEA,eAAsB,OAAsB;AAC1C,UAAQ,IAAI,yCAAyC;AACrD,QAAM,SAAS,MAAM,gBAAgB;AACrC,QAAM,kBAAkB,MAAM;AAChC;AAEA,IAAI,QAAQ,IAAI,aAAa,QAAQ;AACnC,OAAK,EAAE,MAAM,CAAC,UAAU;AACtB,YAAQ,MAAM,qBAAqB,KAAK;AACxC,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/types/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":";AAwJA,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAI1C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-medplum",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Medplum NPM Initializer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"medplum",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"clean": "rimraf dist",
|
|
41
41
|
"lint": "eslint .",
|
|
42
42
|
"lint:fix": "eslint . --fix",
|
|
43
|
-
"medplum": "
|
|
43
|
+
"medplum": "tsx src/index.ts",
|
|
44
44
|
"test": "jest"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@types/node": "
|
|
47
|
+
"@types/node": "22.18.13"
|
|
48
48
|
},
|
|
49
49
|
"engines": {
|
|
50
|
-
"node": "^
|
|
50
|
+
"node": "^22.18.0 || >=24.2.0"
|
|
51
51
|
}
|
|
52
52
|
}
|