Skip to content

Commit

Permalink
chore(demo): remove all !!raw-loader!-imports (#2174)
Browse files Browse the repository at this point in the history
  • Loading branch information
nsbarsukov authored and splincode committed Aug 30, 2022
1 parent 191b0a0 commit 17910b3
Show file tree
Hide file tree
Showing 182 changed files with 2,475 additions and 2,564 deletions.
4 changes: 2 additions & 2 deletions projects/addon-doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ npm i @taiga-ui/addon-doc
export class SuperComponent {
// Keys would be used as tabs for code example
readonly example = {
TypeScript: import('!!raw-loader!./examples/1/index.ts'),
HTML: import('!!raw-loader!./examples/1/index.html'),
TypeScript: import('./examples/1/index.ts?raw'),
HTML: import('./examples/1/index.html?raw'),
};

readonly inputVariants = ['input 1', 'input 2'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {ChangeDetectionStrategy, Component} from '@angular/core';
})
export class Example<%= classify(name) %>Component {
<% for(let i =1; i<=samples; i++) {%>readonly example<%=i%> = {
TypeScript: import('!!raw-loader!./examples/<%=i%>/index.ts'),
HTML: import('!!raw-loader!./examples/<%=i%>/index.html'),
TypeScript: import('./examples/<%=i%>/index.ts?raw'),
HTML: import('./examples/<%=i%>/index.html?raw'),
};
<% } %>
readonly exampleImportModule = import('!!raw-loader!./import/import-module.md');
readonly exampleImportModule = import('./import/import-module.md?raw');
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ function getImportArray(
sourceFile,
appComponentPath,
`* as example${index}Html`,
`!!raw-loader!./examples/${index}/index.html`,
`./examples/${index}/index.html?raw`,
true,
),
insertImport(
sourceFile,
appComponentPath,
`* as example${index}Ts`,
`!!raw-loader!./examples/${index}/index.ts`,
`./examples/${index}/index.ts?raw`,
true,
),
);
Expand Down
30 changes: 15 additions & 15 deletions projects/demo/src/modules/animations/animations.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,36 @@ import {changeDetection} from '@demo/emulate/change-detection';
import {TuiDocExample} from '@taiga-ui/addon-doc';

@Component({
selector: `example-animations`,
templateUrl: `./animations.template.html`,
styleUrls: [`./animations.style.less`],
selector: 'example-animations',
templateUrl: './animations.template.html',
styleUrls: ['./animations.style.less'],
changeDetection,
})
export class ExampleAnimationsComponent {
speed = 1000;
readonly speedTicksLabels: number[] = [0, 600, 1200, 1800, 2400, 3000];

readonly heightCollapseExample: TuiDocExample = {
HTML: import(`!!raw-loader!./examples/height-collapse/index.html`),
TypeScript: import(`!!raw-loader!./examples/height-collapse/index.ts`),
LESS: import(`!!raw-loader!./examples/height-collapse/index.less`),
HTML: import('./examples/height-collapse/index.html?raw'),
TypeScript: import('./examples/height-collapse/index.ts?raw'),
LESS: import('./examples/height-collapse/index.less?raw'),
};

readonly widthCollapseExample: TuiDocExample = {
HTML: import(`!!raw-loader!./examples/width-collapse/index.html`),
TypeScript: import(`!!raw-loader!./examples/width-collapse/index.ts`),
LESS: import(`!!raw-loader!./examples/width-collapse/index.less`),
HTML: import('./examples/width-collapse/index.html?raw'),
TypeScript: import('./examples/width-collapse/index.ts?raw'),
LESS: import('./examples/width-collapse/index.less?raw'),
};

readonly fadeInExample: TuiDocExample = {
HTML: import(`!!raw-loader!./examples/fade-in/index.html`),
TypeScript: import(`!!raw-loader!./examples/fade-in/index.ts`),
LESS: import(`!!raw-loader!./examples/fade-in/index.less`),
HTML: import('./examples/fade-in/index.html?raw'),
TypeScript: import('./examples/fade-in/index.ts?raw'),
LESS: import('./examples/fade-in/index.less?raw'),
};

readonly scaleInExample: TuiDocExample = {
HTML: import(`!!raw-loader!./examples/scale-in/index.html`),
TypeScript: import(`!!raw-loader!./examples/scale-in/index.ts`),
LESS: import(`!!raw-loader!./examples/scale-in/index.less`),
HTML: import('./examples/scale-in/index.html?raw'),
TypeScript: import('./examples/scale-in/index.ts?raw'),
LESS: import('./examples/scale-in/index.less?raw'),
};
}
24 changes: 12 additions & 12 deletions projects/demo/src/modules/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';

@Component({
selector: `home`,
templateUrl: `./home.template.html`,
styleUrls: [`./home.style.less`],
selector: 'home',
templateUrl: './home.template.html',
styleUrls: ['./home.style.less'],
changeDetection,
encapsulation,
})
export class HomeComponent {
readonly angularJsonStyles = import(`!!raw-loader!./examples/angular-json-styles.md`);
readonly appModule = import(`!!raw-loader!./examples/app-module.md`);
readonly appTemplate = import(`!!raw-loader!./examples/app-template.md`);
readonly appModuleOptional = import(`!!raw-loader!./examples/app-module-optional.md`);
readonly assets = import(`!!raw-loader!./examples/assets.md`);
readonly componentsStyles = import(`!!raw-loader!./examples/components-styles.md`);
readonly importLocalLess = import(`!!raw-loader!./examples/import-local-less.md`);
readonly main = import(`!!raw-loader!./examples/main.md`);
readonly addons = import(`!!raw-loader!./examples/addons.md`);
readonly angularJsonStyles = import('./examples/angular-json-styles.md?raw');
readonly appModule = import('./examples/app-module.md?raw');
readonly appTemplate = import('./examples/app-template.md?raw');
readonly appModuleOptional = import('./examples/app-module-optional.md?raw');
readonly assets = import('./examples/assets.md?raw');
readonly componentsStyles = import('./examples/components-styles.md?raw');
readonly importLocalLess = import('./examples/import-local-less.md?raw');
readonly main = import('./examples/main.md?raw');
readonly addons = import('./examples/addons.md?raw');
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ export abstract class AbstractTuiStackblitzResourcesLoader {
stylesContent,
appModuleTsContent,
]: string[] = await Promise.all([
rawLoad(import(`!!raw-loader!./project-files/configs.md`)),
rawLoad(import(`!!raw-loader!./project-files/src/main.ts.md`)),
rawLoad(import(`!!raw-loader!./project-files/src/index.html.md`)),
rawLoad(import(`!!raw-loader!./project-files/src/polyfills.ts.md`)),
rawLoad(import(`!!raw-loader!./project-files/src/styles.less.md`)),
rawLoad(import(`!!raw-loader!./project-files/src/app/app.module.ts.md`)),
rawLoad(import('./project-files/configs.md?raw')),
rawLoad(import('./project-files/src/main.ts.md?raw')),
rawLoad(import('./project-files/src/index.html.md?raw')),
rawLoad(import('./project-files/src/polyfills.ts.md?raw')),
rawLoad(import('./project-files/src/styles.less.md?raw')),
rawLoad(import('./project-files/src/app/app.module.ts.md?raw')),
]);

const [angularJson, tsconfig] = tryParseMarkdownCodeBlock(configsContent);
Expand Down Expand Up @@ -83,140 +83,142 @@ export abstract class AbstractTuiStackblitzResourcesLoader {
noneLess,
wrapperBaseLess,
]: string[] = await Promise.all([
rawLoad(import('../../../../../core/styles/taiga-ui-stackblitz.less?raw')),
rawLoad(import('../../../../../core/styles/taiga-ui-global.less?raw')),
rawLoad(import('../../../../../core/styles/taiga-ui-local.less?raw')),
rawLoad(import('../../../../../core/styles/mixins/mixins.less?raw')),
rawLoad(import('../../../../../core/styles/mixins/picker.less?raw')),
rawLoad(import('../../../../../core/styles/mixins/slider.less?raw')),
rawLoad(import('../../../../../core/styles/mixins/text.less?raw')),
rawLoad(import('../../../../../core/styles/mixins/textfield.less?raw')),
rawLoad(import('../../../../../core/styles/mixins/wrapper.less?raw')),
rawLoad(import('../../../../../core/styles/variables/media.less?raw')),
rawLoad(import('../../../../../core/styles/basic/keyframes.less?raw')),
rawLoad(import('../../../../../core/styles/basic/normalize.less?raw')),
rawLoad(import('../../../../../core/styles/basic/main.less?raw')),
rawLoad(import('../../../../../core/styles/markup/tui-container.less?raw')),
rawLoad(import('../../../../../core/styles/markup/tui-form.less?raw')),
rawLoad(import('../../../../../core/styles/markup/tui-group.less?raw')),
rawLoad(import('../../../../../core/styles/markup/tui-island.less?raw')),
rawLoad(import('../../../../../core/styles/markup/tui-list.less?raw')),
rawLoad(import('../../../../../core/styles/markup/tui-mobile-only.less?raw')),
rawLoad(import('../../../../../core/styles/markup/tui-palette.less?raw')),
rawLoad(import('../../../../../core/styles/markup/tui-required.less?raw')),
rawLoad(import('../../../../../core/styles/markup/tui-row.less?raw')),
rawLoad(import('../../../../../core/styles/markup/tui-skeleton.less?raw')),
rawLoad(import('../../../../../core/styles/markup/tui-space.less?raw')),
rawLoad(import('../../../../../core/styles/markup/tui-table.less?raw')),
rawLoad(import('../../../../../core/styles/markup/tui-text.less?raw')),
rawLoad(import('../../../../../core/styles/theme/variables.less?raw')),
rawLoad(import('../../../../../core/styles/theme/wrapper.less?raw')),
rawLoad(import('../../../../../core/styles/theme/wrapper/icon.less?raw')),
rawLoad(import('../../../../../core/styles/theme/wrapper/outline.less?raw')),
rawLoad(import('../../../../../core/styles/theme/wrapper/primary.less?raw')),
rawLoad(import('../../../../../core/styles/theme/wrapper/accent.less?raw')),
rawLoad(
import(
`!!raw-loader!../../../../../core/styles/taiga-ui-stackblitz.less`
),
),
rawLoad(
import(`!!raw-loader!../../../../../core/styles/taiga-ui-global.less`),
),
rawLoad(
import(`!!raw-loader!../../../../../core/styles/taiga-ui-local.less`),
),
rawLoad(import(`!!raw-loader!../../../../../core/styles/mixins/mixins.less`)),
rawLoad(import(`!!raw-loader!../../../../../core/styles/mixins/picker.less`)),
rawLoad(import(`!!raw-loader!../../../../../core/styles/mixins/slider.less`)),
rawLoad(import(`!!raw-loader!../../../../../core/styles/mixins/text.less`)),
rawLoad(
import(`!!raw-loader!../../../../../core/styles/mixins/textfield.less`),
),
rawLoad(
import(`!!raw-loader!../../../../../core/styles/mixins/wrapper.less`),
import('../../../../../core/styles/theme/wrapper/secondary.less?raw'),
),
rawLoad(import('../../../../../core/styles/theme/wrapper/table.less?raw')),
rawLoad(
import(`!!raw-loader!../../../../../core/styles/variables/media.less`),
import('../../../../../core/styles/theme/wrapper/textfield.less?raw'),
),
rawLoad(
import(`!!raw-loader!../../../../../core/styles/basic/keyframes.less`),
import(`../../../../../core/styles/markup/tui-form.less?raw`),
),
rawLoad(
import(`!!raw-loader!../../../../../core/styles/basic/normalize.less`),
import(`../../../../../core/styles/markup/tui-group.less?raw`),
),
rawLoad(import(`!!raw-loader!../../../../../core/styles/basic/main.less`)),
rawLoad(
import(
`!!raw-loader!../../../../../core/styles/markup/tui-container.less`
),
),
rawLoad(
import(`!!raw-loader!../../../../../core/styles/markup/tui-form.less`),
),
rawLoad(
import(`!!raw-loader!../../../../../core/styles/markup/tui-group.less`),
),
rawLoad(
import(`!!raw-loader!../../../../../core/styles/markup/tui-island.less`),
import(`../../../../../core/styles/markup/tui-island.less?raw`),
),
rawLoad(
import(`!!raw-loader!../../../../../core/styles/markup/tui-list.less`),
import(`../../../../../core/styles/markup/tui-list.less?raw`),
),
rawLoad(
import(
`!!raw-loader!../../../../../core/styles/markup/tui-mobile-only.less`
`../../../../../core/styles/markup/tui-mobile-only.less?raw`
),
),
rawLoad(
import(`!!raw-loader!../../../../../core/styles/markup/tui-palette.less`),
import(`../../../../../core/styles/markup/tui-palette.less?raw`),
),
rawLoad(
import(
`!!raw-loader!../../../../../core/styles/markup/tui-required.less`
`../../../../../core/styles/markup/tui-required.less?raw`
),
),
rawLoad(
import(`!!raw-loader!../../../../../core/styles/markup/tui-row.less`),
import(`../../../../../core/styles/markup/tui-row.less?raw`),
),
rawLoad(
import(
`!!raw-loader!../../../../../core/styles/markup/tui-skeleton.less`
`../../../../../core/styles/markup/tui-skeleton.less?raw`
),
),
rawLoad(
import(`!!raw-loader!../../../../../core/styles/markup/tui-space.less`),
import(`../../../../../core/styles/markup/tui-space.less?raw`),
),
rawLoad(
import(`!!raw-loader!../../../../../core/styles/markup/tui-table.less`),
import(`../../../../../core/styles/markup/tui-table.less?raw`),
),
rawLoad(
import(`!!raw-loader!../../../../../core/styles/markup/tui-text.less`),
import(`../../../../../core/styles/markup/tui-text.less?raw`),
),
rawLoad(
import(`!!raw-loader!../../../../../core/styles/theme/variables.less`),
import(`../../../../../core/styles/theme/variables.less?raw`),
),
rawLoad(import(`!!raw-loader!../../../../../core/styles/theme/wrapper.less`)),
rawLoad(import(`../../../../../core/styles/theme/wrapper.less?raw`)),
rawLoad(
import(`!!raw-loader!../../../../../core/styles/theme/wrapper/icon.less`),
import(`../../../../../core/styles/theme/wrapper/icon.less?raw`),
),
rawLoad(
import(`!!raw-loader!../../../../../core/styles/theme/wrapper/mono.less`),
import(`../../../../../core/styles/theme/wrapper/mono.less?raw`),
),
rawLoad(
import(
`!!raw-loader!../../../../../core/styles/theme/wrapper/outline.less`
`../../../../../core/styles/theme/wrapper/outline.less?raw`
),
),
rawLoad(
import(
`!!raw-loader!../../../../../core/styles/theme/wrapper/primary.less`
`../../../../../core/styles/theme/wrapper/primary.less?raw`
),
),
rawLoad(
import(
`!!raw-loader!../../../../../core/styles/theme/wrapper/accent.less`
`../../../../../core/styles/theme/wrapper/accent.less?raw`
),
),
rawLoad(
import(
`!!raw-loader!../../../../../core/styles/theme/wrapper/secondary.less`
`../../../../../core/styles/theme/wrapper/secondary.less?raw`
),
),
rawLoad(
import(
`!!raw-loader!../../../../../core/styles/theme/wrapper/secondary-destructive.less`
`../../../../../core/styles/theme/wrapper/secondary-destructive.less?raw`
),
),
rawLoad(
import(
`!!raw-loader!../../../../../core/styles/theme/wrapper/table.less`
`../../../../../core/styles/theme/wrapper/table.less?raw`
),
),
rawLoad(
import(
`!!raw-loader!../../../../../core/styles/theme/wrapper/textfield.less`
`../../../../../core/styles/theme/wrapper/textfield.less?raw`
),
),
rawLoad(
import(
`!!raw-loader!../../../../../core/styles/theme/wrapper/whiteblock.less`
`../../../../../core/styles/theme/wrapper/whiteblock.less?raw`
),
),
rawLoad(
import(`!!raw-loader!../../../../../core/styles/theme/wrapper/none.less`),
),
rawLoad(
import(`!!raw-loader!../../../../../core/styles/theme/wrapper/base.less`),
import(`../../../../../core/styles/theme/wrapper/none.less?raw`),
),
rawLoad(import('../../../../../core/styles/theme/wrapper/none.less?raw')),
rawLoad(import('../../../../../core/styles/theme/wrapper/base.less?raw')),
]);

styles[`styles/taiga-ui-stackblitz.less`] = stackblitzLess;
Expand Down
Loading

0 comments on commit 17910b3

Please sign in to comment.