Skip to content

Commit

Permalink
upgrade tech stack
Browse files Browse the repository at this point in the history
  • Loading branch information
yiminghe committed Jun 21, 2024
1 parent 517b302 commit 2ddb69d
Show file tree
Hide file tree
Showing 12 changed files with 5,490 additions and 4,633 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [20.x]

steps:
- name: Checkout
Expand Down Expand Up @@ -45,7 +45,6 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile
- run: cp test-coverage-babelrc .babelrc
- run: pnpm test:ci
env:
CYPRESS_RECORD_KEY: ${{vars.CYPRESS_RECORD_KEY}}
Expand Down
2 changes: 1 addition & 1 deletion app/body-overflow/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import React, { useRef, useEffect } from 'react';
import domAlign from '../../src/';
import domAlign from '../../src';

export default function Overflow() {
const source = useRef();
Expand Down
2 changes: 1 addition & 1 deletion app/fail/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import React, { useRef, useEffect } from 'react';
import domAlign from '../../src/';
import domAlign from '../../src';

export default function Fail() {
const source = useRef();
Expand Down
7 changes: 6 additions & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ import React from 'react';
import MarkdownIt from 'markdown-it';
import 'github-markdown-css/github-markdown-light.css';
// @ts-ignore
import readme from '!!raw-loader!../README.md';
import prism from 'prismjs';
import 'prismjs/components/prism-json';
import 'prismjs/components/prism-javascript';
import 'prismjs/themes/prism.css';
import fs from 'fs';
import path from 'path';

const readme = fs.readFileSync(
path.join(process.cwd(), './README.md'),
'utf-8',
);
const md = new MarkdownIt({
html: true,
linkify: true,
Expand Down
2 changes: 1 addition & 1 deletion app/shadow-dom/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import React, { useRef, useEffect } from 'react';
import ReactDOM from 'react-dom/client';
import domAlign from '../../src/';
import domAlign from '../../src';

function Test() {
const source = useRef();
Expand Down
2 changes: 1 addition & 1 deletion app/simple/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import React from 'react';
import domAlign from '../../src/';
import domAlign from '../../src';

function $id(id): any {
return document.getElementById(id);
Expand Down
5 changes: 2 additions & 3 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { defineConfig } from 'cypress';

import codeCoverage from '@cypress/code-coverage/task';
export default defineConfig({
projectId: '22j6d7',
component: {
setupNodeEvents(on, config) {
require('@cypress/code-coverage/task')(on, config);

codeCoverage(on, config)
return config;
},
devServer: {
Expand Down
12 changes: 10 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
/** @type {import('next').NextConfig} */
module.exports = {
output: 'export',
reactStrictMode: false,
pageExtensions: ['ts', 'tsx', 'js'],
experimental: {
appDir: true,
swcPlugins: process.env.NODE_ENV !== 'production' ? [
[
require.resolve('swc-plugin-coverage-instrument'),
{
},
],
] : [],
},
output: 'export',
distDir: 'dom-align',
basePath: process.env.NODE_ENV === 'production' ? '/dom-align' : '',
assetPrefix:
Expand Down
30 changes: 17 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,39 @@
"build": "node scripts/build",
"gh-pages": "next build && touch dom-align/.nojekyll && gh-pages -d dom-align -t",
"start": "next dev",
"test": "cypress run --component",
"test": "rm -rf .nyc_output && cypress run --component",
"test:ci": "cypress run --component --record --key $CYPRESS_RECORD_KEY"
},
"nyc": {
"all": true,
"include": "src/**/*.js"
"excludeAfterRemap": true,
"exclude": [
"**/node_modules/**/*",
"**/.pnpm/**/*",
"**/cypress/**/*"
],
"reporter": [
"text",
"lcov"
]
},
"devDependencies": {
"@babel/preset-react": "^7.22.5",
"@babel/preset-typescript": "^7.22.11",
"@cypress/code-coverage": "^3.11.0",
"swc-plugin-coverage-instrument": "0.0.21",
"@cypress/code-coverage": "3.x",
"@swc/cli": "0.1.x",
"@swc/core": "1.3.x",
"@types/react": "18.2.21",
"babel-plugin-istanbul": "^6.1.1",
"babel-plugin-transform-class-properties": "^6.24.1",
"cypress": "^13.1.0",
"cypress": "13.x",
"eslint": "^8.48.0",
"eslint-config-next": "13.4.19",
"gh-pages": "6.x",
"github-markdown-css": "^5.2.0",
"lint-staged": "14.x",
"markdown-it": "^13.0.1",
"next": "13.x",
"next": "14.x",
"normalize.css": "^8.0.1",
"pre-commit": "1.x",
"prettier": "3.x",
"prismjs": "^1.29.0",
"raw-loader": "^4.0.2",
"react": "18.x",
"react-dom": "18.x",
"typescript": "5.x"
Expand All @@ -65,5 +69,5 @@
"pre-commit": [
"lint-staged"
],
"packageManager": "pnpm@8.7.1"
}
"packageManager": "pnpm@9.4.0"
}
Loading

0 comments on commit 2ddb69d

Please sign in to comment.