-
Notifications
You must be signed in to change notification settings - Fork 27
Local development enhancements #384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
f03ebb1
chore: Additional features to support local development.
tekante 8de5242
chore: Adjust PR tests to skip duplicative steps and add project gene…
tekante 9d89ae5
chore: Adjust workflow to allow for manual initiation for testing.
tekante 0ab10d6
chore: Further workflow tweaks to facilitate testing.
tekante cbcc640
chore: Update all references to changed build job key.
tekante 5807ebf
chore: formatting fixes
tekante f736298
chore: Correct the mktemp call so that it makes a directory.
tekante 9398b71
chore: Adjust project template to use the postcss config from the pro…
tekante 2a06af0
chore: Correct light-dom module reference.
tekante f0c5d51
chore: Allow the light-dom.mjs file to be included.
tekante 8a049d2
chore: Include a type file for light-dom module to avoid automatic an…
tekante 236ec8c
chore: Exclude sample from rollup config.
tekante 201b9bb
chore: Remove sample component from typescript compilation to facilit…
tekante 6b0ad3c
chore: Formatting fixes.
tekante 41b6f57
chore: Clean up branch names triggering build action.
tekante 0c0dba5
chore: Clean up branches which trigger a build.
tekante 803af39
Merge branch 'next' into feature/local-dev-dx
himerus 74d8364
fix(prettier): Update for prettier.
himerus 0d1174a
Merge branch 'next' into feature/local-dev-dx
himerus bfce63c
Merge branch 'next' into feature/local-dev-dx
himerus 395913d
Merge branch 'next' into feature/local-dev-dx
himerus 787cad8
Merge pull request #385 from phase2/feature/comprehensive-updates
himerus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,6 @@ | ||
| /** | ||
| * Add the scopeId to each CSS rule selector. | ||
| * Handle the :host and ::slotted selectors. | ||
| */ | ||
| export function addScopeToStyles(cssStyles: string, scopeId: string): string; | ||
| //# sourceMappingURL=light-dom.d.mts.map |
This file contains hidden or 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 hidden or 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 hidden or 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
81 changes: 81 additions & 0 deletions
81
packages/outline-templates/default/scripts/link-for-local-dev.js
This file contains hidden or 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,81 @@ | ||
| /** | ||
| * Takes an argument of the path to a directory containing package directories to link for | ||
| * local development. Will register them all for local development in the current project. | ||
| */ | ||
himerus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| const fs = require('fs'); | ||
| const path = require('path'); | ||
| const { exec } = require('child_process'); | ||
|
|
||
| const directoryPath = process.argv[2]; | ||
| const pattern = /^[^\.]/; | ||
|
|
||
| const originalCwd = process.cwd(); | ||
|
|
||
| if (!directoryPath) { | ||
| console.error( | ||
| 'Directory containing packages to link must be provided as first argument' | ||
| ); | ||
| process.exit(1); | ||
| } | ||
|
|
||
| fs.readdir(directoryPath, async (err, files) => { | ||
| if (err) { | ||
| console.error(`Error reading directory: ${err}`); | ||
| process.exit(1); | ||
| } | ||
|
|
||
| const matchingDirs = files.filter(file => { | ||
| const filePath = path.join(directoryPath, file); | ||
| return fs.statSync(filePath).isDirectory() && pattern.test(file); | ||
| }); | ||
|
|
||
| if (matchingDirs.length === 0) { | ||
| console.log( | ||
| `No directories matching pattern: /${pattern}/ found in ${directoryPath}` | ||
| ); | ||
| process.exit(); | ||
| } | ||
|
|
||
| for (const dir of matchingDirs) { | ||
| const dirPath = path.join(directoryPath, dir); | ||
| const pkgJsonPath = path.join(dirPath, 'package.json'); | ||
|
|
||
| if (!fs.existsSync(pkgJsonPath)) { | ||
| console.error(`Skipping ${dirPath}: No 'package.json' file found`); | ||
| continue; | ||
| } | ||
|
|
||
| const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath)); | ||
|
|
||
| try { | ||
| process.chdir(dirPath); | ||
|
|
||
| await execAsync('yarn unlink').catch(error => { | ||
| if (!error.message.includes('No registered package found')) { | ||
| throw error; | ||
| } | ||
| }); | ||
|
|
||
| const linkOutput = await execAsync(`yarn link`); | ||
| process.chdir(originalCwd); | ||
|
|
||
| const linkOutput2 = await execAsync(`yarn link ${pkgJson.name}`); | ||
| } catch (error) { | ||
| console.error(`Error linking package: ${error}`); | ||
| process.exit(1); | ||
| } | ||
| } | ||
| }); | ||
|
|
||
| function execAsync(command) { | ||
| return new Promise((resolve, reject) => { | ||
| exec(command, (error, stdout, stderr) => { | ||
| if (error) { | ||
| reject(error); | ||
| } else { | ||
| resolve(stdout); | ||
| } | ||
| }); | ||
| }); | ||
| } | ||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.