@ts.adligo.org/slink
v1.8.0
Published
This is a simple Type Script Application that will create symbolic links from webpack config files with links created by webpack-link inside of your source folder, which improves speed of changing upstream Javascript or Typescript in a multiple project sy
Maintainers
Readme
slink.ts.adligo.org
This is a simple Type Script Application that will create and store symbolic link data into your package.json file under the dependencySLinks or dependencySLinkGroups sections. This can help you improve the speed of changing upstream Javascript or Typescript in a multiple project dependency system.
Install slink
SLink can now be installed just like any other package and linked to from your node_modules directory.
SLINK_HOME
SLINK_HOME is just like typical home environment variables and can be set as follows:
export SLINK_HOME=/c/foo/bar/node_modules/\@ts.adligo.org/slinkThis allows you customization over which SLink you are linking to, so that you can have different versions of slink installed.
Install slink Globally
To install slink run the following command;
npm install -g @ts.adligo.org/slink
# Update your path to include the slink cli program that calls slink.mjs
# Windows, Note the following backslach in the middle of this line may not copy and past correctly!
export PATH=$PATH:~/AppData/Roaming/npm/node_modules/\@ts.adligo.org/slink/dist/win
# Or Unix
export PATH=$PATH:/usr/local/lib/node_modules/\@ts.adligo.org/slink/dist/unix# Also if you need the Windows path, for Jenkins, it's something like this;
C:\Users\<your_username/>\AppData\Roaming\npm\node_modules\@ts.adligo.org\slink\dist\winVerify slink
cd ~
git clone https://github.com/adligo/pub-keys.adligo.org.git
slink --version
npm view @ts.adligo.org/slink dist.integrity > slink.sha512
cat slink.sha512
diff slink.sha512 ~/pub-keys.adligo.org/pub-keys/com/npmjs/ts.adligo.org/slink/slink_1.6.0.sha512Uninstall the package;
npm uninstall -g @ts.adligo.org/slinkRun slink
The following commands include the suggested usage from GitBash.
slink --debug
slink --version
slink --help
slink
slink --path `pwd`The SLink Build Matrix
In order to run the entire build with tests etc you will want to use the SLink Build Matrix Project.
Alternativly you can build slink from scratch @see the git repository;
sharedNodeModuleProjectSLinks
This will look for projects in the associated array of strings in entry order and attempt to link node_modules to the parent project. This allows sharing of node_modules installations for multiple projects. We are testing it now ...
sharedNodeModuleProjectSLinkEnvVar
This provides slink with a list of environment variables to scan for a node_modules directory, the path should be absolute. We are testing it now ...
dependencySrcSLinks @deprecated!
Note this has been deprecated as it didn't work as well as ../.. in VsCode! Don't use it! Instead use paths like the following in your imports; ../../<project_name/>/src/<module_file_name/>
These are the fastest and simplest links you can store in your package.json file. By default they will link to another project checked out in the same folder as the current project. Also by default slink will place a symbolic link named <project_name>@slink in your source folder.
In Example, under the root package.json object add the attribute;
"dependencySrcSLinks": [{
"project": "i_io.ts.adligo.org"
}],Then import the code in your TypeScript file;
import {I_Out} from './i_io.ts.adligo.org@slink/i_io.mts';dependencySLinkGroups @deprecated!
Note this has been deprecated as it didn't work as well as ../.. in VsCode! Don't use it! Instead use paths like the following in your imports; ../../<project_name/>/src/<module_file_name/>
These are links in your node_modlue folder to projects that are checkout in the same directory in the current folder. When using these kind of links you should continue to import your node modules as usual with dependencies in package.json. The settings here will delete the node_modules and create symbolic links to the projects checked out in the parent folder.
In Example, under the root package.json object add the attribute;
"dependencySLinkGroups": [{
"group": "@ts.adligo.org",
"projects": [{
"project": "io.ts.adligo.org",
"modulePath": "io"}]
}],Build Locally
You can build SLink locally with npm;
cd slink.mts.adligo.org
npm run buildLink Locally
You can link this slink command line application locally with npm;
cd slink.mts.adligo.org
npm run link-slinkInstall Locally
You can install this slink command line application locally with npm;
npm run build
npm pack
npm install -g <packOuputFileName/>
# i.e.
# npm install -g ts.adligo.org-slink-1.6.1d.tgz
# Then update the executable shim to include --disable-warning=DEP0190 if you want
which slink
cat `which slink`
cp src/slink.sh `which slink`Note: You may need to reload your terminal if you install slink this way, check for slink -v!
Compile / Run the TypeScript Compile (creates a bin and dist folder)
npm run tscDevelopment Install it from the local code
npm install -g .Release Slink
If you have a working copy of slink from a npm install you will not need to do this.
With out a working installation of slink you will need to run two npm installs one in
slink.ts.adligo.org and one in slink_tests.ts.adligo.org. Then you can run npm run build for slink and npm run tests (i.e. npm run testsWindows) in slink_tests.
Once that's done run the following from slink.ts.adligo.org ;
npm publish Note for Windows Users
Creating a symbolic link is kind of a huge pain in Windows. First try to see if you can do it without slink using this short tutorial;
