generated from react18-tools/turborepo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from react18-tools/alpha
Alpha
- Loading branch information
Showing
10 changed files
with
121 additions
and
19 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"r18gs": patch | ||
--- | ||
|
||
Test if Next.js app router works when useRGS is exported as named export |
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,20 @@ | ||
{ | ||
"mode": "exit", | ||
"tag": "alpha", | ||
"initialVersions": { | ||
"@example/nextjs": "0.0.0", | ||
"@example/remix": "0.0.0", | ||
"@example/vite": "0.0.0", | ||
"r18gs": "1.1.2-alpha.0", | ||
"@repo/eslint-config": "0.0.0", | ||
"@repo/typescript-config": "0.0.0", | ||
"@repo/jest-presets": "0.0.0", | ||
"@repo/logger": "0.0.0", | ||
"@repo/shared": "0.0.1-alpha.0", | ||
"@repo/scripts": "0.0.0" | ||
}, | ||
"changesets": [ | ||
"five-roses-taste", | ||
"tall-oranges-sort" | ||
] | ||
} |
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,5 @@ | ||
--- | ||
"r18gs": patch | ||
--- | ||
|
||
Add minify plugin |
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 |
---|---|---|
@@ -1,18 +1,44 @@ | ||
import { defineConfig, type Options } from "tsup"; | ||
import react18Plugin from "esbuild-plugin-react18"; | ||
import cssPlugin from "esbuild-plugin-react18-css"; | ||
import { defineConfig } from "tsup"; | ||
import fs from "node:fs"; | ||
|
||
export default defineConfig( | ||
(options: Options) => | ||
({ | ||
format: ["cjs", "esm"], | ||
target: "es2019", | ||
entry: ["./src"], | ||
sourcemap: false, | ||
clean: !options.watch, | ||
bundle: true, | ||
minify: !options.watch, | ||
esbuildPlugins: [react18Plugin(), cssPlugin({ generateScopedName: "[folder]__[local]" })], | ||
...options, | ||
}) as Options, | ||
); | ||
export default defineConfig(options => ({ | ||
format: ["cjs", "esm"], | ||
target: "es2015", | ||
entry: ["./src"], | ||
sourcemap: false, | ||
clean: !options.watch, | ||
bundle: true, | ||
minify: !options.watch, | ||
esbuildPlugins: [ | ||
{ | ||
name: "improve-minify", | ||
setup(build) { | ||
build.onLoad({ filter: /utils.ts/ }, args => { | ||
let contents = fs.readFileSync(args.path, "utf8"); | ||
const lines = contents.split("\n"); | ||
const hackLine = lines.find(line => line.startsWith("const [VALUE,")); | ||
|
||
if (!hackLine) return { contents, loader: "ts" }; | ||
/** remove hackLine */ | ||
contents = contents.replace(hackLine, ""); | ||
|
||
/** clean up */ | ||
const tokens = hackLine | ||
.replace("const", "") | ||
.split("=")[0] | ||
.trim() | ||
.replace(/\]|\[/g, "") | ||
.split(",") | ||
.map((t, i) => ({ token: t.trim(), i })); | ||
|
||
tokens.sort((a, b) => b.token.length - a.token.length); | ||
|
||
for (const t of tokens) { | ||
contents = contents.replace(new RegExp(`${t.token}`, "g"), String(t.i)); | ||
} | ||
return { contents, loader: "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,15 @@ | ||
# @repo/shared | ||
|
||
## 0.0.1-alpha.1 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies [cad3c42] | ||
- [email protected] | ||
|
||
## 0.0.1-alpha.0 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies [46b9218] | ||
- [email protected] |
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