Skip to content

Commit

Permalink
fix: Corrections for #1708 being merged too early (#1724)
Browse files Browse the repository at this point in the history
* fix: Corrections for #1708 being merged too early

* test: Fix import path

* style: Strip file extensions from imports for consistency
  • Loading branch information
rschristian authored Aug 4, 2022
1 parent e5eaba0 commit 2b958cd
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/cli/tests/lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { mkdir, symlink, readFile, writeFile } = require('fs').promises;
const { build: buildCmd, watch: watchCmd } = require('../../lib/commands');
const {
create: createCmd,
} = require('../../../create-cli/src/commands/create');
} = require('../../../create-cli/lib/commands/create');
const { tmpDir } = require('./output');
const { disableOptimizeConfig, disableOptimize } = require('./utils');

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { error, info } = require('../util');

const REPOS_URL = 'https://api.github.com/users/preactjs-templates/repos';

module.exports = async function () {
exports.list = async function () {
try {
const repos = await fetch(REPOS_URL).then(r => r.json());

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env node
const sade = require('sade');
const { create } = require('./commands/create.js');
//const { create } = require('./commands/create.js)';
const { error } = require('./util.js');
const { create } = require('./commands/create');
const { list } = require('./commands/list');
const { error } = require('./util');

const prog = sade('create-preact-app').version('0.1.3');

Expand All @@ -16,10 +16,7 @@ prog
.option('--git', 'Initialize git repository', true)
.action(create);

//prog
// .command('list')
// .describe('List official templates')
// .action(list);
prog.command('list').describe('List official templates').action(list);

prog.parse(process.argv, {
unknown: arg => {
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/create-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "3.4.0",
"description": "Start building a Preact Progressive Web App in seconds.",
"repository": "preactjs/preact-cli",
"main": "src/index.js",
"bin": "src/index.js",
"main": "lib/index.js",
"bin": "lib/index.js",
"scripts": {
"pretest": "rimraf ../cli/tests/output",
"test": "jest"
Expand Down

0 comments on commit 2b958cd

Please sign in to comment.