-
Notifications
You must be signed in to change notification settings - Fork 0
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 #3 from LeadooMT/update
Update package
- Loading branch information
Showing
22 changed files
with
27,163 additions
and
11,751 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,18 @@ | ||
name: Tests | ||
|
||
on: push | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [18.x, 20.x] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build w/ Node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: npm ci | ||
- run: npm test |
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,6 +1,4 @@ | ||
*.log | ||
.history | ||
.vscode | ||
|
||
node_modules | ||
/dist |
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,83 @@ | ||
const path = require("node:path"); | ||
const ResolveTypeScriptPlugin = require("resolve-typescript-plugin"); | ||
|
||
// Some workarounds: | ||
// - https://github.com/storybookjs/storybook/issues/14877#issuecomment-1000441696 | ||
async function handleWebpack(config, { | ||
configType | ||
}) { | ||
{ | ||
// Find the plugin instance that needs to be mutated | ||
const virtualModulesPlugin = config.plugins.find( | ||
(plugin) => plugin.constructor.name === "VirtualModulesPlugin" | ||
); | ||
// Change the file extension to .cjs for all files that end with "generated-stories-entry.js" | ||
virtualModulesPlugin._staticModules = Object.fromEntries( | ||
Object.entries(virtualModulesPlugin._staticModules).map( | ||
([key, value]) => { | ||
if (key.endsWith("generated-stories-entry.js")) { | ||
return [replaceFileExtension(key, ".cjs"), value]; | ||
} | ||
return [key, value]; | ||
} | ||
) | ||
); | ||
// Change the entry points to point to the appropriate .cjs files | ||
config.entry = config.entry.map((entry) => { | ||
if (entry.endsWith("generated-stories-entry.js")) { | ||
return replaceFileExtension(entry, ".cjs"); | ||
} | ||
return entry; | ||
}); | ||
} { | ||
config.module.rules.push({ | ||
test: /\.tsx?$/, | ||
exclude: /(node_modules|dist)/, | ||
use: [ | ||
{ | ||
loader: "ts-loader" | ||
} | ||
], | ||
resolve: { | ||
fullySpecified: false | ||
} | ||
}); | ||
config.resolve.extensions.push(".js", ".jsx"); | ||
config.resolve.plugins = config.resolve.plugins || []; | ||
config.resolve.plugins.push(new ResolveTypeScriptPlugin()); | ||
config.resolve.alias = { | ||
...(config.resolve.alias || {}), | ||
"@": path.resolve(__dirname, "../src") | ||
}; | ||
} | ||
return config; | ||
} | ||
|
||
function replaceFileExtension(filePath, newExtension) { | ||
const { | ||
name, | ||
root, | ||
dir | ||
} = path.parse(filePath); | ||
return path.format({ | ||
name, | ||
root, | ||
dir, | ||
ext: newExtension, | ||
}); | ||
} | ||
|
||
module.exports = { | ||
features: { | ||
storyStoreV7: false // Required for earlier workaround | ||
}, | ||
|
||
framework: { | ||
name: "@storybook/react-webpack5", | ||
options: {} | ||
}, | ||
|
||
stories: ["../stories/*.stories.[tj]sx"], | ||
|
||
webpackFinal: handleWebpack | ||
}; |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
{} |
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,3 @@ | ||
{ | ||
"typescript.preferences.importModuleSpecifierEnding": "js" | ||
} |
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,5 +1,10 @@ | ||
# React Bots Changelog | ||
|
||
## v0.3.0 | ||
_2023-06-22_ | ||
|
||
* Visual bot support | ||
|
||
## v0.2.1 | ||
_2020-08-25_ | ||
|
||
|
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
Oops, something went wrong.