diff --git a/package.json b/package.json index 63be2409a..a42ab4c23 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "@types/react": "17.0.30", "@types/react-dom": "17.0.9", "@types/stylis": "4.0.2", + "@types/tmp": "0.2.3", "@typescript-eslint/eslint-plugin": "~5.3.0", "@typescript-eslint/parser": "~5.3.0", "babel-jest": "27.2.3", @@ -73,9 +74,11 @@ "react-dom": "17.0.2", "react-test-renderer": "17.0.2", "simple-git-hooks": "2.7.0", + "tmp": "0.2.1", "ts-jest": "27.0.5", "typescript": "~4.4.3", - "url-loader": "^3.0.0" + "url-loader": "^3.0.0", + "vite": "2.8.3" }, "dependencies": { "@babel/core": "^7.12.13", diff --git a/packages/vite-plugin/.eslintrc.json b/packages/vite-plugin/.eslintrc.json new file mode 100644 index 000000000..9d9c0db55 --- /dev/null +++ b/packages/vite-plugin/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/packages/vite-plugin/__fixtures__/object/code.ts b/packages/vite-plugin/__fixtures__/object/code.ts new file mode 100644 index 000000000..db3925e02 --- /dev/null +++ b/packages/vite-plugin/__fixtures__/object/code.ts @@ -0,0 +1,8 @@ +import { makeStyles } from '@griffel/react'; +import { tokens } from './tokens'; + +const styles = makeStyles({ + root: { color: tokens.colorBrandStroke1 }, +}); + +console.log(styles); diff --git a/packages/vite-plugin/__fixtures__/object/output.ts b/packages/vite-plugin/__fixtures__/object/output.ts new file mode 100644 index 000000000..2996c3452 --- /dev/null +++ b/packages/vite-plugin/__fixtures__/object/output.ts @@ -0,0 +1,12 @@ +import { __styles } from '@griffel/react'; +const styles = __styles( + { + root: { + sj55zd: 'fl9q5hc', + }, + }, + { + d: ['.fl9q5hc{color:var(--colorBrandStroke1);}'], + }, +); +console.log(styles); diff --git a/packages/vite-plugin/__fixtures__/object/tokens.ts b/packages/vite-plugin/__fixtures__/object/tokens.ts new file mode 100644 index 000000000..7728554d5 --- /dev/null +++ b/packages/vite-plugin/__fixtures__/object/tokens.ts @@ -0,0 +1,3 @@ +export const tokens = { + colorBrandStroke1: 'var(--colorBrandStroke1)', +}; diff --git a/packages/vite-plugin/__fixtures__/vite-aliases/code.ts b/packages/vite-plugin/__fixtures__/vite-aliases/code.ts new file mode 100644 index 000000000..c32cec2cb --- /dev/null +++ b/packages/vite-plugin/__fixtures__/vite-aliases/code.ts @@ -0,0 +1,14 @@ +import { makeStyles } from '@griffel/react'; +// @ts-expect-error This module will be resolved via aliases +import { blueColor } from 'non-existing-color-module'; + +import { tokens } from './tokens'; + +const styles = makeStyles({ + root: { + backgroundColor: blueColor, + color: tokens.colorBrandStroke1, + }, +}); + +console.log(styles); diff --git a/packages/vite-plugin/__fixtures__/vite-aliases/color.ts b/packages/vite-plugin/__fixtures__/vite-aliases/color.ts new file mode 100644 index 000000000..317abbbdb --- /dev/null +++ b/packages/vite-plugin/__fixtures__/vite-aliases/color.ts @@ -0,0 +1 @@ +export const blueColor = 'blue'; diff --git a/packages/vite-plugin/__fixtures__/vite-aliases/output.ts b/packages/vite-plugin/__fixtures__/vite-aliases/output.ts new file mode 100644 index 000000000..70031f2af --- /dev/null +++ b/packages/vite-plugin/__fixtures__/vite-aliases/output.ts @@ -0,0 +1,18 @@ +import { __styles } from '@griffel/react'; // @ts-expect-error This module will be resolved via aliases + +import color from 'non-existing-color-module'; +import { tokens } from './tokens'; + +const styles = __styles( + { + root: { + De3pzq: 'f1bh81bl', + sj55zd: 'fl9q5hc', + }, + }, + { + d: ['.f1bh81bl{background-color:blue;}', '.fl9q5hc{color:var(--colorBrandStroke1);}'], + }, +); + +console.log(styles); diff --git a/packages/vite-plugin/__fixtures__/vite-aliases/tokens.ts b/packages/vite-plugin/__fixtures__/vite-aliases/tokens.ts new file mode 100644 index 000000000..7728554d5 --- /dev/null +++ b/packages/vite-plugin/__fixtures__/vite-aliases/tokens.ts @@ -0,0 +1,3 @@ +export const tokens = { + colorBrandStroke1: 'var(--colorBrandStroke1)', +}; diff --git a/packages/vite-plugin/jest.config.js b/packages/vite-plugin/jest.config.js new file mode 100644 index 000000000..dad38c40e --- /dev/null +++ b/packages/vite-plugin/jest.config.js @@ -0,0 +1,15 @@ +module.exports = { + displayName: 'vite-plugin', + preset: '../../jest.preset.js', + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + testEnvironment: 'node', + transform: { + '^.+\\.[tj]sx?$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'], + coverageDirectory: '../../coverage/packages/vite-plugin', +}; diff --git a/packages/vite-plugin/package.json b/packages/vite-plugin/package.json new file mode 100644 index 000000000..bec1091de --- /dev/null +++ b/packages/vite-plugin/package.json @@ -0,0 +1,13 @@ +{ + "name": "@griffel/vite-plugin", + "version": "0.0.1", + "description": "Vite plugin for Griffel", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/microsoft/griffel" + }, + "peerDependencies": { + "@griffel/react": "^1.0.0" + } +} diff --git a/packages/vite-plugin/project.json b/packages/vite-plugin/project.json new file mode 100644 index 000000000..e0770040a --- /dev/null +++ b/packages/vite-plugin/project.json @@ -0,0 +1,34 @@ +{ + "root": "packages/vite-plugin", + "sourceRoot": "packages/vite-plugin/src", + "projectType": "library", + "targets": { + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["packages/vite-plugin/**/*.ts"] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": ["coverage/packages/vite-plugin"], + "options": { + "jestConfig": "packages/vite-plugin/jest.config.js", + "passWithNoTests": true + } + }, + "build": { + "executor": "@nrwl/node:package", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/packages/vite-plugin", + "tsConfig": "packages/vite-plugin/tsconfig.lib.json", + "packageJson": "packages/vite-plugin/package.json", + "main": "packages/vite-plugin/src/index.ts", + "assets": ["packages/vite-plugin/*.md"] + } + } + }, + "tags": [] +} diff --git a/packages/vite-plugin/src/index.ts b/packages/vite-plugin/src/index.ts new file mode 100644 index 000000000..1d0f2b68b --- /dev/null +++ b/packages/vite-plugin/src/index.ts @@ -0,0 +1 @@ +export { vitePlugin as default } from './vitePlugin'; diff --git a/packages/vite-plugin/src/transformSync.ts b/packages/vite-plugin/src/transformSync.ts new file mode 100644 index 000000000..7725bed68 --- /dev/null +++ b/packages/vite-plugin/src/transformSync.ts @@ -0,0 +1,57 @@ +import * as Babel from '@babel/core'; +import griffelPreset, { BabelPluginOptions } from '@griffel/babel-preset'; + +export type TransformOptions = { + filename: string; + + inputSourceMap: Babel.TransformOptions['inputSourceMap']; + enableSourceMaps: boolean; + + pluginOptions: BabelPluginOptions; +}; + +export type TransformResult = { + code: string; + sourceMap: NonNullable | undefined; +}; + +/** + * Transforms passed source code with Babel, uses user's config for parsing, but ignores it for transforms. + */ +export function transformSync(sourceCode: string, options: TransformOptions): TransformResult { + // Parse the code first so Babel will use user's babel config for parsing + // During transforms we don't want to use user's config + const babelAST = Babel.parseSync(sourceCode, { + caller: { name: 'make-styles' }, + + filename: options.filename, + inputSourceMap: options.inputSourceMap, + sourceMaps: options.enableSourceMaps, + }); + + if (babelAST === null) { + throw new Error(`Failed to create AST for "${options.filename}" due unknown Babel error...`); + } + + const babelFileResult = Babel.transformFromAstSync(babelAST, sourceCode, { + // Ignore all user's configs and apply only our plugin + babelrc: false, + configFile: false, + presets: [[griffelPreset, options.pluginOptions]], + + filename: options.filename, + + sourceMaps: options.enableSourceMaps, + sourceFileName: options.filename, + inputSourceMap: options.inputSourceMap, + }); + + if (babelFileResult === null) { + throw new Error(`Failed to transform "${options.filename}" due unknown Babel error...`); + } + + return { + code: babelFileResult.code as string, + sourceMap: babelFileResult.map === null ? undefined : babelFileResult.map, + }; +} diff --git a/packages/vite-plugin/src/vitePlugin.test.ts b/packages/vite-plugin/src/vitePlugin.test.ts new file mode 100644 index 000000000..2c610b387 --- /dev/null +++ b/packages/vite-plugin/src/vitePlugin.test.ts @@ -0,0 +1,140 @@ +import * as fs from 'fs-extra'; +import * as path from 'path'; +import * as prettier from 'prettier'; +import { AliasOptions, build } from 'vite'; +import * as tmp from 'tmp'; + +import { vitePlugin } from './vitePlugin'; + +type CompileOptions = { + alias?: AliasOptions; +}; + +const prettierConfig = JSON.parse( + fs.readFileSync(path.resolve(__dirname, '../../../.prettierrc'), { encoding: 'utf-8' }), +); + +// Clean up created files/folders on exit, even after exceptions +// (will not catch SIGINT on windows) +tmp.setGracefulCleanup(); + +async function compileSourceWithVite(entryPath: string, options: CompileOptions): Promise { + const testDir = tmp.dirSync().name; + console.log('path.basename(entryPath)', path.basename(entryPath)); + + await fs.copy(path.dirname(entryPath), testDir); + + console.log('testDir', testDir); + await build({ + build: { + lib: { + entry: testDir + '/code.ts', + fileName: 'test', + name: 'test', + formats: ['es'], + }, + outDir: testDir + '/dist', + rollupOptions: { + external: ['@griffel/react'], + }, + }, + plugins: [vitePlugin()], + root: testDir, + ...(options.alias && { resolve: { alias: options.alias } }), + }); + + return await fs.promises.readFile(testDir + '/dist/test.es.js', { encoding: 'utf-8' }); +} + +function fixLineEndings(value: string) { + return String(value).replace(/\r?\n/g, '\n').trim(); +} + +/** + * Test utility similar to "babel-plugin-tester". + * + * See https://webpack.js.org/contribute/writing-a-loader/#testing. + */ +function testFixture(fixtureName: string, options: CompileOptions = {}) { + it(`"${fixtureName}" fixture`, async () => { + const fixturePath = path.resolve(__dirname, '..', '__fixtures__', fixtureName); + + const tsCodePath = path.resolve(fixturePath, 'code.ts'); + const tsxCodePath = path.resolve(fixturePath, 'code.tsx'); + // Specially for cases when "code" contains syntax errors + const txtCodePath = path.resolve(fixturePath, 'code.txt'); + + const tsOutputPath = path.resolve(fixturePath, 'output.ts'); + const tsxOutputPath = path.resolve(fixturePath, 'output.tsx'); + + const inputPath = [ + fs.existsSync(tsCodePath) && tsCodePath, + fs.existsSync(tsxCodePath) && tsxCodePath, + fs.existsSync(txtCodePath) && txtCodePath, + ].find(Boolean); + const outputPath = [ + fs.existsSync(tsOutputPath) && tsOutputPath, + fs.existsSync(tsxOutputPath) && tsxOutputPath, + ].find(Boolean); + + const errorPath = path.resolve(fixturePath, 'error.ts'); + const expectedError = fs.existsSync(errorPath) && require(errorPath); + + if (!inputPath) { + throw new Error(`Failed to find "code.{js,ts,tsx}" in "${fixturePath}"`); + } + + if (!outputPath && !expectedError) { + throw new Error(`Failed to find "output.{js,ts,tsx}" or "error.ts" in "${fixturePath}"`); + } + + if (expectedError) { + if (!expectedError.default) { + throw new Error( + `Please check that "error.ts" contains a default export with an error or regex in "${fixturePath}"`, + ); + } + } + + let result = ''; + // let resultError: Error | webpack.StatsError = new Error(); + + try { + result = fixLineEndings( + prettier.format(await compileSourceWithVite(inputPath, options), { + ...prettierConfig, + parser: 'typescript', + }), + ); + } catch (err) { + if (expectedError) { + // resultError = err as webpack.StatsError; + } else { + throw err; + } + } + + if (outputPath) { + const output = fixLineEndings(await fs.promises.readFile(outputPath, 'utf8')); + + expect(result).toBe(output); + return; + } + + if (expectedError) { + // expect(resultError.message).toMatch(expectedError.default); + } + }); +} + +describe('vitePlugin', () => { + // Integration fixtures for base functionality, all scenarios are tested in "@griffel/babel-preset" + testFixture('object'); + + // Asserts that aliases are resolved properly in Babel plugin + testFixture('vite-aliases', { + alias: { + 'non-existing-color-module': path.resolve(__dirname, '..', '__fixtures__', 'vite-aliases', 'color.ts'), + }, + }); +}); diff --git a/packages/vite-plugin/src/vitePlugin.ts b/packages/vite-plugin/src/vitePlugin.ts new file mode 100644 index 000000000..d8326033f --- /dev/null +++ b/packages/vite-plugin/src/vitePlugin.ts @@ -0,0 +1,42 @@ +import { EvalCache, Module } from '@linaria/babel-preset'; +import * as path from 'path'; +import { Plugin } from 'vite'; + +import { transformSync, TransformResult, TransformOptions } from './transformSync'; + +export function vitePlugin(): Plugin { + return { + name: 'griffel', + + transform(code: string, id: string, options?: { ssr?: boolean }) { + console.log(code, this.resolve); + + // We are evaluating modules in Babel plugin to resolve expressions (function calls, imported constants, etc.) in + // makeStyles() calls, see evaluatePathsInVM.ts. + + Module._resolveFilename = (id, { filename }) => { + // + // Oops, "this.resolve(id, filename)" should be sync + // + + this.resolve(id, filename).then(resolvedPath => { + console.log('Module._resolveFilename:id', id); + console.log('Module._resolveFilename:filename', filename); + console.log('Module._resolveFilename:resolvedPath', resolvedPath); + if (!resolvedPath) { + throw new Error(`Failed to resolve module "${id}"`); + } + }); + + return ''; // resolvedPath; + }; + + return transformSync(code, { + filename: path.relative(process.cwd(), id), + enableSourceMaps: false, + inputSourceMap: undefined, + pluginOptions: {}, + }); + }, + }; +} diff --git a/packages/vite-plugin/tsconfig.json b/packages/vite-plugin/tsconfig.json new file mode 100644 index 000000000..e464c9eb8 --- /dev/null +++ b/packages/vite-plugin/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "allowJs": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/packages/vite-plugin/tsconfig.lib.json b/packages/vite-plugin/tsconfig.lib.json new file mode 100644 index 000000000..475cca856 --- /dev/null +++ b/packages/vite-plugin/tsconfig.lib.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": ["node", "environment"] + }, + "exclude": ["__fixtures__/*/*.ts", "**/*.spec.ts", "**/*.test.ts"], + "include": ["**/*.ts"] +} diff --git a/packages/vite-plugin/tsconfig.spec.json b/packages/vite-plugin/tsconfig.spec.json new file mode 100644 index 000000000..44e0862da --- /dev/null +++ b/packages/vite-plugin/tsconfig.spec.json @@ -0,0 +1,20 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node", "environment"] + }, + "include": [ + "__fixtures__/*/code.ts", + "**/*.test.ts", + "**/*.spec.ts", + "**/*.test.tsx", + "**/*.spec.tsx", + "**/*.test.js", + "**/*.spec.js", + "**/*.test.jsx", + "**/*.spec.jsx", + "**/*.d.ts" + ] +} diff --git a/packages/webpack-loader/src/webpackLoader.test.ts b/packages/webpack-loader/src/webpackLoader.test.ts index c99f3572c..4e260b81c 100644 --- a/packages/webpack-loader/src/webpackLoader.test.ts +++ b/packages/webpack-loader/src/webpackLoader.test.ts @@ -201,7 +201,7 @@ describe('shouldTransformSourceCode', () => { }); describe('webpackLoader', () => { - // Integration fixtures for base functionality, all scenarios are tested in "babel-make-styles" + // Integration fixtures for base functionality, all scenarios are tested in "@griffel/babel-preset" testFixture('object'); testFixture('function'); diff --git a/test.js b/test.js new file mode 100644 index 000000000..311414aae --- /dev/null +++ b/test.js @@ -0,0 +1,25 @@ +const { Module } = require('@linaria/babel-preset'); + +const options = { + displayName: false, + evaluate: true, + + rules: [{ test: /\w/, action: 'ignore' }], +}; +const mod = new Module('test.js', options); + +mod.evaluate( + ` +function later(delay, value) { + return new Promise(resolve => setTimeout(resolve, delay, value)); +} + + +module.exports = { + foo: await later(2000, 'wait...'), +}; +`, + ['foo'], +); + +console.log(mod.exports); diff --git a/tsconfig.base.json b/tsconfig.base.json index 86e8cf903..d3dccb7ac 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -19,6 +19,7 @@ "@griffel/core": ["packages/core/src/index.ts"], "@griffel/jest-serializer": ["packages/jest-serializer/src/index.ts"], "@griffel/react": ["packages/react/src/index.ts"], + "@griffel/vite-plugin": ["packages/vite-plugin/src/index.ts"], "@griffel/webpack-loader": ["packages/webpack-loader/src/index.ts"] }, "typeRoots": ["node_modules/@types", "./typings"] diff --git a/workspace.json b/workspace.json index 78a192232..6eef6da01 100644 --- a/workspace.json +++ b/workspace.json @@ -5,6 +5,7 @@ "@griffel/core": "packages/core", "@griffel/jest-serializer": "packages/jest-serializer", "@griffel/react": "packages/react", + "@griffel/vite-plugin": "packages/vite-plugin", "@griffel/webpack-loader": "packages/webpack-loader", "@griffel/website": "apps/website" } diff --git a/yarn.lock b/yarn.lock index 7e6853bbe..1526d4716 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6492,6 +6492,13 @@ __metadata: languageName: node linkType: hard +"@types/tmp@npm:0.2.3": + version: 0.2.3 + resolution: "@types/tmp@npm:0.2.3" + checksum: 0ca45e99b3b3c6959d5c4f4555f73c8007db540cfb0fbbb9373217f9ab85e67eef75193f51a1d6564b0ee6c6f5ffa259d1034d7f7530a5b7ce80acb94cfc4daa + languageName: node + linkType: hard + "@types/uglify-js@npm:*": version: 3.13.1 resolution: "@types/uglify-js@npm:3.13.1" @@ -11242,6 +11249,207 @@ __metadata: languageName: node linkType: hard +"esbuild-android-arm64@npm:0.14.23": + version: 0.14.23 + resolution: "esbuild-android-arm64@npm:0.14.23" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"esbuild-darwin-64@npm:0.14.23": + version: 0.14.23 + resolution: "esbuild-darwin-64@npm:0.14.23" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"esbuild-darwin-arm64@npm:0.14.23": + version: 0.14.23 + resolution: "esbuild-darwin-arm64@npm:0.14.23" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"esbuild-freebsd-64@npm:0.14.23": + version: 0.14.23 + resolution: "esbuild-freebsd-64@npm:0.14.23" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"esbuild-freebsd-arm64@npm:0.14.23": + version: 0.14.23 + resolution: "esbuild-freebsd-arm64@npm:0.14.23" + conditions: os=freebsd & cpu=arm64 + languageName: node + linkType: hard + +"esbuild-linux-32@npm:0.14.23": + version: 0.14.23 + resolution: "esbuild-linux-32@npm:0.14.23" + conditions: os=linux & cpu=ia32 + languageName: node + linkType: hard + +"esbuild-linux-64@npm:0.14.23": + version: 0.14.23 + resolution: "esbuild-linux-64@npm:0.14.23" + conditions: os=linux & cpu=x64 + languageName: node + linkType: hard + +"esbuild-linux-arm64@npm:0.14.23": + version: 0.14.23 + resolution: "esbuild-linux-arm64@npm:0.14.23" + conditions: os=linux & cpu=arm64 + languageName: node + linkType: hard + +"esbuild-linux-arm@npm:0.14.23": + version: 0.14.23 + resolution: "esbuild-linux-arm@npm:0.14.23" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"esbuild-linux-mips64le@npm:0.14.23": + version: 0.14.23 + resolution: "esbuild-linux-mips64le@npm:0.14.23" + conditions: os=linux & cpu=mips64el + languageName: node + linkType: hard + +"esbuild-linux-ppc64le@npm:0.14.23": + version: 0.14.23 + resolution: "esbuild-linux-ppc64le@npm:0.14.23" + conditions: os=linux & cpu=ppc64 + languageName: node + linkType: hard + +"esbuild-linux-riscv64@npm:0.14.23": + version: 0.14.23 + resolution: "esbuild-linux-riscv64@npm:0.14.23" + conditions: os=linux & cpu=riscv64 + languageName: node + linkType: hard + +"esbuild-linux-s390x@npm:0.14.23": + version: 0.14.23 + resolution: "esbuild-linux-s390x@npm:0.14.23" + conditions: os=linux & cpu=s390x + languageName: node + linkType: hard + +"esbuild-netbsd-64@npm:0.14.23": + version: 0.14.23 + resolution: "esbuild-netbsd-64@npm:0.14.23" + conditions: os=netbsd & cpu=x64 + languageName: node + linkType: hard + +"esbuild-openbsd-64@npm:0.14.23": + version: 0.14.23 + resolution: "esbuild-openbsd-64@npm:0.14.23" + conditions: os=openbsd & cpu=x64 + languageName: node + linkType: hard + +"esbuild-sunos-64@npm:0.14.23": + version: 0.14.23 + resolution: "esbuild-sunos-64@npm:0.14.23" + conditions: os=sunos & cpu=x64 + languageName: node + linkType: hard + +"esbuild-windows-32@npm:0.14.23": + version: 0.14.23 + resolution: "esbuild-windows-32@npm:0.14.23" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"esbuild-windows-64@npm:0.14.23": + version: 0.14.23 + resolution: "esbuild-windows-64@npm:0.14.23" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"esbuild-windows-arm64@npm:0.14.23": + version: 0.14.23 + resolution: "esbuild-windows-arm64@npm:0.14.23" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"esbuild@npm:^0.14.14": + version: 0.14.23 + resolution: "esbuild@npm:0.14.23" + dependencies: + esbuild-android-arm64: 0.14.23 + esbuild-darwin-64: 0.14.23 + esbuild-darwin-arm64: 0.14.23 + esbuild-freebsd-64: 0.14.23 + esbuild-freebsd-arm64: 0.14.23 + esbuild-linux-32: 0.14.23 + esbuild-linux-64: 0.14.23 + esbuild-linux-arm: 0.14.23 + esbuild-linux-arm64: 0.14.23 + esbuild-linux-mips64le: 0.14.23 + esbuild-linux-ppc64le: 0.14.23 + esbuild-linux-riscv64: 0.14.23 + esbuild-linux-s390x: 0.14.23 + esbuild-netbsd-64: 0.14.23 + esbuild-openbsd-64: 0.14.23 + esbuild-sunos-64: 0.14.23 + esbuild-windows-32: 0.14.23 + esbuild-windows-64: 0.14.23 + esbuild-windows-arm64: 0.14.23 + dependenciesMeta: + esbuild-android-arm64: + optional: true + esbuild-darwin-64: + optional: true + esbuild-darwin-arm64: + optional: true + esbuild-freebsd-64: + optional: true + esbuild-freebsd-arm64: + optional: true + esbuild-linux-32: + optional: true + esbuild-linux-64: + optional: true + esbuild-linux-arm: + optional: true + esbuild-linux-arm64: + optional: true + esbuild-linux-mips64le: + optional: true + esbuild-linux-ppc64le: + optional: true + esbuild-linux-riscv64: + optional: true + esbuild-linux-s390x: + optional: true + esbuild-netbsd-64: + optional: true + esbuild-openbsd-64: + optional: true + esbuild-sunos-64: + optional: true + esbuild-windows-32: + optional: true + esbuild-windows-64: + optional: true + esbuild-windows-arm64: + optional: true + bin: + esbuild: bin/esbuild + checksum: 41d26f9022a9f95a1ccf280fd6c2cf2684264663c03d5d4338bfab17710292b9c2ca45624ed55d9f37d7be5f29557ebd6d101b21ed5592fb0b6e6ac5e76bc58d + languageName: node + linkType: hard + "escalade@npm:^3.1.1": version: 3.1.1 resolution: "escalade@npm:3.1.1" @@ -13081,6 +13289,7 @@ __metadata: "@types/react": 17.0.30 "@types/react-dom": 17.0.9 "@types/stylis": 4.0.2 + "@types/tmp": 0.2.3 "@typescript-eslint/eslint-plugin": ~5.3.0 "@typescript-eslint/parser": ~5.3.0 ajv: ^8.4.0 @@ -13110,10 +13319,12 @@ __metadata: schema-utils: ^3.1.1 simple-git-hooks: 2.7.0 stylis: ^4.0.13 + tmp: 0.2.1 ts-jest: 27.0.5 tslib: ^2.1.0 typescript: ~4.4.3 url-loader: ^3.0.0 + vite: 2.8.3 languageName: unknown linkType: soft @@ -16971,12 +17182,12 @@ __metadata: languageName: node linkType: hard -"nanoid@npm:^3.1.23, nanoid@npm:^3.1.30": - version: 3.2.0 - resolution: "nanoid@npm:3.2.0" +"nanoid@npm:^3.1.23, nanoid@npm:^3.2.0": + version: 3.3.1 + resolution: "nanoid@npm:3.3.1" bin: nanoid: bin/nanoid.cjs - checksum: 3d1d5a69fea84e538057cf64106e713931c4ef32af344068ecff153ff91252f39b0f2b472e09b0dfff43ac3cf520c92938d90e6455121fe93976e23660f4fccc + checksum: 4ef0969e1bbe866fc223eb32276cbccb0961900bfe79104fa5abe34361979dead8d0e061410a5c03bc3d47455685adf32c09d6f27790f4a6898fb51f7df7ec86 languageName: node linkType: hard @@ -18814,14 +19025,14 @@ __metadata: languageName: node linkType: hard -"postcss@npm:^8.2.15, postcss@npm:^8.3.11, postcss@npm:^8.3.5, postcss@npm:^8.3.7": - version: 8.4.5 - resolution: "postcss@npm:8.4.5" +"postcss@npm:^8.2.15, postcss@npm:^8.3.11, postcss@npm:^8.3.5, postcss@npm:^8.3.7, postcss@npm:^8.4.6": + version: 8.4.6 + resolution: "postcss@npm:8.4.6" dependencies: - nanoid: ^3.1.30 + nanoid: ^3.2.0 picocolors: ^1.0.0 - source-map-js: ^1.0.1 - checksum: b78abdd89c10f7b48f4bdcd376104a19d6e9c7495ab521729bdb3df315af6c211360e9f06887ad3bc0ab0f61a04b91d68ea11462997c79cced58b9ccd66fac07 + source-map-js: ^1.0.2 + checksum: 60e7808f39c4a9d0fa067bfd5eb906168c4eb6d3ff0093f7d314d1979b001a16363deedccd368a7df869c63ad4ae350d27da439c94ff3fb0f8fc93d49fe38a90 languageName: node linkType: hard @@ -20301,7 +20512,7 @@ __metadata: languageName: node linkType: hard -"resolve@npm:^1.1.6, resolve@npm:^1.1.7, resolve@npm:^1.10.0, resolve@npm:^1.12.0, resolve@npm:^1.14.2, resolve@npm:^1.17.0, resolve@npm:^1.19.0, resolve@npm:^1.20.0, resolve@npm:^1.3.2": +"resolve@npm:^1.1.6, resolve@npm:^1.1.7, resolve@npm:^1.10.0, resolve@npm:^1.12.0, resolve@npm:^1.14.2, resolve@npm:^1.17.0, resolve@npm:^1.19.0, resolve@npm:^1.20.0, resolve@npm:^1.22.0, resolve@npm:^1.3.2": version: 1.22.0 resolution: "resolve@npm:1.22.0" dependencies: @@ -20334,7 +20545,7 @@ __metadata: languageName: node linkType: hard -"resolve@patch:resolve@^1.1.6#~builtin, resolve@patch:resolve@^1.1.7#~builtin, resolve@patch:resolve@^1.10.0#~builtin, resolve@patch:resolve@^1.12.0#~builtin, resolve@patch:resolve@^1.14.2#~builtin, resolve@patch:resolve@^1.17.0#~builtin, resolve@patch:resolve@^1.19.0#~builtin, resolve@patch:resolve@^1.20.0#~builtin, resolve@patch:resolve@^1.3.2#~builtin": +"resolve@patch:resolve@^1.1.6#~builtin, resolve@patch:resolve@^1.1.7#~builtin, resolve@patch:resolve@^1.10.0#~builtin, resolve@patch:resolve@^1.12.0#~builtin, resolve@patch:resolve@^1.14.2#~builtin, resolve@patch:resolve@^1.17.0#~builtin, resolve@patch:resolve@^1.19.0#~builtin, resolve@patch:resolve@^1.20.0#~builtin, resolve@patch:resolve@^1.22.0#~builtin, resolve@patch:resolve@^1.3.2#~builtin": version: 1.22.0 resolution: "resolve@patch:resolve@npm%3A1.22.0#~builtin::version=1.22.0&hash=07638b" dependencies: @@ -20497,9 +20708,9 @@ __metadata: languageName: node linkType: hard -"rollup@npm:^2.56.2": - version: 2.64.0 - resolution: "rollup@npm:2.64.0" +"rollup@npm:^2.56.2, rollup@npm:^2.59.0": + version: 2.67.3 + resolution: "rollup@npm:2.67.3" dependencies: fsevents: ~2.3.2 dependenciesMeta: @@ -20507,7 +20718,7 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: dc5b28538002ed635ea54af4c2ced05c52146322c61dbe0e84f294ee62e4f232a15760fdcef9bbeb742883edf9bf093ace5389bbdd816d18b9f5740555135180 + checksum: c4013a2ceef6918375fd07a6548e05d0f3df1db9f0a0281aebe6e993a45c0e667c5a06f53b55c0ffaf72f72266c1879bc181b13199aace97d93f0fc47691d4a9 languageName: node linkType: hard @@ -21257,10 +21468,10 @@ __metadata: languageName: node linkType: hard -"source-map-js@npm:>=0.6.2 <2.0.0, source-map-js@npm:^1.0.1": - version: 1.0.1 - resolution: "source-map-js@npm:1.0.1" - checksum: 22606113d62bbd468712b0cb0c46e9a8629de7eb081049c62a04d977a211abafd7d61455617f8b78daba0b6c0c7e7c88f8c6b5aaeacffac0a6676ecf5caac5ce +"source-map-js@npm:>=0.6.2 <2.0.0, source-map-js@npm:^1.0.1, source-map-js@npm:^1.0.2": + version: 1.0.2 + resolution: "source-map-js@npm:1.0.2" + checksum: c049a7fc4deb9a7e9b481ae3d424cc793cb4845daa690bc5a05d428bf41bf231ced49b4cf0c9e77f9d42fdb3d20d6187619fc586605f5eabe995a316da8d377c languageName: node linkType: hard @@ -22301,7 +22512,7 @@ __metadata: languageName: node linkType: hard -"tmp@npm:~0.2.1": +"tmp@npm:0.2.1, tmp@npm:~0.2.1": version: 0.2.1 resolution: "tmp@npm:0.2.1" dependencies: @@ -23350,6 +23561,35 @@ __metadata: languageName: node linkType: hard +"vite@npm:2.8.3": + version: 2.8.3 + resolution: "vite@npm:2.8.3" + dependencies: + esbuild: ^0.14.14 + fsevents: ~2.3.2 + postcss: ^8.4.6 + resolve: ^1.22.0 + rollup: ^2.59.0 + peerDependencies: + less: "*" + sass: "*" + stylus: "*" + dependenciesMeta: + fsevents: + optional: true + peerDependenciesMeta: + less: + optional: true + sass: + optional: true + stylus: + optional: true + bin: + vite: bin/vite.js + checksum: f18f62037741ae8ac8b377da9ba4ed9556bebe9857531bbf33b2691cba15c5720264410385cd628bbccee5bfe105d3d0ead6286e3fbe0211de94ea061e2e876c + languageName: node + linkType: hard + "vm-browserify@npm:^1.0.1": version: 1.1.2 resolution: "vm-browserify@npm:1.1.2"