Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,18 @@ First of all, I'd like to welcome you for thinking about contributing to this pr
- Run `npm start` or `yarn start`
- This will compile your code in `dist` and you're good to go.
- Run `yarn updated` to check which npm packages were updated
- Finally publish with 'yarn publishNPM' since yarn has some issues with publishing with lerna not sure why.
- Finally publish with 'yarn publishNPM' since yarn has some issues with publishing with lerna not sure why.
- Check caveats for publishing.

### 馃 Caveats

- Some issue with yarn not being able to publish via lerna
- Use yarn with everything else but lerna
- To publish always run via `npm` this command `npm run lerna`


### 馃惖 Other Stuff

- Use `// @remove-file-on-eject` to do just that.
- Use `// @remove-on-eject-begin` to do just that.
- Use `// @remove-on-eject-end` to do just that.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
"beforepublish": "lerna bootstrap",
"publish":
"bash tasks/publish.sh && echo 'Now update dependency packages.'",
"publishNPM": "bash tasks/publish.sh --npm-client=npm"
"publishNPM": "bash tasks/publish.sh --npm-client=npm",
"lerna":
"lerna updated && lerna bootstrap && lerna publish --independent --npm-client=npm"
}
}
17 changes: 17 additions & 0 deletions packages/cgb-scripts/config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,25 @@ const fs = require( 'fs' );
const pluginDir = fs.realpathSync( process.cwd() );
const resolveApp = relativePath => path.resolve( pluginDir, relativePath );

// Config after eject: we're in ./config/
module.exports = {
dotenv: resolveApp( '.env' ),
pluginBlocksJs: resolveApp( 'src/blocks.js' ),
yarnLockFile: resolveApp( 'yarn.lock' ),
pluginDist: resolveApp( '.' ), // We are in ./dist folder already so the path '.' resolves to ./dist/.
};

// @remove-on-eject-begin
const resolveOwn = relativePath => path.resolve( __dirname, '..', relativePath );

// config before eject: we're in ./node_modules/react-scripts/config/
module.exports = {
dotenv: resolveApp( '.env' ),
pluginBlocksJs: resolveApp( 'src/blocks.js' ),
pluginDist: resolveApp( '.' ), // We are in ./dist folder already so the path '.' resolves to ./dist/.
yarnLockFile: resolveApp( 'yarn.lock' ),
appPath: resolveApp( '.' ),
// These properties only exist before ejecting:
ownPath: resolveOwn( '.' ),
};
// @remove-on-eject-end
2 changes: 2 additions & 0 deletions packages/cgb-scripts/config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ module.exports = {
use: {
loader: 'babel-loader',
options: {
// @remove-on-eject-begin
babelrc: false,
presets: [ require.resolve( 'babel-preset-cgb' ) ],
// @remove-on-eject-end
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/
// directory for faster rebuilds.
Expand Down
2 changes: 2 additions & 0 deletions packages/cgb-scripts/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ module.exports = {
use: {
loader: 'babel-loader',
options: {
// @remove-on-eject-begin
babelrc: false,
presets: [ require.resolve( 'babel-preset-cgb' ) ],
// @remove-on-eject-end
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/
// directory for faster rebuilds.
Expand Down
16 changes: 16 additions & 0 deletions packages/cgb-scripts/eject/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,24 @@ const fs = require( 'fs' );
const pluginDir = fs.realpathSync( process.cwd() );
const resolveApp = relativePath => path.resolve( pluginDir, relativePath );

// Config after eject: we're in ./config/
module.exports = {
dotenv: resolveApp( '.env' ),
pluginBlocksJs: resolveApp( 'src/blocks.js' ),
pluginDist: resolveApp( '.' ), // We are in ./dist folder already so the path '.' resolves to ./dist/.
};

// @remove-on-eject-begin
const resolveOwn = relativePath => path.resolve( __dirname, '..', relativePath );

// config before eject: we're in ./node_modules/react-scripts/config/
module.exports = {
dotenv: resolveApp( '.env' ),
pluginBlocksJs: resolveApp( 'src/blocks.js' ),
pluginDist: resolveApp( '.' ), // We are in ./dist folder already so the path '.' resolves to ./dist/.
appPath: resolveApp( '.' ),
// These properties only exist before ejecting:
ownPath: resolveOwn( '.' ),
};

console.log( ownPath );
Loading