Skip to content

Commit

Permalink
refactor: reset and removed untracked files
Browse files Browse the repository at this point in the history
  • Loading branch information
codebender828 committed Jan 27, 2023
1 parent 5928e47 commit 8d658d4
Show file tree
Hide file tree
Showing 64 changed files with 65 additions and 3,519 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,4 @@ cypress/screenshots

# Turborepo
.turbo
.output
5 changes: 4 additions & 1 deletion examples/nuxt-app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "./.nuxt/tsconfig.json"
"extends": "./.nuxt/tsconfig.json",
"compilerOptions": {
"allowImportingTsExtensions": true
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions packages/nuxt/package.json → modules/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"description": "Nuxt 3 compatible version of Chakra UI Vue",
"exports": {
".": {
"import": "./dist/chakra-ui-nuxt-next.esm.js",
"require": "./dist/chakra-ui-nuxt-next.cjs.js"
"import": "./dist/module.mjs",
"require": "./dist/module.cjs"
}
},
"main": "dist/chakra-ui-nuxt-next.cjs.js",
"module": "dist/chakra-ui-nuxt-next.esm.js",
"main": "./dist/module.cjs",
"types": "./dist/types.d.ts",
"files": [
"dist"
],
Expand All @@ -24,7 +24,7 @@
"nuxt:build": "nuxt-module-build",
"nuxt:build:fast": "nuxt-module-build",
"nuxt:dev:build": "nuxi build playground",
"nuxt:dev": "nuxi dev playground",
"nuxt:dev": "NODE_OPTIONS --experimental-specifier-resolution=node nuxi dev playground",
"types:check": "tsc --noEmit",
"build:types": "tsup src --dts-only"
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions packages/nuxt/src/module.ts → modules/nuxt/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,14 @@ export default defineNuxtModule<ChakraModuleOptions>({
const emotionCacheOptions = _options.emotionCacheOptions
const cssReset = _options.cssReset

nuxt.options.build.transpile.push("@chakra-ui")

// Install emotion module
installModule("@nuxtjs/emotion")
const { resolve } = createResolver(import.meta.url)
const runtimeDir = resolve("./runtime")
const templatesDir = resolve("./templates")
nuxt.options.build.transpile.push("@chakra-ui")
nuxt.options.build.transpile.push(runtimeDir)
const templatesDir = resolve("./templates")

for (const Component of getChakraComponents()) {
addComponent({
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import Chakra, {
cookieStorageManagerSSR,
extendChakra,
ColorModeConstants,
extendTheme
extendBaseTheme
} from "@chakra-ui/vue-next"
import { parseCookies } from "h3"
import { baseTheme } from "@chakra-ui/theme"


const extendedTheme = <%= (function() {
Expand Down Expand Up @@ -62,7 +63,7 @@ export default defineNuxtPlugin((nuxtApp) => {

const pluginOptions = {
cssReset,
extendTheme: extendTheme(extendedTheme, {
extendTheme: extendBaseTheme(extendedTheme, {
config: {
initialColorMode: isBrowser
? window.$chakraSSRContext?.theme?.ssrColorMode
Expand Down
17 changes: 17 additions & 0 deletions modules/nuxt/test/basic.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { fileURLToPath } from "url"
import { setup, $fetch } from "@nuxt/test-utils"
describe("nust emotion ssr", async () => {
await setup({
rootDir: fileURLToPath(new URL("../playground", import.meta.url)),
})
it("renders the index page", async () => {
const html = await $fetch("/")
expect(html).toContain("<style data-emotion")
expect(html).toContain("<script data-emotion")
expect(html).toContain("window.$emotionSSRIds")

// Removed because the nuxt build entries product difference SSR output
// for each test run so it doesn't make sense to run snapshot tests.
// expect(html).toMatchSnapshot()
})
})
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"packages": [
"packages/*",
"tooling/*",
"website",
"website-new"
"modules/*"
]
},
"scripts": {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/core/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default defineConfig({
],
format: ["esm", "cjs"],
entry: {
"chakra-ui-vue-next": "src/index.tsx",
"chakra-ui-vue-next": "src/index.ts",
},
keepNames: true,
})
7 changes: 0 additions & 7 deletions packages/nuxt/playground/.output/nitro.json

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 8d658d4

Please sign in to comment.