Skip to content

Commit 38c6179

Browse files
committed
enable ember-cli project generation
1 parent 5b2c728 commit 38c6179

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

Diff for: generate-local.js

+14-9
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function semverVersion(value) {
2727
program
2828
.addOption(
2929
new Option('-p, --project <project>', 'the project that you want to run this for')
30-
.choices(['ember', 'ember-data'])
30+
.choices(['ember', 'ember-data', 'ember-cli'])
3131
.makeOptionMandatory(),
3232
)
3333
.requiredOption('-v, --version <version>', 'project version', semverVersion);
@@ -59,6 +59,7 @@ try {
5959

6060
let emberProjectPath = path.join('../', 'ember.js');
6161
let emberDataProjectPath = path.join('../', 'data');
62+
let emberCliProjectPath = path.join('../', 'ember-cli');
6263

6364
let checkIfProjectDirExists = dirPath => {
6465
if (!existsSync(dirPath)) {
@@ -69,14 +70,14 @@ let checkIfProjectDirExists = dirPath => {
6970
let buildDocs = async projDirPath => {
7071
checkIfProjectDirExists(projDirPath);
7172

72-
if (project === 'ember') {
73-
await runCmd('volta', projDirPath, ['run', 'yarn']);
74-
} else {
73+
if (project === 'ember-data') {
7574
await runCmd('corepack', projDirPath, ['pnpm', 'install']);
75+
} else {
76+
await runCmd('volta', projDirPath, ['run', 'yarn']);
7677
}
7778

7879
await runCmd(
79-
project === 'ember' ? 'volta run yarn docs' : 'corepack pnpm run build:docs',
80+
project === 'ember-data' ? 'corepack pnpm run build:docs' : 'volta run yarn docs',
8081
projDirPath,
8182
);
8283

@@ -86,16 +87,20 @@ let buildDocs = async projDirPath => {
8687
removeSync(projYuiDocFile);
8788
removeSync(`${docsPath}/json-docs/${project}/${version}`);
8889

89-
const yuiDocFile = path.join(
90-
projDirPath,
91-
project === 'ember' ? 'docs/data.json' : 'packages/-ember-data/dist/docs/data.json',
92-
);
90+
const paths = {
91+
ember: 'docs/data.json',
92+
'ember-cli': 'docs/build/data.json',
93+
'ember-data': 'packages/-ember-data/dist/docs/data.json',
94+
};
95+
96+
const yuiDocFile = path.join(projDirPath, paths[project]);
9397
copyFileSync(yuiDocFile, projYuiDocFile);
9498
};
9599

96100
let dirMap = {
97101
ember: emberProjectPath,
98102
'ember-data': emberDataProjectPath,
103+
'ember-cli': emberCliProjectPath,
99104
};
100105

101106
await buildDocs(dirMap[project]);

Diff for: index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function semverVersion(value) {
1414
program
1515
.addOption(
1616
new Option('-p, --projects <project...>', 'the projects that you want to run this for')
17-
.choices(['ember', 'ember-data'])
17+
.choices(['ember', 'ember-data', 'ember-cli'])
1818
.makeOptionMandatory(),
1919
)
2020
.addOption(

0 commit comments

Comments
 (0)