Skip to content

Commit

Permalink
Merge pull request #267 from stylify/update-deps
Browse files Browse the repository at this point in the history
Dependencies update
  • Loading branch information
Machy8 authored Sep 4, 2023
2 parents 949ec67 + fa73831 commit 7105a3a
Show file tree
Hide file tree
Showing 16 changed files with 5,231 additions and 4,012 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: pnpm

- name: Versions
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends python make g++
apt-get remove -y cmdtest

RUN npm i -g n yarn && \
n 16.17.1 && \
n 18.17.1 && \
yarn global add pnpm && \
ln -sf /usr/local/n/versions/node/16.17.1/bin/node /usr/local/bin/node
ln -sf /usr/local/n/versions/node/18.17.1/bin/node /usr/local/bin/node

RUN node -v && \
npm -v
Expand Down
30 changes: 13 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"astro:build:notypes": "cross-env packages=astro pnpm build:notypes",
"astro:watch": "cross-env packages=astro watch=true pnpm watch",
"astro:plg": "cd packages/astro/playground && pnpm",
"astro:test": "pnpm jest:test packages/astro/tests/jest",
"astro:test": "pnpm jest:test packages/astro/tests/jest/astrov2",
"autoprefixer:build": "cross-env packages=autoprefixer pnpm build",
"autoprefixer:build:notypes": "cross-env packages=autoprefixer pnpm build:notypes",
"autoprefixer:watch": "cross-env packages=autoprefixer watch=true pnpm watch",
Expand Down Expand Up @@ -74,33 +74,29 @@
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/preset-env": "^7.22.2",
"@babel/preset-typescript": "^7.21.5",
"@types/jest": "^29.5.1",
"@types/jest": "^29.5.4",
"@types/node": "^18.16.16",
"@typescript-eslint/eslint-plugin": "^5.59.7",
"@typescript-eslint/parser": "^5.59.7",
"autoprefixer": "^10.4.14",
"babel-jest": "^29.5.0",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"autoprefixer": "^10.4.15",
"babel-jest": "^29.6.4",
"cross-env": "^7.0.3",
"esbuild": "^0.17.19",
"esbuild-sass-plugin": "^2.9.0",
"eslint": "^8.41.0",
"fast-glob": "^3.2.12",
"eslint": "^8.48.0",
"fast-glob": "^3.3.1",
"fs-extra": "^11.1.1",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jest-environment-node": "^29.5.0",
"jest": "^29.6.0",
"jest-environment-jsdom": "^29.6.0",
"jest-environment-node": "^29.6.0",
"promise": "^8.3.0",
"ts-jest": "^29.1.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"tslib": "^2.5.2",
"tslib": "^2.6.2",
"typescript": "^4.9.5"
},
"packageManager": "pnpm@8.3.1",
"engines": {
"pnpm": "^8.3"
},
"dependencies": {
"@example/basics": "link:/usr/share/nginx/html/packages/astro/tests-tmp/astrov1-build"
}
}
2 changes: 1 addition & 1 deletion packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@
"normalize-path": "^3.0.0"
},
"devDependencies": {
"astro": "^2.5.5"
"astro": "^3.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/astro/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { join } from 'path';
import { default as normalize } from 'normalize-path';

export interface ConfigInterface extends UnpluginConfigInterface {
importDefaultBundle?: false|boolean
importDefaultBundle?: boolean
}

export const hooks = unpluginHooks;
Expand Down
50 changes: 13 additions & 37 deletions packages/astro/tests/jest/astrov2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,58 +19,34 @@ fse.copySync(path.join(bundleTestDir, 'input'), buildTmpDir);

execSync(`pnpm install . && pnpm build .`, {stdio: 'inherit', cwd: buildTmpDir});

const indexHtmlPart1 = `
<body class="e f">
<h1 class="g h i">Layout</h1>
`.trim();

const indexHtmlPart2 = `
<h1 class="i">Hello World!</h1>
<h2 class="l j m k"></h2>
<h3 class="g">Another text</h3>
<h2 class="a b">Subtitle</h2>
`.trim();

const indexHtmlPart3 = `
<strong class=" c d ">
Text
</strong>
`.trim()

const secondHtmlPart1 = `
<body class="e f">
<h1 class="g h i">Layout</h1>
`.trim();

const secondHtmlPart2 = `
<h1 class="n">Hello World 2!</h1>
<h2 class="a b">Subtitle</h2>
`.trim();

const secondHtmlPart3 = `
<strong class=" c d ">
Text
</strong>
`
const indexHtmlPart1 = `<body class="e f"><h1 class="g h i">Layout</h1>`.trim();

const indexHtmlPart2 = `<h1 class="i">Hello World!</h1><h2 class="l j m k"></h2><h3 class="g">Another text</h3><h2 class="a b">Subtitle</h2>`.trim();

const indexHtmlPart3 = `<strong class=" c d ">`.trim()

const secondHtmlPart1 = `<body class="e f"><h1 class="g h i">Layout</h1>`.trim();

const secondHtmlPart2 = `<h1 class="n">Hello World 2!</h1><h2 class="a b">Subtitle</h2>`.trim();

const secondHtmlPart3 = `<strong class=" c d ">`

const cssFilePart = ':root{--blue: darkblue}.a{color:orange}.c{color:test}.f{color:#00008b}.i{color:purple}.n{color:lightpurple}.b{font-size:24px}.d{font-size:123px}.g{font-size:48px}.m{font-size:12px}.l{font-weight:700}.h{margin-top:24px}.e{text-align:center}@media (min-width: 1024px){.j{color:darkpurple}.k{font-size:24px}}';

test('Astro v2', async (): Promise<void> => {
const [indexHtmlFileEntry] = FastGlob.sync(path.join(buildTmpDir, 'dist', 'index.html'));
const [secondHtmlFileEntry] = FastGlob.sync(path.join(buildTmpDir, 'dist', 'second', 'index.html'));
const [cssFileEntry] = FastGlob.sync(path.join(buildTmpDir, 'dist', '_astro', '*.css'));

const indexHtmlFileContent = testUtils.readFile(indexHtmlFileEntry);
const secondHtmlFileContent = testUtils.readFile(secondHtmlFileEntry);
const cssFileContent = testUtils.readFile(cssFileEntry);

expect(indexHtmlFileContent.includes(indexHtmlPart1)).toBeTruthy();
expect(indexHtmlFileContent.includes(indexHtmlPart2)).toBeTruthy();
expect(indexHtmlFileContent.includes(indexHtmlPart3)).toBeTruthy();
expect(indexHtmlFileContent.includes(cssFilePart)).toBeTruthy();

expect(secondHtmlFileContent.includes(secondHtmlPart1)).toBeTruthy();
expect(secondHtmlFileContent.includes(secondHtmlPart2)).toBeTruthy();
expect(secondHtmlFileContent.includes(secondHtmlPart3)).toBeTruthy();

expect(cssFileContent.includes(cssFilePart)).toBeTruthy();
expect(secondHtmlFileContent.includes(cssFilePart)).toBeTruthy();
});
2 changes: 1 addition & 1 deletion packages/astro/tests/jest/astrov2/input/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"dependencies": {
"@stylify/astro": "workspace:^",
"@stylify/stylify": "workspace:^",
"astro": "^2.0"
"astro": "^3.0.0"
}
}
4 changes: 2 additions & 2 deletions packages/bundler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
"@stylify/stylify": "workspace:^",
"autoprefixer": "^10.4.14",
"chokidar": "^3.5.3",
"fast-glob": "^3.2.12",
"fast-glob": "^3.3.1",
"micromatch": "^4.0.5",
"normalize-path": "^3.0.0",
"postcss": "^8.4.23"
"postcss": "^8.4.29"
}
}
2 changes: 2 additions & 0 deletions packages/bundler/src/Bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ export class Bundler {

public constructor(config: BundlerConfigInterface) {
this.configurationLoadingPromise = this.configure(config);
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.configurationLoadingPromise.finally(() => {
hooks.callHook('bundler:initialized', {bundler: this});
});
Expand Down Expand Up @@ -798,6 +799,7 @@ export class Bundler {
});
}

// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.waitOnBundlesProcessed().finally(() => {
this.watchedFiles[pathToWatch].processing = false;
if (changedInfoLogged) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fse.copySync(path.join(bundleTestDir, 'input'), buildTmpDir);
new Bundler({ dev: true, showBundlesStats: false }).bundle([
{
outputFile: path.join(buildTmpDir, 'index.css'),
files: [path.join(buildTmpDir, '\\\(themes\\)/**/*.{html,svelte}')]
files: [path.join(buildTmpDir, '\\\\(themes\\\\)/**/*.{html,svelte}')]
}
]);

Expand Down
7 changes: 6 additions & 1 deletion packages/nuxt/tests/jest/nuxt/input/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,10 @@ export default defineNuxtConfig({
modules: [
'@nuxt/content',
'@stylify/nuxt',
]
],
// Tmp fix for micromark
alias: {
"micromark/lib/preprocess.js": "micromark",
"micromark/lib/postprocess.js": "micromark",
},
});
6 changes: 0 additions & 6 deletions packages/stylify/src/Compiler/Compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,6 @@ export interface ComponentsInterface {

export type UndefinedVariableWarningLevelType = 'silent' | 'warning' | 'error'

interface AreaToRewriteInterface {
contentToRewrite: string;
contentToReplace: string;
replacement?: string;
}

export class Compiler {

private readonly macroRegExpStartPart = '(?:^|[^a-zA-Z0-9_-])';
Expand Down
16 changes: 8 additions & 8 deletions packages/unplugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,18 @@
"dependencies": {
"@stylify/bundler": "workspace:^",
"@stylify/stylify": "workspace:^",
"unplugin": "^1.3.1"
"unplugin": "^1.4.0"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^15.0.2",
"@rollup/plugin-node-resolve": "^15.2.1",
"css-loader": "^6.8.1",
"esbuild": "^0.17.19",
"fast-glob": "^3.2.12",
"rollup": "^3.23.0",
"rollup-plugin-import-css": "~3.1.0",
"esbuild": "^0.19.2",
"fast-glob": "^3.3.1",
"rollup": "^3.28.0",
"rollup-plugin-import-css": "~3.3.1",
"rollup-plugin-postcss": "^4.0.2",
"style-loader": "^3.3.3",
"vite": "^4.3.9",
"webpack": "^5.84.1"
"vite": "^4.4.9",
"webpack": "^5.88.2"
}
}
4 changes: 2 additions & 2 deletions packages/unplugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ export const unplugin = createUnplugin((config: UnpluginConfigInterface = {}) =>
};
});

export const stylifyVite = unplugin.vite as UnpluginFactoryOutput<UnpluginConfigInterface, VitePlugin>;
export const stylifyRollup = unplugin.rollup as UnpluginFactoryOutput<UnpluginConfigInterface, RollupPlugin>;
export const stylifyVite = unplugin.vite as unknown as UnpluginFactoryOutput<UnpluginConfigInterface, VitePlugin>;
export const stylifyRollup = unplugin.rollup as unknown as UnpluginFactoryOutput<UnpluginConfigInterface, RollupPlugin>;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
export const stylifyWebpack = unplugin.webpack as UnpluginFactoryOutput<UnpluginConfigInterface, WebpackPluginInstance>;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
Expand Down
2 changes: 1 addition & 1 deletion packages/unplugin/tests/jest/webpack/expected/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7105a3a

Please sign in to comment.