-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
1,197 additions
and
1,906 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,6 @@ | |
dist | ||
compiled | ||
doc_build | ||
|
||
# ignore all JS/TS files, use Biome | ||
**/*[.js,.ts,.jsx,.tsx.json,.json5] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,6 @@ The project is still under development, so it possible dependents on unstable Rs | |
|
||
Current unstable versions are: | ||
|
||
| Package | Version | Link | | ||
| ------------ | ------------------------------------------------------- | ------------------------------------------------------- | | ||
| @rspack/core | @rspack/core-canary@1.0.0-canary-26460a2-20240710092718 | [PR](https://github.com/web-infra-dev/rspack/pull/7102) | | ||
<!-- | Package | Version | Link | | ||
| ------------ | ------------------------------------------------------- | --------------------------------------------------------- | | ||
| @rspack/core | @rspack/[email protected]0b368b6-20240704171208 | [PR](https://github.com/webpack/webpack/pull/11751/files) | --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`should downgrade class private method by default 1`] = ` | ||
" | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/@[email protected]/node_modules/@swc/helpers/esm/_class_private_method_get.js | ||
function _class_private_method_get(receiver, privateSet, fn) { | ||
if (!privateSet.has(receiver)) throw new TypeError("attempted to get private field on non-instance"); | ||
return fn; | ||
} | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/@[email protected]/node_modules/@swc/helpers/esm/_check_private_redeclaration.js | ||
function _check_private_redeclaration(obj, privateCollection) { | ||
if (privateCollection.has(obj)) { | ||
throw new TypeError("Cannot initialize the same private elements twice on an object"); | ||
} | ||
} | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/@[email protected]/node_modules/@swc/helpers/esm/_class_private_method_init.js | ||
function _class_private_method_init(obj, privateSet) { | ||
_check_private_redeclaration(obj, privateSet); | ||
privateSet.add(obj); | ||
} | ||
;// CONCATENATED MODULE: ./e2e/cases/syntax/config/src/foo.ts | ||
var _bar = new WeakSet(); | ||
class Foo { | ||
constructor(){ | ||
_class_private_method_init(this, _bar); | ||
_class_private_method_get(this, _bar, bar).call(this); | ||
} | ||
} | ||
function bar() {} | ||
/*#__PURE__*/ | ||
;// CONCATENATED MODULE: ./e2e/cases/syntax/config/src/index.ts | ||
export { Foo }; | ||
" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { expect, test } from 'vitest'; | ||
import { buildAndGetEntryJsResults } from '#shared'; | ||
|
||
test('should downgrade class private method by default', async () => { | ||
const fixturePath = __dirname; | ||
const { contents } = await buildAndGetEntryJsResults(fixturePath); | ||
|
||
expect(contents.esm).toMatchSnapshot(); | ||
expect(contents.esm).not.toContain('#bar'); | ||
|
||
expect(contents.cjs).toContain('#bar'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { join } from 'node:path'; | ||
import { defineConfig } from '@rslib/core'; | ||
import { generateBundleCjsConfig, generateBundleEsmConfig } from '#shared'; | ||
|
||
export default defineConfig({ | ||
lib: [ | ||
generateBundleEsmConfig(__dirname, { | ||
output: { | ||
syntax: 'es2015', | ||
}, | ||
}), | ||
generateBundleCjsConfig(__dirname, { | ||
output: { | ||
syntax: ['node 20'], | ||
}, | ||
}), | ||
], | ||
source: { | ||
entry: { | ||
main: join(__dirname, 'src/index.ts'), | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class Foo { | ||
constructor() { | ||
this.#bar(); | ||
} | ||
|
||
#bar() {} | ||
} | ||
|
||
export { Foo }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Foo } from './foo'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "@rslib/tsconfig/base", | ||
"compilerOptions": { | ||
"baseUrl": "./", | ||
"paths": { | ||
"@src/*": ["./src/*"] | ||
} | ||
}, | ||
"include": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`should downgrade class private method by default 1`] = ` | ||
" | ||
;// CONCATENATED MODULE: ./e2e/cases/syntax/default/src/foo.ts | ||
class Foo { | ||
constructor(){ | ||
this.#bar(); | ||
} | ||
#bar() {} | ||
} | ||
;// CONCATENATED MODULE: ./e2e/cases/syntax/default/src/index.ts | ||
export { Foo }; | ||
" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { expect, test } from 'vitest'; | ||
import { buildAndGetEntryJsResults } from '#shared'; | ||
|
||
test('should downgrade class private method by default', async () => { | ||
const fixturePath = __dirname; | ||
const { contents } = await buildAndGetEntryJsResults(fixturePath); | ||
|
||
expect(contents.esm).toMatchSnapshot(); | ||
expect(contents.esm).toContain('#bar'); | ||
|
||
expect(contents.cjs).toContain('#bar'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { join } from 'node:path'; | ||
import { defineConfig } from '@rslib/core'; | ||
import { generateBundleCjsConfig, generateBundleEsmConfig } from '#shared'; | ||
|
||
export default defineConfig({ | ||
lib: [generateBundleEsmConfig(__dirname), generateBundleCjsConfig(__dirname)], | ||
source: { | ||
entry: { | ||
main: join(__dirname, 'src/index.ts'), | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class Foo { | ||
constructor() { | ||
this.#bar(); | ||
} | ||
|
||
#bar() {} | ||
} | ||
|
||
export { Foo }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Foo } from './foo'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "@rslib/tsconfig/base", | ||
"compilerOptions": { | ||
"baseUrl": "./", | ||
"paths": { | ||
"@src/*": ["./src/*"] | ||
} | ||
}, | ||
"include": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
"build:examples": "cross-env NX_DAEMON=false nx run-many -t build --projects @examples/* --parallel=10", | ||
"check-dependency-version": "check-dependency-version-consistency .", | ||
"check-spell": "npx cspell", | ||
"lint": "biome check . --diagnostic-level=warn && pnpm run check-spell", | ||
"lint": "biome check . --diagnostic-level=warn && pnpm run check-spell", | ||
"prebundle": "nx run-many -t prebundle", | ||
"prepare": "pnpm run build && simple-git-hooks", | ||
"sort-package-json": "npx sort-package-json \"packages/*/package.json\"", | ||
|
@@ -20,27 +20,24 @@ | |
"pre-commit": "npx nano-staged" | ||
}, | ||
"nano-staged": { | ||
"*.{md,mdx,json,css,less,scss}": "prettier --write", | ||
"*.{js,jsx,ts,tsx,mjs,cjs}": [ | ||
"biome check --apply --formatter-enabled=false --linter-enabled=false", | ||
"prettier --write" | ||
], | ||
"*.{md,mdx,css,less,scss}": "prettier --write", | ||
"*.{js,jsx,ts,tsx,mjs,cjs,json,jsonc,json5}": ["biome check --write"], | ||
"package.json": "pnpm run check-dependency-version" | ||
}, | ||
"devDependencies": { | ||
"@biomejs/biome": "^1.8.1", | ||
"@modern-js/module-tools": "^2.53.0", | ||
"@biomejs/biome": "^1.8.3", | ||
"@modern-js/module-tools": "^2.55.0", | ||
"@types/fs-extra": "^11.0.4", | ||
"check-dependency-version-consistency": "^4.1.0", | ||
"cross-env": "^7.0.3", | ||
"cspell-ban-words": "^0.0.3", | ||
"fs-extra": "^11.2.0", | ||
"nano-staged": "^0.8.0", | ||
"nx": "^19.3.0", | ||
"nx": "^19.4.2", | ||
"prettier": "^3.3.2", | ||
"prettier-plugin-packagejson": "^2.5.0", | ||
"simple-git-hooks": "^2.11.1", | ||
"typescript": "^5.4.5", | ||
"typescript": "^5.5.3", | ||
"vitest": "^1.6.0" | ||
}, | ||
"packageManager": "[email protected]", | ||
|
@@ -50,7 +47,7 @@ | |
}, | ||
"pnpm": { | ||
"overrides": { | ||
"@rspack/core": "npm:@rspack/core-canary@1.0.0-canary-26460a2-20240710092718" | ||
"@rspack/core": "1.0.0-alpha.3" | ||
} | ||
} | ||
} |
Oops, something went wrong.