Skip to content

Commit

Permalink
address feedback from review
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Dec 4, 2019
1 parent 7c16ff4 commit 3ce6506
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 22 deletions.
17 changes: 1 addition & 16 deletions packages/api/core/test/slow/api_spec_slow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,24 +168,9 @@ describe(`electron-forge API (with installer=${nodeInstaller})`, () => {
describe('init (with typescript templater)', () => {
before(ensureTestDirIsNonexistent);

it('should succeed in initializing the webpack template', async () => {
await forge.init({
dir,
template: 'typescript',
});
});

it('should fail in initializing an already initialized directory', async () => {
await expect(forge.init({
dir,
template: 'typescript',
})).to.eventually.be.rejected;
});

it('should initialize an already initialized directory when forced to', async () => {
it('should succeed in initializing the typescript template', async () => {
await forge.init({
dir,
force: true,
template: 'typescript',
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/template/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@electron-forge/template-typescript",
"version": "6.0.0-beta.45",
"version": "6.0.0-beta.46",
"description": "Typescript template for Electron Forge, gets you started with TypeScript really quickly",
"repository": "https://github.com/electron-userland/electron-forge",
"author": "Shelley Vohr <shelley.vohr@gmail.com>",
Expand Down
7 changes: 2 additions & 5 deletions packages/template/typescript/src/TypeScriptTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ class TypeScriptTemplate implements ForgeTemplate {
const packageJSONPath = path.resolve(directory, 'package.json');
const packageJSON = await fs.readJson(packageJSONPath);

// Configure forge plugins for TS template
packageJSON.config.forge.plugins = packageJSON.config.forge.plugins || [];

// Configure scripts for TS template
packageJSON.config.forge.plugins = packageJSON.config.forge.plugins || [];
packageJSON.scripts.lint = 'tslint -c tslint.json -p tsconfig.json';
packageJSON.scripts.start = 'tsc && electron-forge start -p dist';

Expand All @@ -40,7 +36,8 @@ class TypeScriptTemplate implements ForgeTemplate {

const filePath = (fileName: string) => path.join(directory, 'src', fileName);

// Remove index.js and replace with index.ts
// Remove index.js and replace with index.ts - needs to be done since bolt
// won't be able to find Electron's types
await fs.remove(filePath('index.js'));
await copyTemplateFile(path.join(directory, 'src'), 'index.ts.js');
await fs.rename(filePath('index.ts.js'), filePath('index.ts'));
Expand Down

0 comments on commit 3ce6506

Please sign in to comment.