Skip to content

Commit

Permalink
fix(stencil): remove gitignore addage
Browse files Browse the repository at this point in the history
ISSUES CLOSED: #1092
  • Loading branch information
DominikPieper committed Jun 19, 2024
1 parent 9e5fa3b commit b6e8e8b
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 28 deletions.
1 change: 0 additions & 1 deletion packages/stencil/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"@nx/jest": "19.3.0",
"@nx/storybook": "19.3.0",
"@phenomnomnominal/tsquery": "~5.0.1",
"ignore": "^5.2.4",
"tslib": "^2.3.0"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
} from '@nx/devkit';
import { AddOutputtargetSchematicSchema } from '../schema';
import { STENCIL_OUTPUTTARGET_VERSION } from '../../../utils/versions';
import { addToGitignore } from '../../../utils/utillities';
import { calculateStencilSourceOptions } from '../lib/calculate-stencil-source-options';
import * as ts from 'typescript';
import { relative } from 'path';
Expand Down Expand Up @@ -50,8 +49,6 @@ async function prepareAngularLibrary(
}
);

addToGitignore(host, `${libsDir}/${angularProjectName}/**/generated`);

return libraryTarget;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { initGenerator as jsInitGenerator } from '@nx/js';
import { AddOutputtargetSchematicSchema } from '../schema';
import { Linter } from '@nx/eslint';
import { STENCIL_OUTPUTTARGET_VERSION } from '../../../utils/versions';
import { addToGitignore } from '../../../utils/utillities';
import * as ts from 'typescript';
import { getDistDir, getRelativePath } from '../../../utils/fileutils';
import { addImport } from '@nxext/common';
Expand Down Expand Up @@ -60,8 +59,6 @@ async function prepareReactLibrary(
`export * from './generated/components';`
);

addToGitignore(host, `${libsDir}/${reactProjectName}/**/generated`);

return runTasksInSerial(jsInitTask, libraryTarget);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
nxextSvelteVersion,
STENCIL_OUTPUTTARGET_VERSION,
} from '../../../utils/versions';
import { addToGitignore } from '../../../utils/utillities';
import * as ts from 'typescript';
import { getDistDir, getRelativePath } from '../../../utils/fileutils';
import { addImport } from '@nxext/common';
Expand Down Expand Up @@ -51,8 +50,6 @@ async function prepareSvelteLibrary(
`export * from './generated/components';`
);

addToGitignore(host, `${libsDir}/${svelteProjectName}/**/generated`);

return libraryTarget;
}

Expand Down
18 changes: 0 additions & 18 deletions packages/stencil/src/utils/utillities.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import ignore from 'ignore';
import { readJson, Tree } from '@nx/devkit';
import type { Diagnostic } from '@stencil/core/compiler';
import { SupportedStyles } from '../stencil-core-utils';
Expand All @@ -15,23 +14,6 @@ export function calculateStyle(
return /^(css|scss|less|styl|pcss)$/.test(style) ? style : styleDefault;
}

export function addToGitignore(host: Tree, path: string) {
if (!host.exists('.gitignore')) {
return;
}

const ig = ignore();
ig.add(host.read('.gitignore').toString('utf-8'));

if (!ig.ignores(path)) {
const gitignore = host.read('.gitignore');
if (gitignore) {
const content = `${gitignore.toString('utf-8').trimRight()}\n${path}\n`;
host.write('.gitignore', content);
}
}
}

export function isBuildableStencilProject(project: any): boolean {
const target =
project.targets && project.targets['build'] ? project.targets['build'] : {};
Expand Down

0 comments on commit b6e8e8b

Please sign in to comment.