Skip to content

Commit

Permalink
Merge pull request #313 from svobik7/v4-pnpm
Browse files Browse the repository at this point in the history
chore(deps): updated deps, patched dts-bundle-generator, backt to vitest
  • Loading branch information
svobik7 authored Nov 29, 2024
2 parents b09ee9b + f41dcb2 commit 6fe81cb
Show file tree
Hide file tree
Showing 13 changed files with 2,609 additions and 4,328 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Install dependencies
- name: Enable Corepack
run: corepack enable
- name: (PACKAGE) Install dependencies
run: yarn install --frozen-lockfile
- name: (PACKAGE) Build package
run: yarn build
- name: (EXAMPLE) Install dependencies
run: yarn install --frozen-lockfile
working-directory: examples/basic
- name: Run tests
- name: (EXAMPLE) Run tests
run: yarn e2e:headless
working-directory: examples/basic
Release:
Expand All @@ -46,6 +52,8 @@ jobs:
uses: actions/setup-node@v
with:
node-version: 'lts/*'
- name: Enable Corepack
run: corepack enable
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
Expand Down
8 changes: 0 additions & 8 deletions .gitpod.yml

This file was deleted.

2 changes: 1 addition & 1 deletion examples/basic/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
2,081 changes: 867 additions & 1,214 deletions examples/basic/yarn.lock

Large diffs are not rendered by default.

213 changes: 0 additions & 213 deletions jest.config.ts

This file was deleted.

38 changes: 21 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@
},
"scripts": {
"prepare": "husky",
"postinstall": "yarn patch-package",
"clean": "rm -rf dist || true",
"build": "yarn clean && yarn typecheck && yarn test && node esbuild.mjs && yarn build:types && yarn lint",
"build:types": "yarn dts-bundle-generator --config ./dts.config.js",
"build:no-test": "node esbuild.mjs",
"build:coverage": "yarn clean && yarn typecheck && yarn test && node esbuild.mjs",
"lint": "eslint . --max-warnings 0",
"lint-fix": "eslint . --fix --max-warnings 0",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "yarn test --coverage",
"test": "vitest --no-watch",
"test:watch": "vitest",
"test:coverage": "yarn vitest --no-watch --coverage",
"typecheck": "yarn tsc --noEmit",
"prepublish": "yarn build",
"publish:canary": "yarn publish --tag canary",
Expand All @@ -44,37 +45,35 @@
"path-to-regexp": "^8.2.0"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^13.0.0",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^11.0.1",
"@semantic-release/npm": "^12.0.1",
"@semantic-release/release-notes-generator": "^14.0.1",
"@types/jest": "^29.5.14",
"@types/node": "^22.9.0",
"@typescript-eslint/eslint-plugin": "^8.13.0",
"@typescript-eslint/parser": "^8.13.0",
"@types/node": "^22.10.1",
"@typescript-eslint/eslint-plugin": "^8.16.0",
"@typescript-eslint/parser": "^8.16.0",
"@vitest/coverage-istanbul": "^2.1.6",
"arg": "^5.0.2",
"colors": "^1.4.0",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"dts-bundle-generator": "^9.2.5",
"eslint": "^8.42.0",
"dts-bundle-generator": "^9.5.1",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-simple-import-sort": "^12.0.0",
"eslint-plugin-unused-imports": "^4.1.4",
"husky": "^9.0.7",
"jest": "^29.7.0",
"husky": "^9.1.7",
"lint-staged": "^15.2.10",
"prettier": "^3.2.4",
"patch-package": "^8.0.0",
"prettier": "^3.4.1",
"semantic-release": "^24.2.0",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"typescript": "^5.6.3"
"typescript": "^5.7.2",
"vitest": "^2.1.6"
},
"license": "MIT",
"keywords": [
Expand Down Expand Up @@ -113,5 +112,10 @@
"path": "./node_modules/cz-conventional-changelog"
}
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
"pnpm": {
"patchedDependencies": {
"dts-bundle-generator": "patches/dts-bundle-generator.patch"
}
}
}
14 changes: 14 additions & 0 deletions patches/dts-bundle-generator+9.5.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/node_modules/dts-bundle-generator/dist/types-usage-evaluator.js b/node_modules/dts-bundle-generator/dist/types-usage-evaluator.js
index a09f141..9f25078 100644
--- a/node_modules/dts-bundle-generator/dist/types-usage-evaluator.js
+++ b/node_modules/dts-bundle-generator/dist/types-usage-evaluator.js
@@ -111,6 +111,9 @@ class TypesUsageEvaluator {
if (ts.isExportDeclaration(node) && node.exportClause !== undefined && ts.isNamedExports(node.exportClause)) {
for (const exportElement of node.exportClause.elements) {
const exportElementSymbol = (0, typescript_1.getImportExportReferencedSymbol)(exportElement, this.typeChecker);
+ if(exportElementSymbol === undefined) {
+ continue;
+ }
// i.e. `import * as NS from './local-module'`
const namespaceImportForElement = (0, typescript_1.getDeclarationsForSymbol)(exportElementSymbol).find(ts.isNamespaceImport);
if (namespaceImportForElement !== undefined) {
31 changes: 31 additions & 0 deletions src/cli/config.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { getConfig } from './config'
import { type CliParams } from './types'

const inputParams: CliParams = {
locales: ['en', 'cs', 'es'],
defaultLocale: 'en',
originDir: 'src/__mocks__/roots',
localizedDir: 'src/__mocks__/app',
prefixDefaultLocale: true,
packageDir: '',
}

describe('getConfig', () => {
test('valid config', () => {
const config = getConfig(inputParams)

expect(config.locales).toStrictEqual(['en', 'cs', 'es'])
expect(config.defaultLocale).toStrictEqual('en')
expect(config.prefixDefaultLocale).toStrictEqual(true)
expect(config.afterGenerate).toStrictEqual(undefined)
expect(config.getOriginAbsolutePath('page.ts')).toStrictEqual(
'src/__mocks__/roots/page.ts'
)
expect(config.getLocalizedAbsolutePath('page.ts')).toStrictEqual(
'src/__mocks__/app/page.ts'
)
expect(config.getDistAbsolutePath('index.js')).toStrictEqual(
'dist/index.js'
)
})
})
Loading

0 comments on commit 6fe81cb

Please sign in to comment.